Step 1: Create a process map to handle import events

Use the following steps to create a process map that can be embedded to your main process map to identify whether the document is imported successfully and handle any unsuccessful document import.

  1. Navigate to Workflow > Business processes and click New.
  2. Specify a Name for the process map such as Handle Import Events.
  3. On the Category list, select Default Category.
  4. Create a process variable, "ErrorMessage" of type String. See Create process variables.
  5. Create the following three process events: IMPORTRUN, IMPORTDUPLICATE, and CHECKEVENT. See Create a process event.
  6. Add the following three process flows for the process map:
    1. Create a flow for a successful import event
    2. Create a flow for duplicate import event
    3. Create a flow for timeout

Create a flow for a successful import event

Use the following steps to create a flow that signifies that the documents are successfully imported.

  1. Select the Start node and on the satellite, click the Activity icon .

    An activity node is added.

  2. Select the activity node and enter a Name as Successful Import.
  3. On the Type list, select Synchronization.
  4. In the Activity properties panel, click the Dependents tab.
  5. Right-click in the rule editor and select Process events.
  6. In the events list, select IMPORTRUN.
  7. In the rule editor, set the condition as IMPORTRUN > 0.
  8. Select the Successful Import node and on the satellite, click the End icon.

The process map may look similar to the following.

successful event

Create flow for duplicate document import event

Use the following steps to create a flow that triggers an event to make sure that duplicate documents are not imported.

  1. In the Handle Import Events map, select the Start node and on the satellite, click the Activity icon .

    An activity node is added.

  2. Select the activity node and enter Name as Duplicate Import.
  3. On the Type list, select Synchronization.
  4. In the Activity properties panel, click the Dependents tab.
  5. Right-click in the rule editor and select Process events.
  6. In the events list, select IMPORTDUPLICATE.
  7. Select the Duplicate Import node and on the satellite, click the Activity icon .

    An activity node is added.

  8. Select the activity node and enter Name as Set Error Message.
  9. On the Type list, select .Net.
  10. Click Configure.

    The Configure .Net activity dialog box is displayed.

  11. Click in the Assembly file path box and click Default Category.
  12. On the Category list, select System Category and then select TotalAgility.Sdk.dll.
  13. On the Class list, select TotalAgility.Sdk.JobService.
  14. On the Method list, select UpdateJobVariables.
  15. Click in the Value box of the sessionId parameter, click Server variable and then click Default Category.
  16. On the Category list, select System Category and then select SPP_SYSTEM_SESSION_ID.
  17. Click for UpdatedVariable[ ].
  18. Click in the Id parameter value box and select ErrorMessage.
  19. Click the Edit icon next to the Value box of the Variable Type parameter and enter 8.
  20. Click the Edit icon next to the Value box of the Value parameter and enter a custom error message as Terminated due to import duplicate error and click OK.
  21. Select the Set Error Message node and on satellite, click the Activity icon .

    An activity node is added.

  22. Select the activity node and enter Name as Terminate Job.
  23. On the Type list, select .Net.
  24. Click Configure.

    The Configure .Net activity screen is displayed.

  25. Repeat steps 11 to 16.
  26. Click OK.
  27. Select the Terminate Job node and on the satellite, click the End icon Satellite - End node icon.

The process map may look similar to the following.

duplicate import event

Create flow for timeout

Use the following steps to create a flow so that if no event (IMPORTRUN or IMPORTDUPLICATE) is triggered for a configured timeout, the process moves to the next node in the map.

  1. In the Handle Import Events map, select the Start node and on the satellite, click the Activity icon .

    An activity node is added.

  2. Select the activity node and enter Name as Timeout.
  3. On the Type list, select Synchronization.
  4. In the Activity properties panel, click the Time and cost tab.
  5. In Triggers, click  for Process.
  6. In Target duration, select After and set the value of Minutes to 30.
  7. On the Process list, select Raise Event For Duplicate Import. See Create map for raising event.
  8. Click OK.
  9. In the Activity properties panel, click the Dependents tab.
  10. Right-click in the rule editor and select Process events.
  11. In the events list, select CHECKEVENT.
  12. In the rule editor, set the condition as CHECKEVENT > 0.
  13. Select the Timeout node and on the satellite, click the End icon Satellite - End node icon.

The final process map may look similar to the following.

timeout event