Creating a Multiple Sub-Process

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Model Process > Modeling for execution > Sub-Processes > Reusable Sub-Processes > Understanding Multiple Sub-Processes >

Creating a Multiple Sub-Process

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:

 

Configure multiple subprocess1

 

 

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

 

 

Configure multiple subprocess with basics10

 

 

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:

 

Configure multiple subprocess with basics2

 

 

1. Go to step 1 (Model Process) of the Process Wizard and click Edit Process. Select the parent Process called Students Application.

 

 

Configure multiple subprocess with basics3

 

 

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.

 

Configure multiple subprocess with basics4

 

3. A new window will display the Sub-Process types. Select the Reusable option.

 

Configuremultiplesubprocesswithbasics1.2.

 

4. A properties window appears:

 

 

configureEmbededSubprocess16

 

The properties window presents the following controls:

 

Controls

Description

Multiple (check-box)

Sets the Sub-Process as Multiple. When selected, it disables the add button control of the reusable Sub-Process, so you must select an existing process.

Processes (drop-down list)

Displays the existing processes list and sets the selected one as the Sub-Process

Process version (drop-down list)

Displays the selected process versions list and sets the selected one as the Sub-Process version.

Diagram

Displays a preview snapshot of the selected process model.

Status Bar

Presents the Sub-Process status configuration horizontally.

 

To define the Multiple Sub-Process, you must select one option from the Processes drop-down list:

 

5. Click the drop down list and select the process desired. Then, click the Process version drop-down list and select the desired one.

 

Configuremultiplesubprocesswithbasics5.1

 

 

6. Click the Multiple tab and  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.StudentsEnrollments. There will be as many Sub-Process instances as there are objects found in the Students Enrollment Collection.

 

Select OK.

 

Configuremultiplesubprocess6.1

 

7. Click the Finalize button.

 

Configuremultiplesubprocess6.2

 

 

 

Remember that for defining a Multiple Sub-Process, the process diagram must be previously created in the Wizard. Both the parent Process and Sub-Process must have a Process Entities defined.

 

 

Your Students Enrollment multiple Sub-Process has been successfully configured.