![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
Correlations are used to ensure that messages are delivered to the correct running instance of an orchestration process. Activities can set the value of a correlation based on any data contained within a message sent or received by the orchestration process instance. Each activity may specify a different expression against a message that is used to derive the value of a correlation. Other activities that send or receive messages in the orchestration process may specify another expression used to match the correlation value to determine which messages should be routed to running instance of the orchestration processes.For example, a new order may have an order number. The order number can then be used by all messages that apply to that particular order. A buyer, for example, can add items to an existing order by sending a message with the correct order number. The activities in the orchestration process would set a correlation to the value of the order number for incoming messages. Messages with the same order number would be automatically routed to the correct orchestration process.Correlations are defined in the Orchestration Process resource and then used by the activities that send or receive messages, such as the following:
•
•
•
• You can define more than one correlation for each activity that handles incoming or outgoing messages. When comparing correlations of incoming messages, comparisons for all defined correlations must evaluate to true for the message to be routed to the receiving activity. For example, you may have separate correlations defined for the orderID of a message and a particular userID that requested the order. Only the original requestor can request the status of the order. In this case, both the orderID correlation and the userID of the requestor must match in the incoming message.
2. Use the + button to add correlations to the process, use the X button to remove correlations, and use the arrow buttons to move the correlations in the list.
5. Use the + and X buttons in the Correlations field on the Configuration tab to add or delete correlations that you wish to set for the incoming message. Double click on the correlation name and use the drop-down list to select one of the correlations defined in step 3.
− yes Use this option if you wish to set the correlation to a value from the incoming message. The specified correlation will then be set to the value determined by the Correlation Expression field.
− join Use this option if you have more than one Receive Starter activity for the process. This option signifies that if the specified correlation is not set, then set it to the value determined by the Correlation Expression field. If the specified correlation is already set, let the current value of the correlation remain unchanged. This option is useful when more than one message can start an orchestration process and you want the first received message to set the correlation value. Other incoming messages with the same correlation value are delivered to the other Receive Starters in the process instead of creating new process instances.
7. Click on the far right corner of the Correlation Expression field and the XPath Formula Builder appears. Use this dialog to create an expression from the data of the incoming message. The correlation is set to the evaluation of this expression. For example, if your incoming message has a field named orderID, you can drag and drop it into the XPath formula field to set the correlation to the value of the orderID field of the incoming message.See TIBCO ActiveMatrix BusinessWorks Process Design Guide for more information about using the XPath Formula Builder.The following illustrates a Receive Starter Correlations field that sets the orderID correlation created in step 3 to the value of the orderID field of an incoming message:
8. Repeat steps 5 through 7 for other activities in the process that send or receive messages. In the Initiation column of all activities (except the Receive Starter), you can set one of the following values:
− yes Use this option if you wish to set the correlation to a value from the incoming message. The specified correlation will then be set to the value determined by the Correlation Expression field. If the correlation already has a value, an exception is thrown.
− no Use this option if you wish to compare the current value of a correlation to the value of the Correlation Expression column (derived from the incoming message). This is useful if you wish to ensure that messages with the same value for the Correlation Expression are handled within the same instance of the orchestration process.
− join This option signifies that if the specified correlation is not set, then set it to the value determined by the Correlation Expression field. If the specified correlation is already set, let the current value of the correlation remain unchanged. This is useful if more than one activity can potentially set a correlation after a process starts and it is unknown which activity will be executed first.The following illustrates the Correlations field of an On Event activity that is waiting for a message that has the same orderID as the message that started the orchestration process:
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |