Example 2: Periodic Processing
In this example, the Timer process starter is used to start a process every five minutes. The process is a monitoring application that examines data in a database and performs the appropriate action. For example, if the number of rows returned by a query is greater than 5000, the process archives the data to another database and removes all rows from the table. If the number of rows is less than 5000, the results of the query are processed and stored in a separate table. The following figure illustrates the example process definition.
Example of periodic processing
In this example, process instances are created every five minutes, but the data in the table changes much more frequently. You must ensure that the data returned by the query is processed before the next query executes. Therefore, you must execute each process instance sequentially before executing the next process instance. System backups occur at midnight each night, and there are no changes to the table during this time.
To configure sequential processing in this scenario, you can use the XPath expression pfx:TimerOutputSchema/Day_Of_Month
in the Sequencing Key field of the Misc tab of the Timer process starter. This ensures that process instances created each day are completed sequentially in the order they are created. At the end of the day, no updates are occurring to the table, so process instances created at the end of each day can execute concurrently with the first process instance created the next day.