Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Vaughn,
Below is the sample code. Check if work for you
private static void revise(PromotionNotice pn) {
//wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
try {
wt.fc.QueryResult qr = wt.maturity.MaturityHelper.service.getPromotionTargets(pn);
while(qr.hasMoreElements()) {
// For all promotables
Object obj = qr.nextElement();
if (obj instanceof wt.lifecycle.LifeCycleManaged) {
// Get revision, and check if revision is not numeric
wt.enterprise.RevisionControlled rc = (wt.enterprise.RevisionControlled)obj;
String version = rc.getIterationDisplayIdentifier().toString();
System.out.println("+version);
//if (version equal to A)
//Do Something like
// else
// do Something
}
else {
System.out.println("No Lifecycle Managed object found!");
}
}
} catch (wt.maturity.MaturityException me) {
me.printStackTrace();
} catch (wt.util.WTException wte) {
wte.printStackTrace();
}
// END
}
Hope this helps !!!
Thanks,
Shreyas