Sunday, August 21, 2016

Sequencing Process Instances | Sequencing Key usage in TIBCO BW

      Process instances can be executed in the order they were created. TIBCO ActiveMatrix BusinessWorks allows you to specify a sequencing key on process starters that determines which process instance to execute sequentially. Process instances with sequencing keys that evaluate to the same value are executed in the order they were started.

NOTE : Process instances can have sequencing keys that evaluate to different values, but only process instances with the same value for the sequencing key are executed sequentially. Process instances with different sequencing key values can be executed concurrently.

      TIBCO ActiveMatrix BusinessWorks also allows you to control process execution administratively by setting properties in the deployment configuration of the project. TIBCO Administrator allows you to control the maximum number of process instances in memory as well as the maximum number of concurrently executing process instances. Using these settings, you can specify that all process instances should be executed sequentially in the order they were created. This method is not as flexible as using the Sequencing Key filed on process starter. Using the administrator settings is only recommended when you cannot change the process definitions in the project before deployment.

Let see the example of using the Sequencing Key filed on the Misc tab of process starters to control the order of process execution.

Example : Processing Order Requests sequentially using HTTP Receiver process starter

      In this example, an order-entry system must process incoming orders in the order in which they are received. The orders are placed using a web client and the TIBCO ActiveMatrix BusinessWorks process definition uses an HTTP Receiver process starter to accept the incoming orders.

      To accomplish the sequential processing of all order requests, specify a constant in the Sequencing Key field of the Misc tab of the OrderRequest HTTP Receiver process starter. For example, as shown above place "OrderEntry" in the Sequencing Key field. Because you placed a constant in the field, the value of the expression is identical for each incoming order. Therefore, all new orders are executed in the order they are received.

NOTE : Please note that this content is taken reference from tib_bw_process_design.pdf document. Even this document has covered examples of using Sequencing Key in Timer and JMS Receiver starter processes as below :

Timer Starter Process : Periodic Processing - To process each day's requests sequentially.

     To configure sequencial processing in this scenario, you can use XPath expression pfx:TimerOutputSchema/Day_Of_Month in the sequencing key field of the Misc tab of the Timer process starter. This ensure that process instances created each day are completed sequentially in the order they are created.

JMS Receiver Starter Process : Handling Client Messages

     We all know that each JMS client authenticates to the JMS server with a different User ID. Messages from different clients are permitted to be processed concurrently, but all messages received from same client must be processed in the order they are received.

     In this example, you can use the expression pfx:ActivityOutput/JMSProperties/pfx:JMSXUserID in the sequencing key field of the Misc tab of the JMS Receiver process starter i.e either JMS Topic Subscriber or JMS Queue Receiver. This ensures that all messages from a specific client are processed in the order they are received.

No comments:

Post a Comment

back to top