How to Use Dynamic Sub-Processes
This tutorial shows you how to use dynamic sub-processes within a business process.
There can be occasions when a business process needs to call on one from a number of routines, but it is not known at design time which particular one of them will be called on any given occasion. This can be handled by creating a number of sub-processes. The exact sub-process to be run is chosen dynamically at runtime, depending on the process data that apply at that time. In TIBCO Business Studio, this is accomplished by using a common process interface for the set of sub-processes.
After you complete this tutorial, you should be able to use process interfaces to call sub-processes within a business process.
In this process:
- A nurse enters basic information about the patient, such as their name and address.
- On a second form the nurse enters the symptom that the patient reports, and selects whether to send the for a blood test, an X-ray, or both.
- As a result of this decision, a work item is sent to the required departments (for example, the X-ray department) and someone in that department books an appointment. An email is sent to the patient with the appointment details.
- Finally, a form displays to a supervisor a summary of the patient’s admission information along with any new booking information that has been entered.
Before You Begin
Before you start this tutorial, you can become familiar with TIBCO Business Studio by completing the initial Welcome Users tutorials.
- Importing the Initial Resources
This tutorial supplies a project and an organization model as the starting-point, so that the initial work is already done for you. - Examining the Starting Process
The DynamicSubProcTutorial project provides a partly-completed process. - Creating the Process Interface
You must create the process interface that will be used by the dynamic sub-processes. - Creating a Sub-Process
Now you can create a sub-process based on the process interface Make Appointments. This will take the patient details as input and will output an appointment time. - Creating a Second Sub-Process
You need a second sub-process that performs the same task as the Blood Test Appointment process, but for x-ray appointments. - Adding Parameters to the Process Tasks
Now add the parameters in the main Initial Consultation business process to the tasks within that process. - Tailoring the Forms
The default forms generated for the user tasks can be improved. You may wish to re-arrange the fields on the form in something other than their default alphabetical order. In addition, the mandatory NeedBloodTest and NeedXRay parameters need to presented as radio buttons rather than as checkboxes. This is because they are mandatory fields, so need to be completed in all cases. - Defining Which Sub-Process is Called
The script task Populate Array is where the logic occurs to set the exact sub-process that will be selected at runtime. - Setting up the Summary Task
The Summary task presents a form which gives a summary of the patient information, including which test or tests are necessary and the appointment times allocated. This information is set up by the Set Appointment Time script task. - Generating the Business Service
You must produce a business service to use in running the project. - Deploying and Running the Process
You are now ready to deploy then run the DynamicSubProcTutorial process. - Verifying the Results
You can verify the results of your tutorial by installing the tutorial from the samples folder in the product directory. Your project must look similar to the sample solution project.