WSO2 Business Process Server v3.1.0 Documentation

##### Overview

- Home
- Release Note
- WS-BPEL Compliance
- License

##### Downloads

- Releases

##### Installation Guide

- Installing WSO2 BPS

##### Quick Start Guide

- Modeling the process
- Deploying the process
- Testing the process

##### User Guide

- Deploying BPEL Processes
- Deploying Human Tasks
- Managing BPEL processes
- Managing BPEL process instances
- QoS for BPEL processes
- Securing BPEL processes
- Invoking secured partner services
- Versioning
- Management API

##### Human Task Guide

- Human Tasks Quick Start Guide
- Deploying HumanTasks
- Managing Tasks
- Developing a Human Task Artifact
- Human Task Management and Configuration
- Human Task Concepts

##### Administrator Guide

- External data sources Configuration
- Registry Configuration
- Events
- Unified Endpoints
- BPEL Extensions
- Transaction Factory Configuration
- Message Exchange Interceptors
- OpenJPA specific properties
- JMS Transport Configuration
- Process Instance Cleanup Tasks
- Process Hydration and Dehydration
- Enabling Peer-to-Peer(P2P) Communication
- Setting up a BPS Cluster

##### Best Practices

- Process Deployment Best Practices

##### Concepts

- Process Versioning
- Process instance events
- Partner links

##### WS-BPEL Extensions

- Activity Failure and Recovery
- Extension Activities and Extensible Assign Operations
- XPath Extensions
- Iterable ForEach
- Flexible Assigns
- BPEL4People Extension

##### Samples

- HelloWorld
- If-Else
- ForEach
- While
- Repeat Until
- Flow and Links
- Pick
- Synchronous and Asynchronous Service Invocations
- Fault Handling
- Split
- XslTransform
- Compensation Handler
- Event Handler

##### Resources

- FAQ
- External Articles
- Library
- Source Code

##### Community

- Forum
- Mailing Lists

##### Project Information

- Issue Tracking

<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.