Designer > Implementing a BPMN Task or Event in BPEL > Receive


BPMN Implementation: Receive task, Message catch event
When a BPEL processing engine gets a message, it searches for a receive (or pick) activity with a matching partner link and operation. For an executable process, the receive must specify an input variable or variable part for the message data received. See Participants for descriptions of concepts important to this activity.
The receive activity can begin a business process instance by including a Create Instance property set to Yes. A receive activity can be associated with a reply activity if the operation is a request-response. Additionally, the receive can include a message exchange attribute.
You can create a set of concurrent initial receives. This case allows for any one message of a set to initialize a BPEL process. To create a multiple-activity starting point, add the receives to a flow container. Also, you must provide a correlation set for all concurrent receives that initiate a process, as described in Adding Correlations to an Activity.
Two other activities are similar to a receive: an onMessage clause in a pick activity or and onEvent event handler. For more information, refer to Pick and Event Handling.
Required Properties
Optional Properties
Participant (Partner Link)
Name. See Selecting Activity Labels
Port Type
Variable (required only for executable process, not abstract process)
From Part to Variable. See From Part to Variable.
Correlations. See Correlation
Create Instance. Required if this is the start activity.
Join Condition. See Creating a Join Condition for an Incoming Link
Suppress Join Failure. See Process Properties
Execution State. Viewing the Execution State of an Activity or Link
Message Exchange. Message Exchange Declaration
Extension Attributes and Extension Elements. See Declaring Extension Elements and Attributes.
To add a receive activity to the process manually:
For a shortcut and recommended technique, see Creating an Activity by Starting with a WSDL Interface.
  1. 1. Drag a Receive task or Message catch event activity to the Process Editor canvas.
  2. You can add a background color to the receive task, but not the message catch event.
  3. 2. In the Properties view, select the following values:
    1. a. Optionally type in a Name.
    2. b. In the Participant drop-down, select New Process Service Consumer.
    3. c. Select an Operation from the picklist.
  4. 3. In the Data tab, do one of the following:
  5. 4. Select other optional properties as desired.
A receive activity is actually two activities: a Receive followed by an Assign in a Scope. These two activities are not atomic and if you, for example, initialize onAlarm in an event handler, you cannot use the variable until the assign has completed.
Usage Examples
One receive can start a process
In a pick (event-driven gateway) with onMessage activities, one of many can start a process; the rest are ignored
Any one starts a process; all are required to complete the fork join (flow )
XML Syntax
<receive partnerLink="NCName" portType="QName"?
variable="BPELVariableName"? createInstance="yes|no"?
<correlation set="NCName" initiate="yes|join|no"?>+
<fromPart part="NCName" toVariable="BPELVariableName"/>+
XML Example:
<receive name="ReceiveCustomerRequest"