Genpact Cora Knowledge Center

Support

Lock Workflow Instance Execution

V10.1 and later

Overview

By default, a workflow instance is locked  during its execution to block concurrent execution of workflow instances, and prevent data discrepancy. While the workflow instance is locked, no other application or user can execute the workflow, nor perform any action on it. Other workflow instances are not affected and continue running. 

Use cases

Locking a workflow instance is useful to ensure that the workflow runs properly. Among other cases, locking workflow instances can help avoid errors when: 

  • Multiple users fetch the same task at the same time.
  • Multiple users click the Submit button simultaneously.
  • The Background Runtime Service (BRS) executes the workflow at the same time as the user.

Configuration

You can lock a workflow instance by setting up the Lock Duration property in the App Studio, or adding instanceLockDuration property to the configuration file.

LocationPropertyDescription
App Studio > Properties > ExecutionLock DurationDetermines the time period, in milliseconds, during which the workflow is locked.
  • Default: '0' (no lock) (for versions earlier than V10.6)
  • Default: ‘600000’ (10 minutes) (for V10.6 and later)
Configuration files:
  • Web.config (Flowtime, Administration, and WebAPI)
  • App.config (BRS and JES)
instanceLockDuration

Examples

Properties paneConfiguration file
Under Execution, enter the required value for the Lock Duration property.
Click image to enlarge it.
In the <workflowExecution> section, under <sequence.engine>, add the instanceLockDuration property, and enter the required value.

<sequence.engine>
<workflowExecution redirectMode="Manual" instanceLockDuration=”600000” />
</sequence.engine>


TIP
To define the appropriate lock duration value, consider the longest execution path in your workflow. For example, if the longest execution path takes two seconds, the recommended value is 2000. 

V9.1

Overview

By default, a workflow instance is locked  during its execution to block concurrent execution of workflow instances, and prevent data discrepancy. While the workflow instance is locked, no other application or user can execute the workflow, nor perform any action on it. Other workflow instances are not affected and continue running. 

Use cases

Locking a workflow instance is useful to ensure that the workflow runs properly. Among other cases, locking workflow instances can help avoid errors when: 

  • Multiple users fetch the same task at the same time.
  • Multiple users click the Submit button simultaneously.
  • The Background Runtime Service (BRS) executes the workflow at the same time as the user.

Configuration

You can lock a workflow instance by setting up the Lock Duration property in the App Studio, or adding instanceLockDuration property to the configuration file.

LocationPropertyDescription
App Studio > Properties > ExecutionLock DurationDetermines the time period, in milliseconds, during which the workflow is locked.
Default: ‘600000’ (10 minutes)
Configuration files:
  • Web.config (Flowtime and Administration)
  • App.config (BRS and JES)
instanceLockDuration

Examples

Properties paneConfiguration file
Under Execution, enter the required value for the Lock Duration property.
Click image to enlarge it.
In the <workflowExecution> section, under <sequence.engine>, add the instanceLockDuration property, and enter the required value.

<sequence.engine>
<workflowExecution redirectMode="Manual" instanceLockDuration=”600000” />
</sequence.engine>


TIP
To define the appropriate lock duration value, consider the longest execution path in your workflow. For example, if the longest execution path takes two seconds, the recommended value is 2000. 


V7.10

Overview

You can lock a specific workflow instance during its execution to block concurrent execution of workflow instances, and prevent data discrepancy. While the workflow instance is locked, no other application or user can execute the workflow, nor perform any action on it. Other workflow instances are not affected and continue running. 

Use cases

Locking a workflow instance is useful to ensure that the workflow runs properly. Among other cases, locking workflow instances can help avoid errors when: 

  • Multiple users fetch the same task at the same time.
  • Multiple users click the Submit button simultaneously.
  • The Background Runtime Service (BRS) executes the workflow at the same time as the user.

Configuration

You can lock a workflow instance by setting up the Lock Duration property in the App Studio, or adding instanceLockDuration property to the configuration file.

LocationPropertyDescription
App Studio > Properties > ExecutionLock DurationDetermines the time period, in milliseconds, during which the workflow is locked.
Configuration files:
  • Web.config (Flowtime and Administration)
  • App.config (BRS and JES)
instanceLockDuration

Examples

Properties paneConfiguration file
Under Execution, enter the required value for the Lock Duration property.
Click image to enlarge it.
In the <workflowExecution> section, under <sequence.engine>, add the instanceLockDuration property, and enter the required value.

<sequence.engine>
<workflowExecution redirectMode="Manual" instanceLockDuration=”600000” />
</sequence.engine>


TIP
To define the appropriate lock duration value, consider the longest execution path in your workflow. For example, if the longest execution path takes two seconds, the recommended value is 2000.