Correlating a Master Process with Multiple Detail Processes

For environments in which you have one master and multiple detail processes, use the bpelx:detailLabel attribute for signal correlation. The following example shows how to use this attribute.

The first invoke activity invokes the DetailProcess detail process and associates it with a label of detailProcessComplete0.

<invoke name="invokeDetailProcess" partnerLink="DetailProcess"
        portType="dp:DetailProcess"
        operation="initiate" 
        inputVariable="detail_input" 
        bpelx:detailLabel="detailProcessComplete0"
        bpelx:invokeAsDetail="true"/>

The second invoke activity invokes the DetailProcess1 detail process and associates it with a label of detailProcessComplete1. The following provides an example.

<invoke name="invokeDetailProcess1" partnerLink="DetailProcess1"
        portType="dp1:DetailProcess1"
        operation="initiate" 
        inputVariable="detail_input1" 
        bpelx:detailLabel="detailProcessComplete1-2"
        bpelx:invokeAsDetail="true"/>

The third invoke activity invokes the DetailProcess2 detail process again through a different port and with a different input variable. It associates the DetailProcess2 detail process with a label of detailProcessComplete1-2, as shown in the following example:

<invoke name="invokeDetailProcess2" partnerLink="DetailProcess2"
        portType="dp2:DetailProcess2"
        operation="initiate" 
        inputVariable="detail_input2" 
        bpelx:detailLabel="detailProcessComplete1-2"
        bpelx:invokeAsDetail="true"/>

The receive signal activity of the master process shown in the following example waits for a return signal from detail process DetailProcess0.

<!-- This is a receiveSignal waiting for 1 child to signal back -->
<bpelx:receiveSignal name="waitForNotifyFromDetailProcess0"
label="detailProcessComplete0" from="details"/>

The second receive signal activity of the master process shown in the following example also waits for a return signal from DetailProcess1 and DetailProcess2.

<!-- This is a receiveSignal waiting for 2 child (detail) processes to signal back -->
<bpelx:receiveSignal name="waitForNotifyFromDetailProcess1-2"
   label="detailProcessComplete1-2" from="details"/>

Note:

If there is only one receive signal activity in the BPEL process, do not specify the bpelx:detailLabel attribute in the invoke activity. In these situations, a default bpelx:detailLabel attribute is assumed and does not need to be specified.