Locking
kenaflow was designed to execute a huge number of workflows. Therefore it is possible to scale it over several servers.
For that reason it is necessary to prevent one workflow to run at the same time on multiple kenaflow servers.
This requires locking.
During execution workflows are locked by creating a 0-byte lock file in a defined folder or network share. The lock file is removed after the processing of the workflow is finished.
kenaflow for SharePoint is able to run multiple workflows on the same SharePoint list. (This is only related to list workflows and state machine workflows!)
For that reason it is necessary to prevent multiple workflows - that could run in parallel - to process the same SharePoint list item concurrently.
This would lead - at least - in "version conflicts".
Therefore kenaflow locks each currently processed SharePoint list item using a 0-byte lock file in a defined folder or network share. This lock file is removed after the processing of the item is finished.
It could be necessary to access other lists in workflows than the workflow list. Or access a list in a SharePoint site workflow. Then you have lock SharePoint items manually to prevent parallel write operations.
Therefore you can use these cmdlets:
With them you are able to lock SharePoint list items.
The lock does not affect other systems than kenaflow! It is not visible to SharePoint / users!
To orchestrate workflows it is sometimes not enought to leverage SharePoint list item locks. But the developer of a workflow maybe need to prevent processing of one workflow when another runs.
Therefore kenaflow offers a global locking mechanism by using custom keys for creating, releasing and testing locks.
Therefore we create there cmdlets:
When using this custom "process" locks kenaflow creates 0-byte lock files in a defined folder or network share. The lock file is removed after the processing of the workflow is finished. When other workflows try to create a lock with an already used key they get an error and have to wait or postpone.
The lock file location is configured in the setting "lockDir" in the global configuration section "Locking".
With this setting multiple kenaflow instances or servers can be configured to use the same place for lock files.