Skip to main content
1-Visitor
March 22, 2017
Question

To fetch affected objects for Variance

  • March 22, 2017
  • 1 reply
  • 1673 views

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.

1 reply

16-Pearl
March 22, 2017

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

ash1-VisitorAuthor
1-Visitor
March 23, 2017

It worked. Thanks.