Task Cancelation Policy Behavior with Multiple Triggers

wait
triggers
piston

#1

1) Give a description of the problem
Wait scheduled action get canceled when a different trigger than the one that initiated it changes

2) What is the expected behaviour?
Wait scheduled action only get canceled when the trigger that initiated changes

3) What is happening/not happening?
See above. I can update TCP to never cancelled but the wait scheduled task never get canceled even when the trigger that initiate it changes.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
Expected behavior when Test Switch triggers and doesn’t changes:

Expected behavior when Test Switch triggers then change (scheduled wait run get canceled):

Unexpected behavior when Test Switch 2 triggers (scheduled wait run get canceled):


#2

My understanding, which may be wrong, is that waking up a piston cancels any outstanding tasks, not just the tasks related to the event which triggered the piston.
In general, having multiple triggers in one piston can get quite complicated and should probably only be used in relatively simple pistons.
I’ve got round this problem in some pistons by recording the time an event occurred, then when the piston wakes again, checking the time and taking the appropriate action. It can get very complex though, and sometimes needs a timed trigger to wake say every 60 secs - not ideal.


#3

Agree. I found a workaround by setting TCP to never for both timers, and checking just after the timer that the condition that initially trigger the timer was still true before inviting the action. It works but seems a bit clunky.