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

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

To fetch affected objects for Variance

ash
10-Marble
10-Marble

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

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