Synchronize on an External Event
This topic provides a sample of the Synchronize robot node governing a process until an external event occurs.
Referenced Workflow
SynchronizeOnExternalEvent.xml
Description
A robot can stop the progress of a process until an external event is triggered, such as the check in or check out of an object. The code below demonstrates how to synchronize the check in of the primary business object. When the primary business object is checked in, it sets the result to Released.
Instructions
Copy the following code:
//Get the document that emitted the CheckIn event
wt.doc.WTDocument targetObject = ( wt.doc.WTDocument ) ((wt.events.KeyedEvent) event).getEventTarget();
//Check if the targetObject represents the primaryBusinessObject, if so the PBO has been checkedIn , hence set result to "Checked In"
if ( targetObject.getNumber( ). equals(((wt.doc.WTDocument ) primaryBusinessObject). getNumber( ))){
result = "Checked In";
}