Correlation Data

Correlation data must be used to ensure that each incoming message is received by the process instance to which it applies.

The incoming data to a receive task or catch message event is compared to the correlation data in existing process instances to determine whether it applies to that process instance. You must initialize the correlation data with a value, either on the start message event, or subsequently (for example in a script task).

In a process, a catch message event or a receive task waits for an incoming message to arrive. In the runtime environment there may be many instances of the process (each with different data), and many incoming messages (each with different data).

To illustrate how using correlation data works, consider the following example:

  • The process begins with a start message event (the process is started upon receipt of a one-way message from an external web service). The business analyst decides whether elements within the incoming data from the web service can be used to uniquely identify instances of this process. If the incoming data can be used to identify the process (later on in the process when there are incoming messages), the business analyst creates a correlation data field (for example, OrderRef), and associates it with the start event on the Interface tab.
  • After the user task, the receive task (Receive Authorization) waits for the correct incoming authorization. To do this, the business analyst associates the OrderRef correlation data field with the Receive Authorization task. When an incoming message is received, the incoming data is compared to the correlation data to make sure that it applies to that process instance.

After creating correlation data fields, and associating them with the relevant events or tasks, the correlation data must be mapped with the incoming data. This is the job of the solution designer. For more information, see the appropriate implementation guide.

Note:
An incoming request message is generated, so the message may be generated before the target process instance is capable of accepting it.
  • For "IN only" message exchanges the message is received and then buffered until required. If for some reason the message is never correlated with a process instance, the sender of the message cannot be informed of the error.
  • For "IN/OUT only" message exchanges the message is received and then buffered until required. In this case if the message is never correlated with a process instance, then no response is sent to the sender. This will be detectable by the sender as a timeout exception in the invoking application but will also delay the handling of this error.

To avoid issues where it is known that the process instance to be correlated with must exist before the message is sent, you can use the Correlate Immediately option on an incoming request message activity. See "Associating Correlation Data with an Event or Task" in TIBCO Business Studio Modeling Guide. If you use this option, then if a received message does not correlate immediately with an existing process instance, it responds immediately with an error and discards the message.