•How to write an info engine task to query for the attributes of an object

  • Create the xml file for the task under the Windchill/tasks/CUSTOM_FOLDER/NAME_OF_TASK.xml
<%@page language="java"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
 
<ie:webject name="Get-Properties" type="MGT">
    <ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/>
    <ie:param name="GROUP_OUT" data="properties"/>
</ie:webject>
 
<ie:webject name="Query-Objects" type="OBJ">
 
<ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/>
    <ie:param name="ATTRIBUTE" data="name,number" delim=","/>
<ie:param name="TYPE" data="$(@FORM[]type[])" default="wt.doc.WTDocument"/>
<ie:param name="WHERE" data="number='$(@FORM[]number[])'" default=""/>
<ie:param name="GROUP_OUT" data="result"/>
</ie:webject>
 
<%
Group g = getGroup("result");
g.toXML( new java.io.PrintWriter(System.out), true);
 
Enumeration enumer = g.getElements();
while (enumer.hasMoreElements()) {
System.out.println("**************************************************************Start printing all the columns of the custom object type***********************************************");
Element e = (Element)enumer.nextElement();
System.out.println(e);
System.out.println("**************************************************************End printing all the columns of the custom object type***********************************************");
}
 
%>
 
<ie:webject name="Return-Groups" type="GRP">
<ie:param name="GROUP_IN" data="result" />
</ie:webject>

猜你喜欢

转载自felixli.iteye.com/blog/1190212