Start an Action Chain When a Variable Changes

You can start an action chain when the value stored in a variable changes by adding an onValueChanged event to the variable.

When you use an onValueChanged event to trigger an action chain, the trigger has the payload of the variable's old and new values. For example, let's say you changed the name property of an Employee and then reset the Employee; the framework will send an event that the Employee changed, and as part of the payload indicate that the name has changed.

To start an action chain when the value of a variable changes:

  1. Open the Variables tab of an artifact.
  2. Select the variable in the list, then open the Events tab in the Properties pane.
  3. Click + Event Listener in the Events tab.
  4. Select an action chain from the list. Click Select.

    When you add the event to the variable, a variable event listener that listens for the onValueChanged event on the variable is automatically created. The variable's Events tab in the Properties pane displays the action chain the event listener will trigger; you can change or remove the action chain, assign input parameters, and add more action chains.
    Description of event-listener-variable.png follows
    Description of the illustration event-listener-variable.png

    Note:

    Variable events and event listeners are not listed in an artifact's Events or Event Listeners tabs.