Start of Content Area

This graphic is explained in the accompanying text Example: Multicast – Multiple Receivers (with Response Message)  Locate the document in its SAP Library structure

You have the option of sending a message to multiple receivers and waiting for a response message from each of the receivers (more information: Response Message). The procedure of sending a message to multiple receivers and waiting for a response message is also known as ‘multicast’.

The receivers are determined at runtime from the receiver determination that is configured in the Integration Directory. The number of receivers therefore does not need to be known at design time.

You can define a multicast in different ways. The following table shows the various options. You can find the examples in the Enterprise Services Repository under SAP Basis SAP Basis <release number>, namespace http://sap.com/xi/XI/System/Patterns.

 

Multicast

Description

Example

Send one after the other (block in ForEach mode)

Multiple messages are sent to individual receivers one after the other.

BpmPatternMulticastSequential

Send simultaneously (block in ParForEach mode)

Multiple messages are sent to individual receivers simultaneously.

BpmPatternMulticastParallel

 

Example Processes

The example process is started when a message in the Message container element is received in the first receive step. A subsequent receiver determination calls the receiver determination that you configured in the Integration Directory and gets the receiver list in the multiline container element Receivers. In a dynamic block, the messages are sent to the receivers either in parallel or one after the other.

The container element Receivers is defined as the multiline element for dynamic processing. The container element Receiver is defined for the current line. This gets the individual receivers for which the block will be executed.

Each receiver sends a response message, which is received in the Response container element. The sent message and the response message are linked by means of a correlation.

The sent message might be a purchase order and the response message the response to the purchase order, for example. The purchase order and the purchase order response might be correlated by a purchase order number, for example.

One of the abstract interfaces is used as an inbound interface and the other as an outbound interface (more information: Process Signature).

Sending One After the Other (ForEach)

If what is most important is that the message is actually sent to the various different receivers and not whether this is done simultaneously, define the block as a ForEach. Within the block, a send step sends the message to the first receiver in the receiver list and creates the correlation Correlation. A receive step uses Correlation and receives the response message from the first receiver. If this receive step is complete, the message is sent to the next receiver in the receiver list. The whole receiver list is processed in this way.

So that a separate instance of the correlation can be processed for each receiver, the Correlation is defined as a local correlation.

The following graphic illustrates the process definition:

This graphic is explained in the accompanying text

Send Simultaneously (Block with ParForEach)

The block is defined as a ParForEach. A block instance is generated for each receiver in the receiver list in which the following steps are executed:

      A send step sends the message to the receiver and activates the correlation Correlation. So that a separate instance of the correlation can be processed for block instance, the Correlation is defined as a local correlation.

      A receiver step uses this correlation and receives the response message from this receiver.

The block is complete once all block instances that were generated in parallel are complete. In other words, the response message has been received from all receivers in the receiver list.

Note

Note that using a ParForEach will not have any effect on performance.

More information: Checklist: Making Correct Use of a ParForEach

The following graphic illustrates the process definition:

This graphic is explained in the accompanying text

More Information:

Receive Step

Receiver Determination Step

Send Step

Correlation: Defining Assignment of Messages to Process Instances

 

End of Content Area