<receive> – receive a message from a partner
Synopsis
<receive partnerLink="NCName"
portType="QName"?
operation="NCName"
variable="BPELVariableName"?
createInstance="yes|no"?
messageExchange="NCName"?
standard-attributes>
standard-elements
<correlations>?
<correlation set="NCName" initiate="yes|join|no"? />+
</correlations>
<fromParts>?
<fromPart part="NCName" toVariable="BPELVariableName" />+
</fromParts>
</receive>
Throws following faults:
- bpel:ambiguousReceive
- bpel:conflictingRequest
- bpel:conflictingReceive
- bpel:correlationViolation
- bpel:invalidVariables
- bpel:uninitializedPartnerRole
- bpel:uninitializedVariable
Description
The <receive> activity enables a BPEL process to implement a Web Service operation. When this activity
is encountered, ODE will begin searching for messages that match the activity. The activity will not
complete until a match is found or the scope is terminated.
In this sense, the activity can be said to block. For non-deterministic selection (something akin to a POSIX
select), the <pick> activity should be used.
The precise timing of message arrival is not important. The message can arrive before the <receive>
activity is activated; ODE will store the message in an internal queue and associate it with the appropriate
<receive> once it is activated.
If the operation is of a request-response style, the <reply> activity can be used to send the reply.
- partnerLink - the partner link whose myRole should be used.
- portType - (optional) the port type of the implemented operation.
- operation - name of the implemented operation.
- variable - (optional) variable into which the received message content should be stored.
- createInstance - (optional) flag indicating whether this activity is used to instantiate the process instance
- yes - if this is an activity that can be used to create a new process instance
- no - if this activity does not create a new process instance
- messageExchange – (optional) a string identifer used to disambiguate message exchanges on the same
partnerLink/operation.
- <correlations> / <correlation> - specifies the correlation sets that are used in this
exchange
- set - name of the correlation set
- initiate - specifies whether this operation will initiate the correlation set.
- yes - the operation will initialize the correlation set based on the data received in
message
- no - the operation will not initialize the correlation set. Correlation set will already
be initialized and the operation will ensure that the message returned matches the
correlation set.
- join - the operation will not initialize the correlation set if it is not already
initialized. Otherwise, the operation will ensure that the message returned matches the
correlation set.
- {{ <fromParts> / <fromPart> }} – map received message parts into variables. When these
elements are present, the variable attribute must not be used (WSO2 Business Process Server not yet support the <fromPart>.
Hence, the variable attribute must be used.)
- part - name of the received message part
- toVariable - the variable in which the part should be saved.