Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. 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