Skip to main content
11-Garnet
September 20, 2010
Question

PBO Variable

  • September 20, 2010
  • 3 replies
  • 1119 views
Does anyone know how to capture the PBO number as a workflow variable? We have a need to display this number in email notifications and task.

3 replies

10-Marble
September 20, 2010
This example is from our ECN workflow

wt.change2.WTChangeOrder2 ecn = (wt.change2.WTChangeOrder2)primaryBusinessObject;
number=ecn.getNumber();
description = ecn.getDescription();
if (description.equals(null)){
description=";
}
creator=ecn.getCreatorFullName();
1-Visitor
September 20, 2010
For a Change Request:
String ecrName = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getName(); // Name
String ecrNumber = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getNumber(); // Number
String ecrDescription = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getDescription(); // Description
String ecrContainer = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getContainerName(); // Product written in

For a Change Order:
String ecoName = ((wt.change2.WTChangeOrder2)primaryBusinessObject).getName(); // Name
String ecoNumber = ((wt.change2.WTChangeOrder2)primaryBusinessObject).getNumber(); // Number
String ecoDescription = ((wt.change2.WTChangeOrder2)primaryBusinessObject).getDescription(); // Description
String ecoContainer = ((wt.change2.WTChangeOrder2)primaryBusinessObject).getContainerName(); // Product written in
1-Visitor
September 20, 2010
At Alcon we use this on almost all the task so that we can track them much easier and more efficiently.

The documentation (API’s) can be found under:

[Windchill root]\codebase\wt\clients\library\api \index.html

This will helps answer a lot of questions such as this one it also allows you tet get and set much more(need date, Description and etc.)

Also you can place the number in a task after you implement the above posted code. The power point attached walks you through how to do this on a CR but can be followed for CN\CT also. This may help give you some good ideas or jumping off points for your need.