Closing Script¶
The Instance Closing Script executes for every workflow instance closed normally (via user action or deadline). It is not executed when an instance is terminated by an administrator; use the Instance Termination Script for such scenarios.
Instance Closing Scripts are useful for exporting process data to external systems.
Scripting Context¶
The script provides access to the following variables:
$Instance
: Provides access to workflow instance properties.$Initiator
: Identifies the workflow initiator. Note that this may benull
for module-type tasks.$Xml
: Provides access to the workflow's data model (root element), unlike task pre/post work scripts which access the pool element.
Note
The $Xml
variable's context differs from task pre/post-work scripts. Here, it points to the root of the data model, not the pool element.