Step 3 - Starting and executing the calling trigger

You will now start and execute the calling trigger. The calling trigger uses the Execute Lua Script action to execute the Lua script, which in turn calls the subtrigger.

  1. Start the project, the calling trigger, and the subtrigger.
    All three items must be in the Started state.

  2. Select the calling trigger, then right click the trigger to display its pop-up menu, and then click Fire Trigger.

  3. The calling trigger will execute , or "fire", and will execute its Execute Lua Script action, which in turn will call the subtrigger.

Checking the results

Check the calling trigger and the subtrigger for their execution statistics and behavior.

  1. Check that the trigger executed successfully and caused  the subtrigger to execute. Both should have their Successes count increased by one.

  2. Since the subtrigger's logic added a message to the Exceptions Log, check the log.
    From Workbench left pane, click the Logs & Reports icon.
    The Logs & Reports tab appears.
  3. Click on the Exceptions Log tab or icon.

  4. Check that a new entry has been logged in the Exceptions Log.
    This shows that the calling trigger executed its action, the Execute Lua Scrip action.
    The Lua script executed, or "called", the subtrigger.
    And the subtrigger executed its action, adding a log message to the Exceptions Log file.

Viewing the trigger report

You can use the trigger reporting feature to see more details of the execution path between the Lua script and subtrigger.
You can also use trigger reporting feature if the trigger did not execute successfully to debug where the error may be.

  1. We will modify the trigger to enable trigger reporting. Edit the recently created trigger.

  2. In the Trigger Editor, go to the Settings tab and set Reporting to On.

  3. Select Save to save the updated trigger definition.
  4. Right click the trigger to display its pop-up menu, and then select Fire Trigger.

  5. From Workbench left pane, select the Logs & Reports icon.
    The Logs & Reports tab appears.
  6. Select on the Reports tab or icon. The trigger report appears. Use this information to debug any issues.

  7. For the subtrigger, you can repeat the same steps to modify the subtrigger to enable reporting. You will be able to see how the subtrigger executes.

  8. Remember to turn reporting off after you have finished developing and debugging a trigger.
    The trigger reporting feature takes system resources, and use during regular execution may degrade performance.