vRO Workflow Single Instance Execution Enforcement
There have been numerous times when an automation solution requires that a particular primary workflow only have one instance executing at any one time. An example of this is a custom data collection workflow (think "caching" from an external DB) that is scheduled to execute once per hour. In the case where the data collection takes longer than the allotted hour, two simultaneous executions of the collection workflow may be detrimental to the data cached and the data source, causing potential problems in the environment.
The attached code snippet can be added to a vRO Custom Decision object at the beginning of the workflow to ensure only one instance is ever executed at any one time. The "true" path of the decision allows execution, while the "false" path is taken when an instance of the workflow is currently active.