Given a specific part, we would like to get linked promotion request and/or change notice that is still active.
For changes, I used - http://support.ptc.com/cs/wncdoc/102/wcapi/wt/change2/ChangeService2.html#getLatestChangeRequest(wt.change2.ChangeableIf…
there are similar methods for changeissue and changeorder in ChangeHelper2
For promotions, I used WTCollection pNotices = MaturityHelper.service.getPromotionNotices(wCollect); wCollect is a part collection
Hi ,
For to get active Promotion Notice from Affected object we can use following logic
WTObject returnObj = null;
wt.maturity.StandardMaturityService p=new wt.maturity.StandardMaturityService();
WTArrayList arr=new WTArrayList();
arr.add(wtPart);
WTCollection pn1=p.getPromotionNotices(arr);
PromotionNotice not=null;
if(!(pn1.isEmpty()))
{
for (Object nott: pn1)
{
ObjectReference or=(ObjectReference) nott;
Persistable per=or.getObject();
if(per instanceof PromotionNotice)
{
not=(PromotionNotice) per;
System.out.println("Notices"+not);
LifeCycleState state=not.getState();
String s=state.toString();
if(s.equalsIgnoreCase("UNDERREVIEW") )
{
returnObj = not;
}
}
}
}
return returnObj;
Similarly if we want Change Notice from WTPart/WTDocument directly do you know any API?