Skip to main content
13-Aquamarine
September 18, 2014
Question

API To Get Container from Workflow PBO

  • September 18, 2014
  • 2 replies
  • 1526 views
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

1-Visitor
September 18, 2014

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]








1-Visitor
September 18, 2014
Cast PBO as WTContained or Foldered.