cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

To fetch affected objects for Variance

ash
6-Contributor
6-Contributor

To fetch affected objects for Variance

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.

3 REPLIES 3

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

ash
6-Contributor
6-Contributor
(To:ShirishMorkhade)

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 

 

Announcements

Top Tags