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.

Procedure

  1. Double-click on the Populate Array script task.
  2. On the General tab, set the language in the Script Defined As field to JavaScript.
  3. Add the following JavaScript:

if (NeedXRay) {
    TestCommentsArr.add(XRayComments);
    DeptArr.add("XRAY");
    ProcessIdentifierArr.add("XRayAppointment");
}
    
if (NeedBloodTest) {
    TestCommentsArr.add(BloodTestComments);
    DeptArr.add("BLOODTEST");
    ProcessIdentifierArr.add("BloodTestAppointment");
}

  1. Select the call sub-process activity Book Appointment.

    Click the button by the Sub-process Name field. The Select Process or Process Interface dialog displays.

  2. Select Make Appointments Interface and click OK.

    Click the button by the Runtime Identifier Field field. The Select Data Field or Formal Parameter dialog displays.

  3. Select ProcessIdentifierArr. This is the field that holds the list of potential sub-processes to call. Click OK.
  4. In the Priority field, select Inherit from Parent process from the drop-down list.
  5. Select the Map To Sub-Process tab. Map the input fields to the process interface as follows:
  6. Map the output from the sub-process as follows: