Try OpenEdge Now
skip to main content
User's Guide
Managing business objects : Using business objects in applications : Using business objects in scripts
 

Using business objects in scripts

You can use scripts to set the value of business object attributes. You can add the required script in the Before Activation and When Completed tabs of the workstep Properties, as well as an overdue action.
Business Process Modeler provides the getExprEval() method, which returns a ObjectGraphService object. You can use this object to set the attribute values of the specified business object.
The following code provides an example of this functionality:
var empObj_DS = jst.getDataSlotValue("Employee_DS");
var exprEval = jst.getExprEval();
exprEval.setValue(empObj_DS, "firstName", "Sam");
jst.putDataSlot("Employee_DS", empObj_DS);
where Employee_DS is the dataslot of type, "Business Object" mapped to the "empObj_DS" business object with "firstName" attribute.