Saturday, September 5, 2020

Subprocess in SOA


 Sub Process

Sub Process act like a bundle which contain a piece of BPEL code which we can re-use inside same BPEL or different BPEL in same composite.

Subprocess is based on the concept of re-usability of the code.

Benefit of sub process is that it increases developer productivity and chances of human error got reduced. Suppose we have a piece of code which we need to use at multiple places in one BPEL or in one composite so instead of writing same logic/code again and again in BPEL, we can create sub process of the logic/code and call it where ever required in that BPEL or in different BPEL but in same composite. 

There are mainly two types of sub process in 12c which are explained below.

Inline Sub-Process:  

-> As name suggests this sub process is in line to parent BPEL process means this can’t be used outside parent BPEL process.

-> Inline sub process contains group of activities which we can re-use within one BPEL process only.

-> This sub process is not visible in composite view as this is part of parent BPEL. 

->This sub process is visible in palette under sub process. 

-> We need to use call activity to call this sub process inside BPEL process. 

->  Below is real time example which explains the use of inline sub processes.

How to create Inline Sub Process

right-click on the scope activity and click on “Convert to a Subprocess”

You also see that scope activity inside BPEL get replaced with Call activity.

Once we create the inline sub process, we can see it inside component palette. 

-> Re-Usability
-> Save the person efforts
-> Better maintenance 

Standalone Sub-Process:

As name suggests this sub process act as standalone inside one composite. 

Standalone sub process is similar to inline sub process, except we can use it outside of parent process. 

This sub process contains group of activities that can be re-used across other BPEL processes. 

Similar to inline sub process we use call activity to invoke standalone sub process. 

This sub process is also visible in palette under sub process. 

we can use these standalone sub process across different BPEL process but we can use these processes inside one composite only.

 These sub process are used when we need to re-use the whole component multiple times in one composite.

 If we have logic which needs to implemented in one composite multiple places then we write that logic inside standalone sub process and call that sub process from BPEL process using call activity.

To create a standalone sub process, right-click on the composite and click on Insert and choose “Subprocess” option. 

You can drag multiple sub processes in one BPEL process, you can also use this sub process in another BPEL which is there is same composite. Once you are done with above step, your BPEL process should look like below. You also see BPEL component get wired to standalone sub process through dotted wire.


No comments:

Post a Comment

SOA Overview Part-1

  Middleware It provides a mechanism for the process to interact with other processes running on multiple network machines. Advantages...