Modeling a workflow from document flow

  1. Select Connect > Data Flows.
  2. Open the details page of the document flow for which you must add the workflow activity.
  3. Click Workflow to add the activity to the flow from the toolbox.
  4. Ensure the workflow activity has a preceding activity and the preceding activity provides one document type. The verb of the document must be either Sync or Process. The type of output document of the workflow activity is the same as the input document
  5. In the workflow activity properties, select the Properties tab.
  6. Specify the name for the activity and optionally add a description.
  7. Select the workflow to be used. Click New to create a new workflow definition or click Details to view the details of an existing workflow definition.
    The workflow parameters and workflow structures from the workflow definition are retrieved when the workflow is selected or the Refresh Workflow button is used.
  8. Select the Attributes tab.
  9. Select any attributes of the document that must be used in the workflow activity.
    See Selecting attributes.

    You can only select attributes after a document is selected as on the line between the preceding activity and the workflow activity.

  10. Select the Parameter Mapping tab.
    Here you can select which attributes to use for each input or output parameter of the workflow.
    You can only select an attribute if the data type matches the data type of the workflow parameter. The name of the attribute can differ from the name of the workflow parameter. For each input parameter, an attribute must be selected. If the workflow activity is followed by a next activity in the flow you must select an attribute for each output parameter.
  11. Select the Structure Mapping tab. Observe that the root of the workflow structure is mapped to the noun name from the document that triggers the workflow activity. Mapping the other elements of the structure is optional. To complete the mapping, click Map next to each structure element.

    You can map levels from the workflow structures to document attributes that have children. Mapping is done top down. Sub-levels or fields from the structure can only be mapped to child elements that are based on the parent level mapping. The mapping process is done through a selection dialog box and allows the selection of valid elements that have matching data-type.

    Optionally, you can specify a filter for the selected attributes. Click Filter next to the path you mapped. The xml-attributes of the selected element and the xml-attributes of its repeating parent elements are displayed. Edit the filter by specifying a value for one of the attributes and click OK. The path is updated with the filter. At runtime, the occurrences that comply with the filter are extracted from the document and mapped into the workflow structure. If there are several occurrences of the document element mapped to one single field, the first occurrence is selected.

    Note: 
    1. Skipping several levels when you map a field to a document element is called a "mapping with elevation". If several sibling fields are mapped using a mapping with elevation. Use a filter to ensure the fields are selected from the same path determined by the filter.
    2. Fields in workflow structures are single occurrence. To retrieve all occurrences when the document element mapped to the field has multiple occurrences. You must define a workflow structure level that is mapped to the direct parent of the document element. In other words, avoid mapping with elevation in this case.
    3. You cannot map a flat structure from a BOD, for example a custom BOD, into a more complex workflow structure, with several levels.
  12. When using a workflow activity, the document flow depends on the workflow.
    This means:
    • When changing the input or output parameters of a workflow, you must update the workflow activity accordingly. Use the Refresh button from the Properties tab to get the latest set of input and output parameters and updated structures of the workflow. Note that if a structure is changed, all mappings are removed upon Refresh.
    • Activate the workflow definition before activating the document flow. You cannot deactivate the workflow definition as long as the document flow is active.
    • When the running workflow is canceled or fails, the workflow activity raises a Confirm BOD on the incoming document. Resubmitting this from the Error BODs page starts a new instance of the workflow.
    • If one or more workflows are running for a workflow activity, it is advisable to not deactivate the document flow. Otherwise the results of the workflow cannot be handled when the workflow completes. In this case an error is logged, because the result of the workflow cannot be delivered to the workflow activity anymore.
    • When exporting and importing the document flow, also export and import the used workflow definition.