Message exchanges
In scenarios where operations are invoked using the request/response pattern, we always have a situation where an inbound message activity has to be related with a reply activity. The inbound message activity can be a<receive>, <onMessage>
, or<onEvent>
. The reply activity is always a<reply>
. In most cases, the BPEL engine will figure out itself which reply activity relates to which inbound message activity. However, if there can be more than one pair of inbound message activities (<receive>,<onMessage>
, or<onEvent>)
and<reply>
, we have to explicitly mark the pairing relationship. We do this using message exchanges.
To use message exchanges, we first have to declare them. We declare message exchanges immediately after partner links. We can declare message exchanges for the process or for each individual scope:
<messageExchanges> <messageExchange name="name" /> <messageExchange name="name" /> ... </messageExchanges...