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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

How to get the attached objects (Documents or Parts) from the Promotion Request

sp-2
1-Newbie

How to get the attached objects (Documents or Parts) from the Promotion Request

Hi,


I am trying to customize the OOTB Promotion Request workflow. Any idea how can I get the attched or associated documents/parts from the Promotion Request in the workflow expression? If I can get the document objects attached to the Promotion Request, then only I can proceed. Please suggest.


Thanks


Sitanshu

1 REPLY 1
RandyJones
19-Tanzanite
(To:sp-2)

On 02/16/12 05:23, Sitanshu Prasad wrote:
>
> Hi,
>
> I am trying to customize the OOTB Promotion Request workflow. Any idea how can
> I get the attched or associated documents/parts from the Promotion Request in
> the workflow expression? If I can get the document objects attached to the
> Promotion Request, then only I can proceed. Please suggest
>
Something like the following will loop thru the objects in a Promotion Notice:

wt.maturity.StandardMaturityService p = new wt.maturity.StandardMaturityService();
wt.maturity.PromotionNotice pn =(wt.maturity.PromotionNotice)primaryBusinessObject;
wt.fc.QueryResult pn_targets;
pn_targets = (wt.fc.QueryResult) p.getBaselineItems(pn);
wt.epm.EPMDocument epmDoc = new wt.epm.EPMDocument();
while (pn_targets.hasMoreElements())
{
     Object obj =pn_targets.nextElement();
     String objType =obj.getClass().getName();
     if (objType.equals("wt.epm.EPMDocument") | objType.equals("wt.part.WTPart") )
     {
         epmDoc = (wt.epm.EPMDocument)obj;
         System.out.println("state = " + epmDoc.getState().toString());
         System.out.println("cadname = " + epmDoc.getCADName());
     }
}

> Thanks
>
> Sitanshu
>
>
> ----------


--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: -
Phone: 785-823-3276
   Fax: 785-667-2695
------------------------------------------------------------------------

Top Tags