Java Reference
In-Depth Information
ferent message parts to represent the data you need to correlate. However, it could also be
necessary if you're invoking operations from a variety of partners.
You define the correlation sets that will be used in your process with a <correlationSets>
construct that contains <correlationSet> child elements, as shown here:
<process>
<correlationSets>
<correlationSet name="PurchaseOrder"
properties="po:customerId po:orderId">
</correlationSet>
</correlationSets>
Here you define a global correlation set that uses properties to identify the data that constitutes
a composite key. This may be necessary depending on the nature of your conversation. The
point is that you have to ensure that your correlation key/value pair is unique. Think of this as
you would primary and composite keys in a relational database. And, just like in a relation-
al database, all of the data in a key must match for the correlation to work; in the preceding
example, getting a new message from the same customer with a different order ID will not
correlate.
NOTE
The <pick> and <onEvent> activities are specialized versions of the <receive> activity. As such,
you can specify a correlations element within them; this will contain the correlation set that they par-
ticipate in.
The <correlations> element looks like this:
<correlations>?
<correlation set="NCName" initiate="yes|join|no"?
pattern="request|response|request-response"? />+
</correlations>
The pattern attribute is only used in the event that the correlation is used with an <invoke>
activity. You use this attribute to limit when a correlation should be used. For example, spe-
cifying a value of “request” would make the correlation apply only during the outbound in-
vocation, so only the request would have its data validated according to the correlation.
Initiating the conversation
Partners in a correlation can act as conversation initiators or conversation followers. To initiate
a conversation, set <correlation initiate="yes"> . The initiator of a conversation sends
the first message by invoking an operation; doing so defines the values in the correlation set's
Search WWH ::




Custom Search