How to call an info engine task from a workflow expression in Windchill PDMLink

Sample Code snippet is given below: 

if(primaryBusinessObject != null && primaryBusinessObject instanceof wt.doc.WTDocument){
 
com.infoengine.SAK.Task task = new com.infoengine.SAK.Task("examples/queryForObject.xml"); // RELATIVE PATH OF THE INFO ENGINE TASK XML 
task.addParam("type","wt.doc.WTDocument");
task.addParam("number",((wt.doc.WTDocument)primaryBusinessObject).getNumber());
task.invoke();
 

com.infoengine.object.factory.Group group = task.getGroup("result");
String name = new String((String)group.getAttributeValue(0,"name"));
  }

猜你喜欢

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