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

Hello all, Is there any way to get active promotion requests on a part/document?

Participant

Hello all, Is there any way to get active promotion requests on a part/document?

Given a specific part, we would like to get linked promotion request and/or change notice that is still active.

Tags (1)
2 REPLIES 2

Re: Hello all, Is there any way to get active promotion requests on a part/document?

For changes, I used - http://support.ptc.com/cs/wncdoc/102/wcapi/wt/change2/ChangeService2.html#getLatestChangeRequest(wt....

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

Re: Hello all, Is there any way to get active promotion requests on a part/document?

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?

Announcements
LiveWorx Call For Papers Happening Now!