Creating a listener trigger

The listener map definition is surfaced at run time through a listener trigger. A trigger is executed when a event occurs. There are different types of events: schedule (or time based) events, data driven events, and listener maps. The listener maps occur when the node receives a message from an enterprise application defined in a listener. The contents of the message are defined by a listener map definition.

Assumptions

Before you begin to create the listener trigger, the following should have occurred:

  • You reviewed Configuring listeners.
  • You created a listener map and associated a predefined listener with it.

Procedures


To create a listener trigger, follow these steps:

  1. From Workbench left pane, go to the appropriate node, and then click the Projects icon.
    The Projects tab appears.
  2. Double-click the project you want to add the trigger to.
    The project tab appears.
  3. Click the New button from the bottom of the project tab.
    The Trigger window appears.
  4. In the Name box, type a name for the trigger. A listener trigger name can be up to 64 characters and include letters, numbers, spaces, and hyphen and underscore characters. Only letters and numbers can be used for the first character of the name. Spaces are removed from the end of the name.
  5. Click the Settings tab.
  6. Set the parameters as follows:
    1. In the Max in Progress box, type the number of triggers that must complete processing before another trigger is allowed to execute. If the number of executing triggers exceeds the number specified, the triggers are stored in a pending queue if queue is enabled, otherwise they overflow.
    2. From the Reporting drop-down list accept the Off default value.
    3. In the Max Exec Time (ms) box, type a value in milliseconds for the maximum execution time for the trigger. If the trigger exceeds this value, a warning message is logged in the Exceptions Log.
    4. In the Queue Size box, type a value that will represent the number of items to hold in the trigger queue. For this example, 20.
    5. From the Editor mode list accept the default value. The Editor mode allows you to specify a method for creating actions for the trigger. You can drag and drop an action (Canvas) or select an action from a list (List).
  7. Click the Event tab.
  8. From the Trigger Event Type drop-down list, select Listener.
    The window changes to accommodate a listener trigger.

  9. From the Listener Map Definition drop-down list, select the listener map you want to use for the trigger. The list displays all the listener map definitions created on the current node. For this example, select GetBinInformation.
    The next step is to specify an action in the trigger. The following assumes that you have selected the action from a list.
  10. From the Event tab, under the Actions section, click Add.
    The New Action window appears.

  11. Select Set, and then click Add.
    The right pane changes to accommodate the Set action.
    Within the Set pane, there are Set Source and Set Destination sections.
    The next step is to specify a map variable that was defined in the GetBinInformation listener map as the source.
  12. Under Source, next to Constant, click the down-arrow to display a list of variables.
    A list of variables appears.
  13. Expand the list of variables to locate EventVariables, and then expand EventVariables

    For this example, the map variables that were defined in the Input tab of the GetBinInformation listener map definition appear.
    For listener triggers, the values of these source map variables can be used as input for Transaction actions, Expression actions, or in Set actions as shown in this example.
  14. Select the appropriate variable to use as the source. For this example, BinNumber.
    The variable is added to the Variable box.

    The next step is to specify an output map variable that was defined in the Output tab of the GetBinInformation listener map as the destination variable. Values can be written to these variables when the trigger executes.
  15. Under Destination, next to the Variable box, click the down-arrow to display a list of variables.
    A list of variables appears.
  16. If necessary, expand the list of variables to locate the EventVariables, and then expand EventVariables

    The variables created for the GetBinInformation listener map are listed.
  17. For this example, select CurrentBinLevel.
    The variable name is added to the Variable box.



The values written to the listener map output variables will become the contents of the Listener Reply message sent back to the enterprise system upon completion of the listener trigger.
The trigger is completed.

  1. Click Validate.
  2. A message will say whether or not the validation was successful. Click OK.
  3. If no errors are received, click Save.

The name of the trigger is added to the project tab.

You must start the trigger and also start the listener associated with the trigger.