BPEL File Definition for the Master Process

Coordinating Master and Detail Processes 15-5 copy assign invoke name=receiveInput partnerLink=DetailProcess portType=dp:DetailProcess operation=initiate inputVariable=detail_input bpelx:invokeAsDetail=true -- receive the result of the remote process -- receive name=receive_DetailProcess partnerLink=DetailProcess portType=dp:DetailProcessCallback operation=onResult variable=detail_output The master BPEL process includes a receive signal activity. This activity indicates that the master process waits until it receives a signal from all of its detail processes. The label value detailProcessComplete matches with the label value in the signal activity of each detail process. This ensures that the signal is delivered to the correct process. Example 15–3 provides an example. This syntax shows a receive signal activity in a BPEL process that supports BPEL version 1.1. Example 15–3 Receive Signal Activity bpelx:receiveSignal name=waitForNotifyFromDetailProcess label=detailProcessComplete from=details

15.1.1.1 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. Example 15–4 shows how to use this attribute. The first invoke activity invokes the DetailsProcess detail process and associates it with a label of detailProcessComplete0. Example 15–4 First Invoke Activity 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 DetailsProcess1 detail process and associates it with a label of detailProcessComplete1. Example 15–5 provides an example. Note: In BPEL 2.0, the receive signal activity syntax is slightly different. The receive signal activity is wrapped in an extensionActivity element. extensionActivity bpelx:receiveSignal name=waitForNotifyFromDetailProcess label=detailProcessComplete from=details extensionActivity 15-6 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Example 15–5 Second Invoke Activity 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 DetailsProcess2 detail process again through a different port and with a different input variable. It associates the DetailsProcess2 detail process with a label of detailProcessComplete1-2, as shown in Example 15–6 . Example 15–6 Third Invoke Activity 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 Example 15–7 waits for a return signal from detail process DetailProcess0. Example 15–7 Receive Signal Activity -- 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 Example 15–8 also waits for a return signal from DetailProcess1 and DetailProcess2. Example 15–8 Second Receive Signal Activity -- This is a receiveSignal waiting for 2 child detail processes to signal back -- bpelx:receiveSignal name=waitForNotifyFromDetailProcess1-2 label=detailProcessComplete1-2 from=details

15.1.2 BPEL File Definition for Detail Processes

The BPEL process file of each detail process defines coordination with the master process. A receive signal activity indicates that the detail process shown in Example 15–9 waits until it receives a signal executed by its master process. The label value startDetailProcess matches with the label value in the signal activity of the master process. 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. Coordinating Master and Detail Processes 15-7 Example 15–9 startDetailProcess Label Value bpelx:receiveSignal name=waitForNotifyFromMasterProcess label=startDetailProcess from=master A signal activity indicates that the detail process shown in Example 15–10 signals its associated master process at runtime that processing is complete. The label value detailProcessComplete matches with the label value in the receive signal activity of each master process. Example 15–10 Signal Activity bpelx:signal name=notifyMAsterProcess label=detailProcessComplete to=master

15.2 Defining Master and Detail Process Coordination in Oracle JDeveloper

This section provides an overview of how to define master and detail process coordination in Oracle BPEL Designer. In this example, one master process and one detail process are defined.

15.2.1 How to Create a Master Process

To create a master process: 1. In the SOA Composite Editor, create a BPEL process service component. For this example, the process is named MasterProcess.

2. Double-click the MasterProcess BPEL process.

3. In the Component Palette, expand Oracle Extensions.

4. Drag a Signal activity into the designer.

5. Double-click the Signal activity.

This activity signals the detail process to perform processing at runtime.

6. Enter the details described in

Table 15–2 : Figure 15–4 shows the Signal dialog. Note: This section only describes the tasks specific to master and detail process coordination. It does not describe the standard activities that you define in a BPEL process, such as creating variables, creating assign activities, and so on. Table 15–2 Signal Dialog Fields and Values Field Value Name Enter a name for this example, contactDetailProcess. Label Enter a label name for this example, beginDetailProcess. This label must match the receive signal activity label you set in the detail process in Step 6 on page 15-9. To Select details as the type of process to receive this signal. 15-8 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 15–4 Signal Dialog

7. Click OK.

8. Drag a Receive Signal activity into the designer.

9. Double-click the Receive Signal activity.

This activity enables the master process to wait until it receives the signal executed by all of its detail processes. 10. Enter the details shown in Table 15–3 : Figure 15–5 shows the Receive Signal dialog. Table 15–3 Receive Signal Dialog Fields and Values Field Value Name Enter a name for this example, waitForDetailProcess. Label Enter a label name for this example, completeDetailProcess. This label must match the signal activity label you set in the detail process in Step 10 on page 15-10. To Select details as the type of process from which to receive the signal.