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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Translate the entire conversation x

Update Value of an Attribute on Resulting Objects (type EPMDocument) through Expression Robot

PA_11085333
2-Explorer

Update Value of an Attribute on Resulting Objects (type EPMDocument) through Expression Robot

Hello! I am looking for some help with updating the value of an attribute that exists on resulting objects of a change activity through the use of an expression robot in the workflow of the change activity. The resources I've been able to find all seem to call out the object that's having its attribute modified as the primarybusinessobject, so where I am having trouble is calling to the resulting objects while the change activity is the primarybusinessobject of the workflow.
 
I tried the following, but had the error returned "WTChangeActivity2 cannot be converted to FormDataHolder"
 

wt.change2.WTChangeActivity2 changeTask = (wt.change2.WTChangeActivity2) primaryBusinessObject;

 

java.util.Vector results = com.ptc.windchill.enterprise.changeable.ChangeableDataFactory.getResultingObjects(changeTask);

2 REPLIES 2

Could you share some more of the code you're trying?

 

Essentially I think you need to navigate from the ECN to the Resulting Objects. A first step would be this: https://www.ptc.com/en/support/article/CS55955?source=search

 

MTH
10-Marble
10-Marble
(To:PA_11085333)

 

PA_11085333

You can use this code snippet

 

ChangeActivity2 changeActivity = (ChangeActivity2) primaryBusinessObject;
QueryResult theChangeablesAfterResult = ChangeHelper2.service.getChangeablesAfter(changeActivity,
false);
while (theChangeablesAfterResult.hasMoreElements()) {
Object element = theChangeablesAfterResult.nextElement();
if (element instanceof ChangeRecord2) {
changeRecord = (ChangeRecord2) element;
Changeable2 theChangeable = changeRecord.getChangeable2();

Announcements
Top Tags