Java Reference
In-Depth Information
Correlation Sets
Problem
You want to specify a unique identifier that is common to a set of messages to ensure that they
are all served by the same instance of your process.
Solution
Use a <correlationSet> .
Discussion
The basic premise of a correlation set is as follows:
▪ A single process instance typically requires sending a message through a series of service
invocations as a conversation.
▪ You typically have many unique instances of a process executing at once.
▪ Messages typically carry information that can be used to uniquely identify them.
▪ This uniquely identifying information in messages can be used to ensure that all of the
inputs and outputs during a conversation participate only in the process instance they're
meant to.
▪ The correlation set is the definition of a process conversation: it defines which participants
use what identifying data to make sure that the intended instance of the process is the only
one that receives this instance of a message.
If this sounds a little tricky, it is. An analogy is useful here. A BPEL process is to a Java class
what a BPEL process instance is to a Java object. In Java it's easy to correlate messages. You
just pass around the object instance you're interested in and call methods on it. You can do
that in Java because you can work directly with both a class (defining a class in the first place
or calling static methods) and an object instance (inside a method, for example). When you
write a BPEL process, it's as if you're working just at the class level. That is, you're defining
the blueprint for creating any given process instance, but you never have access to the actual
instances; they just run in the engine. So you need a way to tell the process how to route mes-
sages that belong together in the same conversational instance. Enter the <correlationSet> .
Once multiple instances of a process are running, you use identifying data, such as customer-
Number and orderNumber , within the messages to create a unique combination that identifies
Search WWH ::




Custom Search