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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

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

dbharade
4-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.

3 REPLIES 3
BineshKumar1
13-Aquamarine
(To:dbharade)

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?

VladiSlav
17-Peridot
(To:hpali)

hpali, thank you for the code provided. It worked for us
Announcements

Top Tags