Search 800 + Posts

Jan 17, 2010

How to Desgin Master Detail Flow in BPEL

In this blog , I will explain with simple example how to design Master/Detail BPEL Flow .For aurdience who has working knowledge of workflow it is very easy to understand and visualize the process, but Oracle BPEL has made it so simple to design Master Detail that any one who want to learm , can learn it.

Master -Detail flow Co ordinations consists of one-to-many relationship between Single Master and multiple details process.Here I will discuss One master and One detail.Basic Concept here is Master Flow will Trigger Detail flow and detail flow once completed will pass the control; back to 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.Name it as Master.similarly drag another BPEL Process on composite editor and name 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#5
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#4

Add the Assign , Invoke, receive activities in master Flow.


  1. Assign - It assign the values to various i/p and o/p variables



  2. Invoke - Invokes the detail activity


  3. Receive - Receive response from detail.

Step #5
Add the Assign , activity in Detail Flow.

Assign - It assign the values to various i/p and o/p variables

Step #6
Compile and deploy the BPEL process.

Run the BPEL Process.



Step #7
Master Run Time Process - As Shown below .System First execute the master Process and as soon as it reaches the Signal activity , it will Signal the Detail activity for execution.With the Invoke activity we call the detail process and control is then transfer to detail.









Step#8
Details Process at RUN Time  - Once Control transfer to Detail , it execute the Receive Signal Process to get the control from Master and execute the complet 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 pass the control between master and deatils , but to call the Master/detail process we still need Invoke/receive activity in our flow.

1 comment:

  1. Hi!

    I am looking for information about how to migrate Oracle Workflow to BPEL flow .
    any Idea from where I get some additional Info. on this subject

    ReplyDelete