Inputting Different Data To Each Sub-Process Instance

Procedure

  1. Specify an array data field that matches the type of a non-array sub-process/interface input parameter.
  2. In a script prior to the sub-process task, populate this array data field with different data for each sub-process instance. For example:
    • appointmentTypeArray.set(0, "X-Ray");
    • appointmentTypeArray.set(1, "PlasterDept");
    • appointmentTypeArray.set(2, "Physio");
  3. In the "Map to Sub-Process" property tab, map the array data field to the non-array sub-process/interface parameter. The sub-process invoked from each instance of the task will receive the list element corresponding to the instance index of that task (see ’getActivityLoopIndex()’ in Process Instance Attributes and Methods). For example:
    • The first instance (activity loop index=0) will receive the data "X-Ray" into its "appointmentType" parameter.
    • The second instance (activity loop index=1) will receive the data "PlasterDept" into its "appointmentType" parameter.
    • The third instance (activity loop index=2) will receive the data "Physio" into its "appointmentType" parameter.