Workflow events in the base system Several workflow events are available in the base system. Table 1. Workflow events in the base system Event Description Purpose To use Source Thread Listeners activityComplete String value used by activity definitions to respond to the onActivityComplete event handler. Informs records in the Workflow Executing Activity [wf_executing] table about the completion of other activities in the same workflow context. If the activity is allowed to set the boolean value for wf_executing.notify_termination, then set the value to true (activity.notify_termination = true) during the onExecute event. Workflow Engine, Process Terminations Current thread, current mutex Join activity otherEvent String value used by the Join activity to respond to an otherEvent. Informs records in the Workflow Executing Activity [wf_executing] table about an otherEvent that has completed. The Join activity transitions from n number of preceding activities. These preceding activities all create a wf_executing record, which causes a check to see if the record already exists. If the Join already exists, then the Join created by the executing transition sets the wf_executing record for deletion. Join activity Current thread, current mutex Join activity, onOtherEvent event handler timer String value used by workflow activities to respond to a Timer activity that has expired. Allows wf_executing records to be informed about a timer activity that has completed and has fired the timer event. The Timer activity schedules a job that calls a script. The script calls fireEvent (wf_executing, timer). Timer activity via a scheduled job Worker thread, private mutex Timer activity, onTimer event handler execute String value used by workflow activities to respond to a Timer activity that has expired. Informs a record in the wf_executing table with the initial state of Executing to proceed with its primary work. The workflow engine, for each transition executed, creates an executing record with a state of Executing. Once created, the executing record is put in a queue for processing. For each item in the queue, the Rhino globals are established, the activity definition that drives the executing record is instantiated, and the run() function is called. When the state of a record is Executing, this function always calls onExecute. Workflow engine, via the WFActivity Handler Current thread, current mutex All activities, onExecute event handler execute (specific to Lock) String value used by the Lock activity to respond to a waiting lock that is ready to make another attempt to obtain a specific lock. This execute is different than the previous execute because it is called on a separate thread, at specified intervals, and is treated as an outside event. Informs a wf_executing record waiting to execute that the specified wait interval has passed and that it should attempt to get the lock again. Lock activity schedules a job with a script that uses the workflow script include's fireEvent(wf_executing, 'execute') method. Lock activity via a scheduled job Worker thread, private mutex Lock activity, onExecute event handler determineApprovalState String value used by approval activities to respond to a change in the overall approval status of the current record. Informs wf_executing records for approval activities about an approval that completed and triggered the timer event. Approval Coordinator both registers for the event and triggers the event. The child approvals have listeners that determine their approval state. Approval Coordinator triggers the event during its onExecute Current thread, current mutex Approval Coordinator, Approval - User, and Approval - Group all have onDetermineApprovalState event handlers. If the state is anything but Requested, the activity is considered finished, and the approval state (Approved, Rejected, Cancelled) is set to the wf_executing.result column cancel (from within activity definitions) String value used by workflow activities to respond to a request for cancellation. Informs all wf_executing records in a context that the workflow is being canceled. The End activity uses the global workflow.broadcastEvent('cancel') to interrupt the currently running wf_executing records. This changes the state of those records to Cancelled. End activity Current thread, current mutex All activities, onCancel event handler cancel (outside current context) String value used by workflow activities to respond to a request for cancellation. This event is the same as the cancel event above and handled the same. However, the management of this event is subtly different. This event informs all wf_executing records in a context that the workflow is being canceled. The event is managed via the onCancel event handler of each executing activity definition, but the event is called differently. In particular, the call to cancel from outside an activity definition is blocked by the current mutex. This is a significant difference in that the event does not interrupt a currently executing activity that is still operating within the parameters of the current mutex. Any script can call cancel on a known executing context via the workflow script include. For example, var w = new Workflow(); w.cancel(context); //where context is a GlideRecord of the context to be canceled. Any script include, scheduled job, UI action, or other source Current thread, private mutex All activities, onCancel event handler stop (see End activity) The End activity checks for this event. If the stop event is the current event, then the cancel operation of the End activity is bypassed. Only in the End activity. Any script can trigger or broadcast the stop event via a script include or workflow Run Script activity Current thread, current mutex This event is used by the End activity to exclude the Cancel activity and allow a workflow to end, even if canceled. listener String value that the workflow (subflow) activity triggers as an event. When a main workflow calls a subflow, the workflow keeps the ID of the subflow's context in the scratchpad. When the subflow is complete, it triggers the listener event via a business rule. The listener event is passed to the parent context on completion of a subflow and is managed by the onListener action of the workflow activity. Business rule that is triggered by the update of a workflow that has a parent Current thread, current mutex This event is used by a subflow to inform it's parent flow that it is complete. The parent workflow will react to this event and continue. probe_complete String value triggered in the workflow by an Orchestration activity indicating that the MID Server has completed a task. The probe_complete event is triggered from Orchestration sensor processors via the workflow helper function handleEventById. The onProbe_complete event handler is in the WebServiceActivityHandler and is used by most Orchestration activities. Event used to restate a workflow that is waiting for the MID Server to process a task or activity Worker thread, private mutex Orchestration activities pause String value sent to a workflow from an SLA to pause the Timer activity. When an SLA is paused, the SLA workflows must be paused if there is a timer running. Use is exclusive to the SLA timer SLA Business rule thread, private mutex Timer activity resume String value used by the Timer activity to resume a paused timer (see pause). When an SLA is resumed, the SLA workflows must be resumed as well. Use is exclusive to the SLA timer. SLA Business rule thread, private mutex Timer activity Glide events relative to workflowsWorkflow uses several Glide events.Workflow event-specific functionsThere are several functions that relate specifically to workflow events.Event-specific workflow activitiesThe following workflow activities trigger events.