Top
Systemwalker Runbook Automation Studio User's Guide
Systemwalker

11.9.2 Defining Start Process Triggers

A Start Process Trigger starts a process instance in response to data that comes in from an external system.

To define a Start Process Trigger:

  1. Add the User Defined Attributes (UDAs) you will need for your trigger to the process definition.

  2. Click the empty space in the Process Definition editor to display the Properties view for the process definition.

  3. Select the Triggers tab.

  4. Click Add.

    A new trigger with a default name is added.

  5. Select the trigger to view the details for that trigger in the Trigger Details area.

  6. Modify the name of your trigger as required on the General sub-tab, in the Trigger Details area.

  7. Optional: Describe the purpose of your trigger on the General sub-tab.

  8. Select the Event sub-tab.

    If you have an XML schema that describes the format of the incoming data, type its URL in the URL to XML Schema field. Click Retrieve to load the XML schema.
    The icon next to the URL to XML Schema field tells you if the XML schema has been loaded.

  9. If you want process instances to be started only under certain conditions, specify a JavaScript expression in the Event Filter field that defines those conditions.

    For information on JavaScript expressions, refer to section 11.14 Defining JavaScript Expressions.

    The following is an example of a JavaScript expression that starts a process instance only if the price of the item is greater than $20.00:

    Packages.java.lang.Float.parseFloat(eventData.getXMLData("/shiporder/item/price/text()"))> 20

    Figure 11.39 Specifying an Event Filter

  10. Select the Data Mapping sub-tab. Map the elements of the incoming XML file to UDAs. To map an element:

    1. Click Add.

    2. If you specified an XML schema, select an XML element from the Event Element list.

    3. Select the UDA from the Variable list to which you want to map the XML element.

    Note

    Triggers are flexible enough so that you can map external data of type String to a UDA of type INTEGER as long as the external data consists only of numerals.

    1. In the XPath of Variable field, type in an XPath expression of the selected UDA. This expression is used to map the incoming XML file to a specific attribute of the UDA.

      The XPath field is activated only if you have selected a UDA of type XML from the Variable list.

      Figure 11.40 Defining Data Mappings

    2. If you want to remove a mapping, select it and click Remove.

  11. When you have completed the data mapping, select the General sub-tab. Select the Enable check box to enable your trigger.