Skip to main content
11-Garnet
Sep 20, 2010 5:46 PM UTC
Question

PBO Variable

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
Sep 20, 2010 5:49 PM UTC
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();
Translate
1-Visitor
Sep 20, 2010 5:51 PM UTC
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
Translate
1-Visitor
Sep 20, 2010 8:13 PM UTC
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.

Translate