Try OpenEdge Now
skip to main content
Developing BPM Applications with Developer Studio
Managing business objects : Using business objects in applications : Using business objects in scripts

Using business objects in scripts

You can use scripts (as described in Adding script to a workstep) 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.
Progress Developer Studio for OpenEdge 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.