About Subprocesses

Subprocesses are embedded or in-line processes within the main business process. They are mainly used to manage complex business processes by grouping related activities together. Subprocesses not only improves the readability of complex processes in design-time but also improves the runtime user experience by enabling users to take collective actions on similar tasks during process execution.

Note the following:
  • Subprocesses are child processes within the main (parent) process. But unlike reusable processes, they can't be called from outside the parent process.
  • Subprocesses must always begin with a none start event and end with a none end event.
  • Subprocesses are useful in modeling a group of repeatable tasks within the main process as subprocess activities can be configured as multi-instance activities.
  • Subprocesses can have sequence flows only within the subprocess. Sequence flows that connect to activities outside the subprocess are not supported.

Let us explore how we can use subprocesses to make a complex process such as an employee onboarding process into a more manageable and readable process in design time, and then explore the runtime experience for the same. The employee onboarding process can have several activities within it, such as activities related to the main hiring process, and activities for training newly hired employees. We'll use the subprocess activity to group related hiring and training activities into inline subprocesses thereby making the main process more readable.

  1. Create a structured process.
  2. Add subprocess activities onto the process flow and group related activities into the inline subprocesses.
    1. In the Activities palette, expand Systems and drag and drop a subprocess activity onto the process flow.

      For example, we have added two subprocess activities Hiring Process and Mandatory Trainings Process onto the process flow of the Employee Onboarding Process. We'll group activities related to hiring and training under these two subprocesses.

      Description of subprocess-1.png follows
      Description of the illustration subprocess-1.png

    2. Now expand the subprocess activity, and then drag and drop required activities from the Activities palette into the subprocess.
      For example, in the subprocess Hiring Process, we have added the following activities:
      • A human task activity Collect Basic Employee Information for the recruiter to gather information about the employee.
      • A decision activity Perform Background Check to check if the information provided by the employee matches the job criteria.
      • An exclusive gateway which when evaluates to True allows the process to move to the next human activity Generate and Sign Employment Contract, otherwise sends a notification with the Notify activity.
      • A human task activity Generate and Sign Employment Contract for the employer to generate and submit the employment contract.
      • A human task activity Final HR Approval of type approve for the HR manager to approve the employment contract for the employee.

      You would need to configure the implementation details for the activities. For example, in case of the human task activities you would need to associate specific forms that the end user needs to complete and take actions (Submit or Approve).

      Description of subprocess-2.png follows
      Description of the illustration subprocess-2.png

      The two inline subprocesses - Hiring Process and Mandatory Trainings Process become child processes of the main process (Employee Onboarding Process).

      Depending on your modeling requirement, you can also use nested subprocess, that is, add a subprocess inside another subprocess.

  3. Configure the subprocess activity as a multi-instance activity. See Configure a Multi-instance Activity.

    For example, we have configured the subprocess activity Hiring Process as a multi-instance activity.

    Description of subprocess-multiinstance.png follows
    Description of the illustration subprocess-multiinstance.png

    A marker with two parallel lines appear on the subprocess activity indicating that it has been configured as a multi-instance activity whose instances will execute in parallel in runtime.

  4. Define data associations for the activities in a subprocess. See Configure Data Association.

    For example, the following figure shows the data associations for the Final HR approval activity.

    Description of subprocess-dataassociation.png follows
    Description of the illustration subprocess-dataassociation.png

    Notice the following under the Data Objects section in the data association editor:
    • The data objects for the subprocess are present under Subprocess Data.
    • The multi-instance predefined variables for the subprocess (as the subprocess is configured as a multi-instance activity) are present under Activity Loop.
  5. Deploy and test the process application. Take actions and complete the various tasks in the parent process and the child subprocesses in runtime.
    For the Employee Onboarding process, the sequence of the tasks will be as follows:
    • The process instance is started by submitting the start form.
    • The process moves to the next task, in this case the first activity (Collect Basic Employee Information) in the subprocess Hiring Process.
    • After completing each task in the subprocess Hiring Process that is configured as a multi-instance activity with parallel execution, the process moves to the next activity Schedule Orientation in the process flow.
    • Once the Schedule Orientation task is completed, the process moves to the subprocess Mandatory Trainings Process.
    • After completing each task in the subprocess Mandatory Trainings Process, the process ends and the process instance state changes to Completed.

    Description of subprocess-audit.png follows
    Description of the illustration subprocess-audit.png

    If required, in the Audit window you can drill down and check how each of the parallel instances of the multi-instance subprocess (Hiring Process) executed.

    Description of subprocess-audit-expand.png follows
    Description of the illustration subprocess-audit-expand.png