In TIBCO designer process development, dividing our business logic among multiple parent and sub processes is a quite common. There are many reasons one should follow the approach of parent-child process development in TIBCO. Designing huge and complex TIBCO business processes with all the logic in single process results in a jumbled and unorganized solution which is difficult to debug or modify later. Its always a good approach to divide the business logic among multiple processes with process invocations from one process to another sub process.
Another strong reason of opting for sub process development is code re-usability. In any TIBCO Project, designing sub processes which have common business logic can help in reuse of same code instead of reinventing the wheel every time. For example, if you have logging or auditing required at multiple points in your project, its advised to write logging and auditing code as sub process and invoke this process from any point where this functionality is required.
How to develop sub process and how to integrate parent and sub processes in TIBCO Designer? In this tutorial, I will teach you step by step calling a sub process from a parent process.
Step 1: Create Two Business Processes in TIBCO Designer
In a new TIBCO Project, create two business processes and name them as ParentProcess and SubProcess.
Step 2: Define Input And Output Parameters of SubProcess
In our tutorial, we will call sub process from the parent process by giving it some input and getting some output as return. We specify the input requirement of sub process in its Start activity. In our example, sub process will get age as input as shown below:
We specify output of our sub process in its End activity. Sub process will return status as output which is defined as a string.
In our example, we have specified XPath formula in the input of sub process end activity as shown below. It will return status value as “Not Allowed” if age is less than 18 and it will return “Allowed” otherwise.
Step 3: Call Sub Process from Parent Process
After completing all required input, output mappings of our sub process, now we need to call this sub process from our parent process. In the ParentProcess, drag subProcess so that “Call Process” activity gets added automatically. In the Input tab of this Call Process activity, specify input value for age as shown below:
We can see that output tab of Call Process activity has Status field (which is the output field that we specified while designing sub process in Step 2)
Step 3: Test Parent And Sub Process in TIBCO Designer Tester
We are now done with designing parent and sub process. Validate the processes and once they get validated successfully, we can proceed towards processes testing. Load ParentProcess in Tester. You will see that process runs successfully as shown below:
We can see above that we have received status value as “Allowed”. This value is returned from the sub process. By clicking on the sub process in tester, we can verify that sub process also ran successfully.
With this, our tutorial Calling a Sub Process From A Parent Process completes. If you still need more help, below video tutorial about calling a sub process in TIBCO can greatly help you.
TIBCO Designer Tutorial – Call a Subprocess by Xmarter