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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

API To Get Container from Workflow PBO

pwilliams-3
12-Amethyst

API To Get Container from Workflow PBO

10.1 M040
Hi Everyone,
I have an expression in a workflow where I want to analyze the Creation timestamp for the Product container of the Change Notice (primaryBusinessObject). I have tried the below code but it is returning the Organization as the container even though the Change Notice was created within a Product.

System.out.println("Container: " + ((wt.change2.ChangeOrder2)primaryBusinessObject).getContainer().getContainerName());
System.out.println("Timestamp: " + ((wt.change2.ChangeOrder2)primaryBusinessObject).getContainer().getDefaultDomain().getCreateTimestamp());

2014-09-18 14:58:47,145 INFO [WfPropagationQueue.PoolQueueThread-16] wt.system.out wcadmin - Steelcase Inc.: 2013-02-26 18:13:10.0

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01CFD355.6B477600]

2 REPLIES 2

Hi Patrick,


Did you try this to get the productcontainer name using below API?


((wt.change2.WTChangeOrder2) primaryBusinessObject).getContainerName();


And the second line of your code gives the create time stamp of the /Default domain of the the product container, I believe you can directly get it by


((wt.change2.ChangeOrder2)primaryBusinessObject).getContainer().getCreateTimestamp());


Regards,


Karthick

In Reply to Patrick Williams:


10.1 M040
Hi Everyone,
I have an expression in a workflow where I want to analyze the Creation timestamp for the Product container of the Change Notice (primaryBusinessObject). I have tried the below code but it is returning the Organization as the container even though the Change Notice was created within a Product.

System.out.println("Container: " + ((wt.change2.ChangeOrder2)primaryBusinessObject).getContainer().getContainerName());
System.out.println("Timestamp: " + ((wt.change2.ChangeOrder2)primaryBusinessObject).getContainer().getDefaultDomain().getCreateTimestamp());

2014-09-18 14:58:47,145 INFO [WfPropagationQueue.PoolQueueThread-16] wt.system.out wcadmin - Steelcase Inc.: 2013-02-26 18:13:10.0

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01CFD355.6B477600]








Cast PBO as WTContained or Foldered.






Announcements


Top Tags