BPEL Master Detail Flow
Here we will see how to design a Master/Detail BPEL Flow. Users with a good knowledge of workflow will find it easier to understand and visualize the process. Oracle BPEL has made the process to design Master Detail relationships all the more simpler.
Master -Detail flow co-ordinations consists of one-to-many relationship between single master and multiple details process. Let’s see how to setup one master and one detail relationship. Basic concept here is Master Flow will trigger Detail Flow and Detail Flow once completed will pass the control back to the Master Flow.
In Oracle BPEL process following activities coordinates actions between master and detail process.
- Signal: Notifies the other processes (master or detail) to continue processing
- Receive Signal: Waits until it receives the proper notification signal from the other process (master or detail) before continuing its processing
Both activities are coordinated with label attributes defined in the BPEL process files. Labels are declared per master process definition. Each master and detail process includes a Signal and Receive Signal activity. If the signal activity executes before the Receive Signal activity, the state set by the signal activity is persisted and still effective for a later Receive Signal activity to read.
Step #1 – Complete Picture
As shown below drag and drop BPEL Process in SOA composite editor. Call it Master. Similarly drag another BPEL process on composite editor and call it Detail.
Step #2 Create Master Process
- Double-click the MasterProcess BPEL process.
- Expand BPEL Activities in the Component Palette.
- Drag a Signal activity and drop it into your BPEL process service component.
- Drag a Receive Signal activity and drop it into your BPEL process service component.
Double-click the Signal activity. This activity signals the detail process to perform processing at run time. Enter the following details:
Name: contactDetailProcess,
Label: beginDetailProcess, label must match the Receive Signal activity label you set in the detail process.
To: Detail
Double-click the Receive Signal activity. This activity enables the master process to wait until it receives the signal executed by all its detail processes. Enter folloing Details:
Name: waitForDetailProcess
Label: completeDetailProcess, label must match the Receive Signal activity label you set in the detail process.
To: Detail
The master process has now have
- Signal the detail process to perform processing at run time
- Wait until it receives the signal executed by the detail process
Step#3
- Create a second BPEL process service component in the SOA Composite Editor.
- Double-click the DetailProcess BPEL process.
- Drag a Receive Signal activity and drop it into your BPEL process.
- Drag a Signal activity and drop it into your BPEL process
Double-click the Receive Signal activity. This activity enables the detail process to wait until it receives the signal executed by its master process. Enter the following details:
Name: WaitForContactFromMasterProcess.
Label: beginDetailProcess. This label must match the Receive Signal activity label you set in the master process.
To: master
Step#4
Double-click the Signal activity. This activity enables the detail process to signal its associated master process at run time that processing is complete. Enter the following details:
Name: contactMasterProcess.
Label: Enter a label name (for this example, completeDetailProcess). This labelmust match the Receive Signal activity label you set in the detail process.
To: master
The detail process has now been designed to:
- Wait until it receives the signal executed by its master process
- Signal the master process at run time that processing is complete
Step#5
Add the Assign , Invoke, receive activities in master Flow.
- Assign – It assign the values to various i/p and o/p variables
- Invoke – Invokes the detail activity
- Receive – Receive response from detail.
Step #6
Add the Assign , activity in Detail Flow.
Assign – It assign the values to various i/p and o/p variables
Step #7
Compile and deploy the BPEL process.
Run the BPEL Process.
Step #8
Master Run Time Process – As Shown below, system first executes the master Process and as soon as it reaches the Signal activity, it will Signal the Detail activity for execution. Invoke activity will call the detail process and control is then transferred to detail.
Step #9
Details Process at RUN Time – Once Control transfers to Detail, it executes the Receive Signal process to get the control from Master and executse the complete Detail process till it reaches Signal process which will again inform the Master to Continue with it’s process.
Please Note that Signal/Receive Signal activities passes the control between master and deatils, but to call the Master/detail process we still need to Invoke/receive activity in the flow.
There are no comments yet.