The Closed Instances Separator thread is part of the Cora SeQuence Background Runtime Service (BRS). This thread runs through all the closed workflow instances and moves their data records to archive tables.
Starting with Cora SeQuence V9.0, the system archives data in batches.
You can configure the thread parameters in the BRS application configuration file:
|interval||The idle time of the thread between checking for and moving closed workflow instance content.|
|startAt||The time of day the thread begins to work.|
|stopAt||The time of day the thread ends its work.|
- If you want the thread to work all the time, leave the
- It is recommended that you set the thread to run outside of the system's peak hours.
Archived metadata tables
Starting with V9.0, you can set up application variables to determine batch size and number of instances in batches.
|BRS.MoveToClosed.BatchSize||Determines the number of instances that are moved in every batch.|
|BRS.MoveToClosed.NumberOfBatchesInOneCycle||Maximum number of batches that run in a single service cycle run.|
Both parameters determine the number of workflow instances that are moved in every service cycle.
For example: 100 X 10 = 1000 instances in one cycle.
- When the properties are not configured in the application variables, the system uses the default values.
- If you get a transaction timeout message while the Closed Instances Separator thread is running, consider decreasing the batch size value.
Set up a custom archiving mechanism
Starting with Cora SeQuence V9.0, you can use a stored procedure extension option to set up an archiving mechanism for any database table. The stored procedure should contain the full extended archiving functionality:
- INSERT INTO archive table
- DELETE FROM the original table
- Edit the extension stored procedure:
The stored procedure runs automatically as part of the BRS Closed Instance Separator Thread.
INSERT INTO UWFxxxClosed SELECT uwf.* FROM UWFxxx uwf WITH(NOLOCK) INNER JOIN #tmpWorkflowInstancesBatch iwc ON uwf.fldIWfId = iwc.fldId DELETE uwf FROM UWFxxx uwf WITH(NOLOCK) INNER JOIN #tmpWorkflowInstancesBatch iwc ON uwf.fldIWfId = iwc.fldId
Use INNER JOIN between the table that you want to archive and #tmpWorkflowInstancesBatch to move only a batch of data.
The #tmpWorkflowInstancesBatch table is created by the spBRS_MoveWorkflowInstancesToClosedTables stored procedure.