We discussed about sub processes in previous post, we also discussed about types of sub processes available in SOA 12c. In this post we discuss about Inline sub process, we will also see how to create the inline sub processes, how to make change to inline sub process and how to use these inline sub process inside BPEL process.
Inline sub processes are introduced to increase developer productivity and reduce code redundancy. These inline sub processes are confined to parent BPEL process only, we can’t use these inline sub processes outside parent BPEL process. If we want to use sub process across different BPEL processes inside one composite then we need to go for standalone sub processes. These inline sub processes are used when we want to repeat same logic in one BPEL flow so instead of writing same activities again and again inside same BPEL, we add that activities to inline sub process and call that inline sub process wherever required inside that BPEL process using call activity. This means whenever any change comes in future then we need not to make any change in parent BPEL process, we only need to make that change in inline sub process and that change reflect at all the places wherever we call that inline sub process.
How to create Inline Sub Process
We have created one sample SOA composite and added one one-way BPEL process to it. Inside BPEL process we write customer information to local file. We have added assign and Invoke activity inside scope activity that writes the local file.
To create an inline sub process, right-click on the scope activity and click on “Convert to a Subprocess”. Fill the inline sub process label text and also provide comments. There is provision to use custom images for sub process so you can also provide your own image for this sub process.
Once it is created, you can see this inline sub process in component palette under Subprocesses section. You see that this sub process is categorized as Inline sub process. You also see that scope activity inside BPEL get replaced with Call activity.
How to make changes to Inline Sub process
Once we create the inline sub process, we can see it inside component palette. There are chances that in future we may need to make some changes to this inline sub process. As already mentioned before, once we make changes to inline sub process that changes get reflected everywhere wherever we used this inline sub process. To make changes to inline sub process first we need to open this sub process, to open this sub process, choose this sub process from drop-down list and make required changes to it.
How to use inline Sub Process
To use the inline sub process, we simply need to drag the inline sub process from component palette to BPEL flow. Once we drag the sub process to BPEL flow, it adds one call activity to the BPEL flow which call that inline sub process. You can change the call activity name as per your naming standards.
Once we are done with above steps, deploy your composite to server. All the sub process automatically get deployed to server when we deploy composite as these sub process are part of composite only. Test the composite and you can see that inline sub process get triggered two times.