Over a million developers have joined DZone.

Resuable BPEL Subprocesses in Oracle SOA 12c

· Integration Zone

Build APIs from SQL and NoSQL or Salesforce data sources in seconds. Read the Creating REST APIs white paper, brought to you in partnership with CA Technologies.

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 is converted into in line subprocess.


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

For more information visit: Oracle SOA 12c: Getting started with Resuable BPEL Subprocesses 

The Integration Zone is brought to you in partnership with CA Technologies.  Use CA Live API Creator to quickly create complete application backends, with secure APIs and robust application logic, in an easy to use interface.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}