In earlier post we discussed about templates which are
introduced in SOA 12c as a new feature. There are mainly three types of
templates which are introduced in 12c, we discussed about each template in
details in previous post. If you missed to read that post, you can click here to read that. In 12c there is another feature introduced which is called sub
process, we will discuss about sub processes in this post.
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.
Sub process contains fragment of BPEL 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. So whenever we need to make any
change into the logic/code we need not to do that change at all places, we just
need to do that change in sub process and that change will reflect at all place
wherever we call that sub process.
Below things we need to keep in mind when we use sub
processes.
Sub processes are supported for only BPEL 2.0; it is not
supported for 1.1 version. In the first release of 12c, we cannot use sub
processes across multiple composites i.e. sub processes can be used inside same
composite only.
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.
E.g. suppose we receive the sales order from source
system, once we receive the sales order, first we update the source system that
we receive the sales order successfully, secondly after we receive the order,
we do required validations and submit the order to target system, after we
submit, we again send status back to source system that order is successfully
submitted. In both the cases we update database flag in source system. Here we
can use inline sub process, we can put activities which update the status in
source database in one scope and create an inline sub process from it. Once we
have inline sub process created, we can use call activity to call that sub
process to update the receive status and submit status. So if in future there
is any change in table structure or table columns then we need to make that
change only in sub process and that will reflect at both the places.
Click here to see how to create and use inline subprocesses.
Click here to see how to create and use inline subprocesses.
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.
Click here to see how to create and use standalone subprocesses.
Reference: Oracle Fusion Middleware Guide 12c
0 comments :
Post a Comment