Task state-related scripts
- Last UpdatedDec 04, 2023
- 1 minute read
Sometimes, you might need to use the status change of a task (running, success, or fail) to trigger some behavior.
Technique
The best way to perform this is to use a conditional route.
Use this route to set a single-node field or variable, or more commonly to start a command.
Code example
This is an example of a script to trigger an alarm.
<route from="tm_0.t6_state" to="raiseAlarms.execute" condition="@tm_0.t6_state@==success"/>
<command name="raiseAlarms">
<setfield field="PAHH52030.value" value="1"/>
<setfield field="LAL52022.value" value="1"/>
<setfield field="PDAH52128.value" value="1"/>
</command>