The Basic settings, in the Multiple Sub-Process Wizard, will allow the user to easily create Multiple Sub-Processes. Most business scenarios will be modeled properly with these core elements. The Basic settings will create the Multiple Sub-Process with the following default settings:
•Determines the number of instances according to the number of items contained in the collection.
•Creates all the Sub-Process instances at the same time, in Parallel.
•Waits for all the created Sub-Process instances to finish, before allowing the parent Process flow to continue.
You can modify the default settings by means of the Advance options presented in the Multiple Sub-Process Wizard. The Advanced settings will allow the user to configure different business cases.
To illustrate the Basic Multiple Sub-Process configuration we will continue to use the Students Application Process described in the previous section.
In a school, several students have to be enrolled in order to assist to class. The applications of the students must be received and then an enrollment Process should be created: one for each student. The business situation can be modeled as shown in the following diagram:
In the example the parent Process is called Students Application and contains a Multiple Sub-Process called Student Enrollment.
The objective of the process is to:
•Create as many instances of the Student Enrollment Sub-Processes as records found in the collection related to the parent Process Entity.
•Create the Sub-Process instances in parallel to allow for non-sequential enrollments.
•Terminate the students application Process when all the enrollments have finished.
Both processes have been diagrammed in the Process Modeler and Process Entities defined for each one;
Students Application is the Process Entity of the Students Application process and Students Enrollment is the Process Entity of the Sub-Process Students Enrollment.
In order to create the multiple Sub-Process instances a collection is defined: this collection is called Students Enrollment
Note when a one-to-many relationship between two entities is created, an attribute is automatically created in the Collection Entity (many) relating it to the Parent Entity (one). This attribute (StudentsApplication.StudentsEnrollment) is the key to access to the parent process attributes starting from the Sub-Process context.
This diagram shows the parent Process before the Multiple Sub-Process is created.
To create the Multiple Sub-Process, follow the next steps:
1. Go to step 1 (Model Process) of the Process Wizard and click Edit Process. Select the parent Process called Students Application.
2. In the model diagram, right-click the Task you wish to convert, in this case Students Enrollment, and select the option Transform to Sub-Process option.
3. A new window will display the Sub-Process types. Select the Multiple option and click Next.
4. Select the process to be transformed, Student Enrollment, from the drop-down list, choose the version and click Next.
Remember that the Sub-Process model must be previously created in the Wizard, and both the parent Process and Sub-Process must have a Process Entities defined.
5. To use the Basic settings for Multiple Sub-Process click Next without marking the Advanced settings option.
6. Select the Collection Xpath. This is the Xpath that relates the Parent entity with the Collection entity from which the instances of the Multiple Sub-Process will be created.
In this case, it will be: StudentsApplication.StudentsEnrollment. There will be as many Sub-Process instances as there are objects found in the Students Enrollment Collection.
7. Click Finish
Your Students Enrollment multiple Sub-Process has been successfully configured.