Monday 7 January 2013

SOA Suite 11g: Coordination between two BPEL processes

While scanning the FMW 11g SOA Suite developer guide, I noticed the feature that enables coordination between master and detail BPEL processes by using so- called signals.

As far as I know, this feature is introduced in 11g and is very useful in situations where a parent process has to control the processing of the child processes. And, vice versa, where child processes has to notify their parent process when a specific task is completed. Most of the time a signal is enough and no additional information has to be sent along. Therefore, for example, a BPEL invoke activity with correlation might be a bit too complex for this purpose.

Ok how does it work? The tutorial gives you a clear explanation how to use signaling in Oracle BPEL so I will describe the rough details about how you can use signaling and also some limitations that I discovered while praticing with this feature.

How-to
  1. Create a BPEL master detail proces in the composite.
    • Use the process type asynchronous for the master process and the the type one-way for the detail
  2. Add an Invoke activity to the master process to invoke the detail process
    • Open the source view of the BPEL editor and add the following property to the invoke activity:

      bpelx:invokeAsDetail="true"

  3. Add a Wait activity to the master process for demo purposes
  4. Add a Signal activity to the master process
    • Remember the Label value
    • Set the To value to details
  5.  Add a Receive Signal activity to the master process
    • Remember the Label value
    • Set the From value to details
  6.  Add a Receive Signal activity to the detail process
    • Use the Label value used in step 4
    • Set the From value to master
  7. Add a Wait activity to the detail process for demo purposes 
  8. Add a Signal activity to the detail process
    • Use the Label value used in step 5
    • Set the To value to master
  9. You're done! Deploy the composite to the server and test your composite.
The signaling feature also supports correlation to correlate signals between the master and different detail process types. It seems that correlation of signals between different composite master/detail instances are correlated automagically.

Unfortunately, the coordination functionality has some limitations:
  • Labels can not be set dynamically using XPath
  • Correlation labels can not be set dynamically using XPath
  • Only a single signal pair (signal/receive signal) can be used for a unique label
These limitations make it, for example, not possible to coordinate by using signals between a master and multiple detail instances of the same BPEL process type which are invoked in parallel or even sequential..

Oh..I still have to figure out how signaling is implemented 'under the hood'.. However, happy signaling...

No comments:

Post a Comment

xslt padding with characters call template for left pad and right pad

  Could a call-template be written that took two parameters ?   a string, and a   number) return the string with empty spaces appended t...