Sunday, October 26, 2014

Oracle SOA 12c: Getting started with Resuable BPEL Subprocesses

Previously if any one wants to resuse the BPEL code then one has to build a logic into the separate process and this process is called by invoke activity through webservice in another process. Well we can't say this is the problem or not, but in Oracle SOA 12c there is more efficient way to make BPEL code reusable across the process. One scenario came to my mind is in BPEL process, sometimes you have to "log the messages for monitoring", "send notification to the process owners" etc. and this can be done at multiple times in a process, so calling subprocess is better way than invoking external http service etc.

Here are some of the benefits of Subprocess:

  • Reusability of BPEL code. Now don't have to write same code multiple times, just create subprocess and call that subprocess where ever you want.
  • You don't have to change the logic at multiple times, just change in the sub process i.e. at one place only.
  • Code looks more modularized and easy to understand by any other stakeholder.
  • It is better than calling the invoke activity.
Some points needs to be remember about subprocess
  • Subprocess is only supported with BPEL 2.0
  • Correlation sets are not supported with subprocess.
  • Subprocess can not be shared between multiple composites. But you can use the soa template to shared across the multiple composite.
  • Monitor view is not supported from inside the subprocess.

Oracle SOA 12c provides support for two types of resuable subprocesses.

Standalone BPEL Subprocess:

Standalone bpel process defined in a file with extension .sbpel (subprocess bpel extension). This process is out side the parent bpel process as shown in the figure below:

Here in the subprocess you can use any activities that is use in the bpel and you can use the subprocess by connecting through dotted wire with the parent bpel process. In figure above two sub process AlertNotificationProcess and LogsProcess are wired with Error bpel process.

See this post How to create standalone process.

Inline BPEL Subprocess

Inline subprocess are defined inside the parent bpel process that means we can't call the subprocess outside the parent bpel process. This subprocess may be useful in the situation where same activity happens at multiple times in single bpel process e.g.

  • Status updating in database or calling external webservice at multiple times in process at various levels.
  • logging of message at multiple times in a process.
  • Validation of message in a process.
see the figure below:

you can see the inline process under the components tab, here the log scope has been converted into subprocess. Here the log scope is converted into in line subprocess.

Note:  Always remember only the scope activity can be converted into inline subprocess.

No comments:

Post a Comment