This use case details the creation of a workflow which lets you manage concomitant updates when using several executions of a workflow.
The aim is to check that the update process has ended before executing another update operation. To do this, we will set up an instance variable, and let the workflow test if the instance is running to decide whether or not to continue the execution of the workflow and perform the update.
This workflow is made up of:
To build the workflow, follow the steps below:
Add a Scheduler activity, then configure its frequency according to your needs.
Add a Test activity to check if the workflow is already executing, then configure it as below.
“isRunning” is the instance variable name we have chosen for this example. This is not a built-in variable.
Add an End activity to the No fork. This way, nothing will be executed if the workflow is already executing.
Add the desired activities to the Yes fork. In our case, Query and Update Data activities.
Open the first activity, then add the instance.vars.isRunning = true command in the Advanced tab. This way, the instance variable is set as running.
Add an End activity at the end of the Yes fork, then add the instance.vars.isRunning = false command in the Advanced tab.
This way, no action will be executed as long the workflow is executing.