Rule Machine Evaluation/Execution Enhanced Documentation

I would love to see added to the documentation a diagram that depicts the timeline of evaluation and execution of a rule, trigger, etc. It would enhance our ability to build rules most effectively but also expedite troubleshooting. I do see in the wiki at the bottom in an "appendix" a list of execution but since some of this is parallelized and some depend on others a graphic would be much more useful.

Would this be possible? Perhaps in a timeline or tree style layout?

There is much less to this than you might think:

The order is super simple:

  • For a rule: condition event occurs, rule is evaluated left to right, action is taken if rule-truth changed, either true actions or false actions as appropriate.
  • For a trigger: trigger event occurs, action is taken.
  • For a triggered rule: trigger event occurs, rule is evaluated left to right, action is taken for true or false as appropriate.

The order of actions you reference in the wiki simply gives the order in which the actions of a single rule would happen when there are multiple actions. This is usually not relevant as most rules have only one or two actions, and generally their relative order is unimportant. However, there are a couple of subtle ordering issues: capture is done prior to anything that changes devices that might be captured, and restore is done after. Private Booleans are set before other actions on other rules.

Except for order of actions, all of this is explained in the Rule Machine introduction.