Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
I want to fetch the Affected Objects for the type Variance in a workflow.
My doubt how to fetch all the objects added to affected objects of Variance? Suggestions/APIs please.
Hi Anjali Sharma,
You may like to try below code snippet:
public class AffectedObjectsVariance {
public static void main(String[] args) throws ObjectNoLongerExistsException, WTException {
ObjectIdentifier eoid = ObjectIdentifier.newObjectIdentifier("wt.change2.WTVariance:2336782");
WTVariance var = (WTVariance)PersistenceHelper.manager.refresh(eoid);
System.out.println("Variance Name >> " + var.getName());
QueryResult qr = ChangeHelper2.service.getChangeables(var);
System.out.println("Total Objects in Variance >> " + qr.size());
while (qr.hasMoreElements()) {
WTPart prt = (WTPart) qr.nextElement();
System.out.println("Part Name >> " + prt.getNumber());
}
}
}
I hope this helps you!
Regards,
Shirish
It worked. Thanks.
Hi ,
I got requirement same like I have to get list of parts in where used tab of respective part.
I am new in windchill and do it ASAP.
pls share the code .
Thanks in Advance