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
-
Create an IT Clearance Application process.
-
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
-
-
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.
-
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_DATA1File INOUT Send value of FORM_DATA
Retrieve value intoFORM_DATA_VALIDATES_ACCOUNTINGFORM_DATA2File INOUT Send value of FORM_DATA
Retrieve value intoFORM_DATA_VALIDATES_HRFORM_DATA3File INOUT Send value of FORM_DATA
Retrieve value intoFORM_DATA_VALIDATES_SALES -
Close the pop-up(s) and delete all three transitions from
DEPT_SUP_APPROVAL, then add a transition fromDEPT_SUP_APPROVALtoCOPY_DATA, and another transition fromCOPY_DATAto each of the parallel actions. -
Add the following conditions by double-clicking the transitions:
i. On the transition from
DEPT_SUP_APPROVALtoCOPYDATA, 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
COPYDATAtoVALIDATES_ACCOUNTING, add the condition:<SUP_APPROVAL> = "YES" And <EMP_ACCOUNTING> = "True" And <FORM_DRAFT> <> "Y"iii. On the transition from
COPYDATAtoVALIDATES_SALES, add the condition:<SUP_APPROVAL> = "YES" And <EMP_SALES> = "True" And <FORM_DRAFT> <> "Y"iv. On the transition from
COPYDATAtoVALIDATES_HR, add the condition:<SUP_APPROVAL> = "YES" And <EMP_HR> = "True" And <FORM_DRAFT> <> = "Y" -
In each parallel action, configure the
FORM_DATAparameter to receive and update the specific data created in step 1 (FORM_DATA_VALIDATES_ACCOUNTING,FORM_DATA_VALIDATES_HR, andFORM_DATA_VALIDATES_SALES).Examples of parameters required for the
VALIDATES_ACCOUNTINGaction:Parameter Type Direction Send/retrieve value FORM_DATAFile INOUT Send value of FORM_DATA_VALIDATES_ACCOUNTING
Retrieve value intoFORM_DATA_VALIDATES_ACCOUNTINGFORM_ARCHIVEFile INOUT Retrieve value into FORM_ARCHIVE_VALIDATES_ACCOUNTINGFORM_DRAFTText OUT Retrieve value into FORM_DRAFT_VALIDATES_ACCOUNTING -
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.
-
Configure the
MERGE_FORMaction parameters.To merge the form data:
i. The
FORM_DATAparameter is the merge target. Send the originalFORM_DATAand retrieve the value into the sameFORM_DATAdata.ii. Select
FORM_DATA_SOURCE1and send the value ofFORM_DATA_VALIDATES_ACCOUNTING.iii. Add
FORM_DATA_SOURCE2andFORM_DATA_SOURCE3for the two remaining parallel actions, and send the value of their respectiveFORM_DATAfiles.iv. Select
FORM_FIELDS_MERGE1and send the text valueACCOUNT_*. This will merge all fields whose names start withACCOUNT_.v. Add
FORM_FIELDS_MERGE2andFORM_FIELDS_MERGE3, and send the text value to match the parameters to merge.To merge the form archive:
i. Add a
FORM_ARCHIVEparameter that will act as the merge target.ii. Send the value of the original
FORM_ARCHIVEand retrieve the value into the sameFORM_ARCHIVEdata.iii. Add a
FORM_ARCHIVE_SOURCE1parameter and send the value ofFORM_ARCHIVE_VALIDATES_ACCOUNTING.iv. Add
FORM_ARCHIVE_SOURCE2andFORM_ARCHIVE_SOURCE3for the two remaining parallel actions, and send the value of their respectiveFORM_ARCHIVEfiles.v. Add a
FORM_FIELDS_ARCHIVE1parameter and send the text valueACCOUNT. This will merge the section whose ID is equal toACCOUNT.vi. Add
FORM_FIELDS_MERGE2andFORM_FIELDS_MERGE3, and send the text values that match the IDs of the fields to merge. -
Close the pop-up(s), then add a transition from the synchronization bar to
MERGE_DATA, a transition fromMERGE_DATAto the end point, and a transition toCREATES_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
-
Add a new parameter named
FORM_DRAFTto each parallel action, then retrieve the value of eachFORM_DRAFTparameter into the corresponding action’sFORM_DRAFTdata.For example, the
FORM_DRAFTparameter in theVALIDATES_ACCOUNTINGaction will retrieve the value in theFORM_DRAFT_VALIDATES_ACCOUNTINGdata, theFORM_DRAFTparameter in theVALIDATES_SALESaction will retrieve the value in theFORM_DRAFT_VALIDATES_SALESdata, and so on. -
For each parallel action, add a loop transition onto itself, then do the following:
-
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_EXCEPTIONclose to theCOPY_DATAaction and add transitions in both directions, fromCOPY_DATAtoCOPY_DATA_EXCEPTIONand vice-versa.ii. Double-click the transition that goes from
COPY_DATAtoCOPY_DATA_EXCEPTION, then click the Exception tab. Select Execution error, save, and close the pop-up.iii. Add a manual action named
MERGE_FORM_EXCEPTIONclose to theMERGE_FORMaction and add transitions in both directions, fromMERGE_FORMtoMERGE_FORM_EXCEPTIONand vice-versa.iv. Double-click the transition that goes from
MERGE_FORMtoMERGE_FORM_EXCEPTIONand click the Exception tab. Select Execution error, save, and close the pop-up.
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.
Download the complete process, unzip it, and import the XML file into WorkflowGen to see it in action: IT_CLEARANCE_MERGE.xml.zip


