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.
- Start the project, the calling trigger, and the
subtrigger.
All three items must be in the Started state. - Select the calling trigger, then right click the
trigger to display its pop-up menu, and then click
Fire Trigger.
- 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.
- Check that the trigger executed successfully and
caused the subtrigger to execute. Both should have
their Successes count increased by
one.
- 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. - Click on the Exceptions Log tab or
icon.
- 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.
- We will modify the trigger to enable trigger
reporting. Edit the recently created trigger.
- In the Trigger Editor, go to the
Settings tab and set
Reporting to
On.
- Select Save to save the updated
trigger definition.
- Right click the trigger to display its pop-up menu,
and then select Fire Trigger.
- From Workbench left pane, select the Logs
& Reports icon.
The Logs & Reports tab appears. - Select on the Reports tab or icon.
The trigger report appears. Use this information to
debug any issues.
- 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.
- 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.