Java Reference
In-Depth Information
properties that “tag” the conversation. Followers use <correlation initiate="no"> . They
receive data from an incoming message and mine it for values to bind within their correlation
set.
Use the initiate attribute to specify whether this correlation set will start the conversation, or
use “join” if you want to allow whichever participant who gets there first to start the conversa-
tion. That is, using “join” means that the related activity will start the conversation if it hasn't
been started yet, or follow it if someone else has already started it. Using <correlation ini-
tiate="join"> means that you have a “multi-start” activity, wherein multiple receive blocks
can initiate a conversation.
If something goes wrong during conversation initialization, the standard fault
bpel:correlationViolation is thrown.
Correlating the messages
To complete the correlation definition, you need to specify how messages will be correlated
once received within a flow.
The <invoke> activity defines the pattern attribute, which allows you to specify when a cor-
relation set should be used. Its possible values are shown in Table 10-3 . If the operation is
one-way, the pattern attribute need not be used.
Table10-3.Values for invoke's pattern attribute
Value Purpose
Applies the correlation on the outbound message
request
Applies the correlation on the inbound message
response
request-response Applies the correlation on both inbound and outbound messages
A correlation set can only be initiated once within the scope it belongs to during a conversa-
tion. Once it is initiated, the values become constants for the process instance to ensure that
subsequent requests can be correlated against a determined identical value.
Here is an example snippet of using a correlation from section 9 of the specification:
<invoke partnerLink="Seller" portType="SP:PurchasingPortType"
operation="Purchase" inputVariable="sendPO"
outputVariable="getResponse">
<correlations>
<correlation set="PurchaseOrder" initiate="yes" pattern="request"/>
<correlation set="Invoice" initiate="yes" pattern="response" />
</correlations>
Search WWH ::




Custom Search