Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello,
I want to creat a link between two objects
This is the task but i tried to invoke it with dispatche-Tasks webject but it didn't work
CreateLink.jsp
<%@page language="java" session="true" contentType="text/html; charset=UTF-8"
%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%><%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"
%><ie:getService varName="ie" /><%@ include file="../init.jspf"
%><%
/**A
* Création d'un article
**/
%><html>
<head>
<title>Create Part</title>
</head>
<body>
<form method="POST" enctype="multipart/form-data">
Creation de deux objets et un lien Essai 8
<table>
<tr><td align="right"><strong>Part Name:</strong></td><td><input type="text" name="from" value="premier article" size="30" /></td></tr>
<tr><td align="right"><strong>Part Name:</strong></td><td><input type="text" name="to" value="deuxiéme article" size="30" /></td></tr>
<tr><td align="right"><strong>Content:</strong></td><td><input type="file" name="file" /></td></tr>
<tr><td colspan="2" align="right"><input type="submit" value="créer" /></td></tr>
</table>
</form>
<%
if ( "POST".equals ( request.getMethod() ) )
{
//
// création de groupe d'entrée
//
%>
<ie:webject name="Create-Group" type="GRP">
<ie:param name="GROUP_OUT" data="input" />
<ie:param name="ELEMENT" data="class=WCTYPE|wt.fc.ObjectToObjectLink!name=$(@FORM[]from[]to[])!obid=@$(localWindchillDomain[]domain[])!folderingInfo.cabinet=$(currentUserInfo[]defaultCabinetRef[])!view=Design" /> />
<ie:param name="DELIMITER" data="!" />
</ie:webject>
<%--
<ie:webject name="Create-Links" type="ACT">
<ie:param name="INSTANCE" data="${@FORM[]supporting-adapter[*]}"/>
<ie:param name="TYPE" data="class=WCTYPE|wt.fc.ObjectToObjectLink"/>
<ie:param name="FROM_OBJECT_REF" data="0000000101"/>
<ie:param name="TO_OBJECT_REF" data="0000000102"/>
<ie:param name="GROUP_OUT" data="input" />
--%>
<%
//
// dispatch the task
//
try {
%>
<ie:webject name="Dispatch-Tasks" type="MGT">
<ie:param name="CLIMBER" data="com.ptc.core.adapter.server.impl.WindchillTypeHierarchy" />
<ie:param name="GROUP_IN" data="input" />
<ie:param name="ACTION" data="ExampleCreate" />
<ie:param name="PARAM" data="role=THUMBNAIL3D" />
</ie:webject>
<%
} catch ( Exception e ) {
%><br/><br/><font color="red"><%=e.getLocalizedMessage()%></font>
<c:set var="error" value="true" /><%
pageContext.getOut().flush();
}
//
// done.
//
%>
<c:if test="${error==null}">
<%@ include file="../actionDone.inc"%>
</c:if>
<ie:webject name="Display-Table" type="DSP" /><%
} // end if POST
%></body>
</html>
CreateLink.xml
<%@page language="java" session="false" import="com.infoengine.au.NamingService"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<!--com.infoengine.delegate.def
@comment Création d'un lien de type ObjectToObject
@delegateName ExampleCreate
-->
<!--com.infoengine.soap.rpc.def
Création d'un lien de type ObjectToObjectLink.
@param INFOENGINE_GROUP input The input group containing the type of link to create.
@param string from .
@param string to (doit être de type Master)
@param string[] field paramétres à saisir
@return INFOENGINE_GROUP ${output} Le nouveau objet link
-->
<ie:unit>
<ie:init>
<ie:webject name="Start-Session" type="ACT">
<ie:param name="INSTANCE" data="${@FORM[]supporting-adapter[*]}" valueSeparator=";" delim=";" default="<%=NamingService.getVMName()%>"/>
<ie:param name="BLOB_COUNT" data="0" />
<ie:param name="GROUP_OUT" data="session"/>
</ie:webject>
<ie:webject name="Start-Transaction" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
</ie:webject>
</ie:init>
<ie:success>
<ie:webject name="Commit-Transaction" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
</ie:webject>
<ie:webject name="End-Session" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
</ie:webject>
</ie:success>
<ie:failure>
<ie:webject name="Rollback-Transaction" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
</ie:webject>
<ie:webject name="End-Session" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
</ie:webject>
<!--
Calling Throw-Exception without any arguments will propogate the exception
caught by this failure.
-->
<ie:webject name="Throw-Exception" type="MGT" />
</ie:failure>
<!--
La sortie est workingCopy
-->
<ie:webject name="CheckOut-Objects" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
<ie:param name="OBJECT_REF" data="${@FORM[]from[]}" />
<ie:param name="GROUP_OUT" data="workingCopy" />
</ie:webject>
<!--
Création du lien
-->
<ie:webject name="Create-Links" type="ACT">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
<ie:param name="TYPE" data="${input[]class[]}"/>
<ie:param name="FROM_OBJECT_REF" data="${workingCopy[0]obid[]}"/>
<ie:param name="TO_OBJECT_REF" data="${@FORM[]to[]}"/>
<ie:param name="FIELD" data="${@FORM[]field[*]}" valueSeparator=";" delim=";" />
<ie:param name="GROUP_OUT" data="${@FORM[]group_out[]}" default="output" />
</ie:webject>
<!-- -->
<!--
CheckIn
-->
<ie:webject name="CheckIn-Objects" type="OBJ">
<ie:param name="INSTANCE" data="${session[0]INSTANCE[0]}"/>
<ie:param name="SESSION_ID" data="${session[0]SESSION_ID[0]}" />
<ie:param name="GROUP_IN" data="workingCopy" />
<ie:param name="GROUP_OUT" data="checkedIn" />
</ie:webject>
</ie:unit>
<!--
Explicitly return a single group containing the new link.
-->
<ie:webject name="Return-Groups" type="GRP">
<ie:param name="GROUP_IN" data="${@FORM[]group_out[]}" default="output" />
</ie:webject>