Consist check disable ???

jswager111

New member
Is there a way to disable a rule after it has been used? What I mean is something like --- pick up 4 cars (rule triggers) drop them off somewhere then later pick them up again. Here the rule would trigger again.
 
There is a Rule Disable option in the rule.

I have not tested this but try placing another copy of the rule immediately underneath the Consist Check rule as a child rule with the Rule Disable option selected. My suspicion is that the second copy, with the disable option selected, will cancel out any further triggering of the parent rule. Just a theory.
 
Tried this but it doesn't work. I guess its not the rule to use in this situation. I found that using a trigger to "prime" it and then using the "Wait for couple" as a child of the trigger works for what I wanted.
 
One thing that I have used in a similar situation with another rule is a variable that is used as a "flag" or "counter" to decide if the rule, when triggered, should be ignored or not. For your situation I would use something like this.

Somewhere at the top of the Session Rules list.
PHP:
Variable Modify Rule: set variable Flag to 0
... to initialise the variable Flag

Further down the Session Rules List when the Consist Check rule is needed
PHP:
Consist Check Rule: set to trigger when a matching consist is created. This executes the following child rules
      Variable Modify Rule: add 1 to variable Flag
      Variable Check Rule: Check if variable Flag = 1. If Flag=1 then execute the following child rules
              <perform other tasks for a matched consist found>

This would execute the consist check sequence only once.
 
Back
Top