Genpact Cora Knowledge Center

Support

Configure workflow persistence

 

V9.0

Overview

During workflow execution, activity instance-related database queries are combined and sent in batches. This setup reduces the number of queries to the database and improves system performance.

Activity parameters

If required, you can set the following activity parameters in the activity Properties pane.

ParameterDescription
Force PersistenceCompletely flushes the activity instances buffer after the execution of the activity for which the parameter is set.
Persist on CreationPerforms the insert only on creation of the specific activity, that is, the activity instance is stored in the database immediately after its creation.

Configure the buffer size

You can configure the buffer size using the following two options:

  • Through the workflow properties
  • Through the configfile of the application or the service that uses the Cora SeQuence database: Administration, Flowtime, Background Runtime Service (BRS), and Job Execution Service (JES).

Parameters

To configure the buffer size, edit the following parameters.

ParameterLocationDescription
Batch SizeWorkflow properties (Advanced mode)Open the workflow and edit the Batch Size parameter in the Properties pane so it is relevant while executing the workflow in all applications.
Default: 0
If set to 0, the system considers the buffer size set in the default value or in activityInstanceUpdateBufferSize
from the config file.
activityInstanceUpdateBufferSizeApplication config file under workflowExecutionDetermines the number of inserted and updated activity instances that run in a single workflow execution.
Default: 10
activityInstanceUpdateStateBufferSizeFactorApplication config file under workflowExecutionDetermines the number of activity instances that have already run and require a state update, such as Status and Completion Date. The actual value of the Update State buffer size is calculated as a factor of the update buffer size.
Default: 3
Example: 3x10=30

Activity instance ID range

Each application fetches and stores an ID range from the database in its memory cache using an SQL Sequence function. The activity instance ID value is assigned from the cached range.  

ParameterLocationDescription
generatedActivityIdRangeSizeApplication config file under workflowExecutionDetermines the range number each application stores. 
Default: 10,000

Sample code

<sequence.engine>
    ...    <workflowExecution
            activityInstanceUpdateBufferSize="10" 
            activityInstanceUpdateStateBufferSizeFactor="3" 
            generatedActivityIdRangeSize="10000"    
/>


Risks

Depending on how the system uses data, change the default buffer parameters, or configure additional activity properties. 

ConsiderationRecommendation
If the system uses data directly fromtblInstanceActivitiesdatabase table, the database might not have the latest data when required.
Scenarios:  
  • Workflows that include stored procedure activities.
  • Workflows that use the following built-in commands to execute HotOperations actions: Assign and Fetch, Assign, Fetch, and Return.
There are two possible solutions to avoid this issue: 
  • In Cora SeQuence V8.8 and later, set the buffer parameters to "1".
  • In Cora SeQuence V8.8.1 and later, select the Force Persistence property for the relevant activity.
If an execution fails, the risk of losing data is as big as the configured buffer size.Configure the buffer size carefully based on how the system uses data.
activityInstanceUpdateStateBufferSize parameter does not exist anymore.If required, you can use  the activityInstanceUpdateStateBufferSizeFactor parameter instead.
Workflows that include the File Writer activity will fail if the Persist on Creation property is not selected.Select the Persist on Creation property when you configure the File Writer activity.

Best practices

  • When using built-in commands on dynamic tasks, select the Force Persistence property for the dynamic task, if there is no database persistence in between the two activities.
  • When using activities in which the Blocking property is selected, such as Sub Workflow and In-Process Consumer activities, select the the Force Persistence property.
  • When using activities that are based on the creation and data from other activities, select the Force Persistence property or the Persist on Creation property as required. For example, the Web Service Input activity should be persisted before the related Web Service Output activity.
  • The fldID column intblInstanceActivities is no longer incremental. For sorting purposes, usefldCreationDate.
  • If you usetblInstanceActivitiestable, make sure that the table is sorted by fldCreationDate column, if required.
  • Default range size is 10,000. In case of low volume (less than 1000 instances a day), it is recommended to decrease the range size.
  • In legacy workflows, when using Web Service Consumer and Listener in the same workflow, select the Persist on Creation property for the Listener.

V8.8

Overview

During workflow execution, activity instance-related database queries are combined and sent in batches. This setup reduces the number of queries to the database and improves system performance.

Configure the buffer size

You can configure buffer parameters in theconfigfile of the application or service that uses the Cora SeQuence database: Administration, Flowtime, Background Runtime Service (BRS), and Job Execution Service (JES). 

Parameters

ParameterDescription
activityInstanceUpdateBufferSizeDetermines the number of updated activity instances that run in a single workflow execution.

Default: 10
activityInstanceUpdateStateBufferSizeDetermines the number of activity instances that have already run and require a state update, such as Status and Completion Date.

Default: 30

Sample code

<sequence.engine>
    ...    <workflowExecution
            activityInstanceUpdateBufferSize="10" 
            activityInstanceUpdateStateBufferSize="30"    
/>

Risks

Depending on how your system uses data, you need to change the default buffer parameters, or configure additional activity properties. 

ConsiderationRecommendation
If your system uses data directly fromtblInstanceActivitiesdatabase table, the database might not have the latest data when required.
Scenarios:  
  • Workflows that include stored procedure activities.
  • Workflows that use the following built-in commands to execute HotOperations actions: Assign and Fetch, Assign, Fetch, and Return.
There are two possible solutions to avoid this issue: 
  • In Cora SeQuence V8.8 and later, set the buffer parameters to "1."
  • In Cora SeQuence V8.8.1 and later, select the Force Persistence property for the relevant activity.
If an execution fails, the risk of losing data is as big as the configured buffer size.Configure the buffer size carefully based on how your system uses data.
Workflows that include the File Writer activity will fail if the Persist on Creation property is not selected.
Select the Persist on Creation property when you configure the File Writer activity.

Best practices

  • When using built-in commands on dynamic tasks, select the Force Persistence property for the dynamic task, if there is no database persistence in between the two activities.
  • When using activities in which the Blocking property is selected, such as Sub Workflow and In-Process Consumer activities, select the the Force Persistence property.
  • When using activities that are based on the creation and data from other activities, select the Force Persistence property or the Persist on Creation property as required. For example, the Web Service Input activity should be persisted before the related Web Service Output activity.