Setting Attributes with the Execute Expression Robot
The following expression sets a part attribute value that is specified by the workflow process creator in an activity. The updated value is then available in a second task assigned to the creator or from the part information page.
Instructions
Copy the following code:
System.out.printIn("EXPRESSION START");
wt.fc.Persistable pbo = (wt.fc.Persistable )primaryBusinessObject;

if(pbo instanceof wt.part.WTPart){
wt.part.WTPart part = (wt.part.WTPart)pbo;
part.setPartType(wt.part.PartType.toPartType(PartType));
wt.fc.PersistenceServerHelper.manager.update(part);

}else{

System.out.printIn("PBO is not instance of Part: Do nothing in workflow expression")'
}
Was this helpful?