Tutorial: How to create a workflow with parallel actions that can be launched at the same time

For general information on the COPYDATA and MERGEFORM workflow applications, see COPYDATA usage and MERGEFORM usage FAQs.

This tutorial applies to WorkflowGen 6.1.4 and later.

Create the MERGE_FORM action

  1. Create an IT Clearance Application process.

  2. In the process data page, define the following data. This will create one data for each parallel action data parameter saved to a data (OUT) that is shared across actions.

    • FORM_DATA_VALIDATES_ACCOUNTING

    • FORM_DATA_VALIDATES_HR

    • FORM_DATA_VALIDATES_SALES

    • FORM_ARCHIVE_VALIDATES_ACCOUNTING

    • FORM_ARCHIVE_VALIDATES_SALES

    • FORM_ARCHIVE_VALIDATES_HR

    • FORM_DRAFT_VALIDATES_ACCOUNTING

    • FORM_DRAFT_VALIDATES_SALES

    • FORM_DRAFT_VALIDATES_HR

  3. Add a new action and select the COPYDATA application. Place it just before the workflow splits into parallel actions, then set the name and description to COPY_DATA. Save the changes.

  4. In the COPY_DATA action parameters, you must create a parameter for each data that goes IN and OUT of each parallel action. This will allow the action to loop back to self before the synchronization without losing any data.

    Create the following parameters in the COPY_DATA action:

    Parameter Type Direction Send/retrieve value
    FORM_DATA1 File INOUT Send value of FORM_DATA
    Retrieve value into FORM_DATA_VALIDATES_ACCOUNTING
    FORM_DATA2 File INOUT Send value of FORM_DATA
    Retrieve value into FORM_DATA_VALIDATES_HR
    FORM_DATA3 File INOUT Send value of FORM_DATA
    Retrieve value into FORM_DATA_VALIDATES_SALES

  5. Close the pop-up(s) and delete all three transitions from DEPT_SUP_APPROVAL, then add a transition from DEPT_SUP_APPROVAL to COPY_DATA, and another transition from COPY_DATA to each of the parallel actions.

  6. Add the following conditions by double-clicking the transitions:

    i. On the transition from DEPT_SUP_APPROVAL to COPYDATA, add the condition:

    <FORM_DRAFT> <> "Y" And <SUP_APPROVAL> = "YES" And (<EMP_ACCOUNTING> = "True" Or <EMP_SALES> = "True" Or <EMP_HR> = "True")

    ii. On the transition from COPYDATA to VALIDATES_ACCOUNTING, add the condition:

    <SUP_APPROVAL> = "YES" And <EMP_ACCOUNTING> = "True" And <FORM_DRAFT> <> "Y"

    iii. On the transition from COPYDATA to VALIDATES_SALES, add the condition:

    <SUP_APPROVAL> = "YES" And <EMP_SALES> = "True" And <FORM_DRAFT> <> "Y"

    iv. On the transition from COPYDATA to VALIDATES_HR, add the condition:

    <SUP_APPROVAL> = "YES" And <EMP_HR> = "True" And <FORM_DRAFT> <> = "Y"

  7. In each parallel action, configure the FORM_DATA parameter to receive and update the specific data created in step 1 (FORM_DATA_VALIDATES_ACCOUNTING, FORM_DATA_VALIDATES_HR, and FORM_DATA_VALIDATES_SALES).

    Examples of parameters required for the VALIDATES_ACCOUNTING action:

    Parameter Type Direction Send/retrieve value
    FORM_DATA File INOUT Send value of FORM_DATA_VALIDATES_ACCOUNTING
    Retrieve value into FORM_DATA_VALIDATES_ACCOUNTING
    FORM_ARCHIVE File INOUT Retrieve value into FORM_ARCHIVE_VALIDATES_ACCOUNTING
    FORM_DRAFT Text OUT Retrieve value into FORM_DRAFT_VALIDATES_ACCOUNTING

  8. Add a new action and place it after the synchronization bar. Select the MERGEFORM application, then set the name and description to MERGE_FORM. Save the changes.

    Note: The synchronization is important after the parallel actions because it ensures that all parallel actions are completed and synchronized before the merge takes place.

  9. Configure the MERGE_FORM action parameters.

    To merge the form data:

    i. The FORM_DATA parameter is the merge target. Send the original FORM_DATA and retrieve the value into the same FORM_DATA data.

    ii. Select FORM_DATA_SOURCE1 and send the value of FORM_DATA_VALIDATES_ACCOUNTING.

    iii. Add FORM_DATA_SOURCE2 and FORM_DATA_SOURCE3 for the two remaining parallel actions, and send the value of their respective FORM_DATA files.

    iv. Select FORM_FIELDS_MERGE1 and send the text value ACCOUNT_*. This will merge all fields whose names start with ACCOUNT_.

    v. Add FORM_FIELDS_MERGE2 and FORM_FIELDS_MERGE3, and send the text value to match the parameters to merge.

    To merge the form archive:

    i. Add a FORM_ARCHIVE parameter that will act as the merge target.

    ii. Send the value of the original FORM_ARCHIVE and retrieve the value into the same FORM_ARCHIVE data.

    iii. Add a FORM_ARCHIVE_SOURCE1 parameter and send the value of FORM_ARCHIVE_VALIDATES_ACCOUNTING.

    iv. Add FORM_ARCHIVE_SOURCE2 and FORM_ARCHIVE_SOURCE3 for the two remaining parallel actions, and send the value of their respective FORM_ARCHIVE files.

    v. Add a FORM_FIELDS_ARCHIVE1 parameter and send the text value ACCOUNT. This will merge the section whose ID is equal to ACCOUNT.

    vi. Add FORM_FIELDS_MERGE2 and FORM_FIELDS_MERGE3, and send the text values that match the IDs of the fields to merge.

  10. Close the pop-up(s), then add a transition from the synchronization bar to MERGE_DATA, a transition from MERGE_DATA to the end point, and a transition to CREATES_IT.

Once the MERGE_FORM action is created, continue your workflow design as usual. There is nothing to edit in the other workflow actions.

Configure the Save as Draft feature on parallel actions

  1. Add a new parameter named FORM_DRAFT to each parallel action, then retrieve the value of each FORM_DRAFT parameter into the corresponding action’s FORM_DRAFT data.

    For example, the FORM_DRAFT parameter in the VALIDATES_ACCOUNTING action will retrieve the value in the FORM_DRAFT_VALIDATES_ACCOUNTING data, the FORM_DRAFT parameter in the VALIDATES_SALES action will retrieve the value in the FORM_DRAFT_VALIDATES_SALES data, and so on.

  2. For each parallel action, add a loop transition onto itself, then do the following:

  3. i. Double-click on the loop transition of the VALIDATES_ACCOUNTING action and add the condition <FORM_DRAFT_VALIDATES_ACCOUNTING> = "Y".

    ii. Double-click on the transition from VALIDATES_ACCOUNTING to the synchronization bar and add the condition <FORM_DRAFT_VALIDATES_ACOUNTING> <> "Y".

    iii. Repeat these two steps for each parallel action with FORM_DRAFT_VALIDATES_SALES and FORM_DRAFT_VALIDATES_HR.

  4. It’s best practice to add an exception management action to system actions that allow a user or administrator to relaunch the action manually instead of cancelling the workflow in case of an error. To do this:

    i. Add a manual action named COPY_DATA_EXCEPTION close to the COPY_DATA action and add transitions in both directions, from COPY_DATA to COPY_DATA_EXCEPTION and vice-versa.

    ii. Double-click the transition that goes from COPY_DATA to COPY_DATA_EXCEPTION, then click the Exception tab. Select Execution error, save, and close the pop-up.

    iii. Add a manual action named MERGE_FORM_EXCEPTION close to the MERGE_FORM action and add transitions in both directions, from MERGE_FORM to MERGE_FORM_EXCEPTION and vice-versa.

    iv. Double-click the transition that goes from MERGE_FORM to MERGE_FORM_EXCEPTION and click the Exception tab. Select Execution error, save, and close the pop-up.

Download the complete process, unzip it, and import the XML file into WorkflowGen to see it in action: IT_CLEARANCE_MERGE.xml.zip