Skip to content
Astera Technology

Distinguish entering a state from remaining in it

Write an event trigger using both old and new state.

Compare the rule with concrete cases

Original fictional counter increases once when ready changes from false to true. Editing a title while ready stays true does not increase it. “Whenever ready is true” would instead trigger on unrelated edits. Record old and new state separately in each case.

Filled synthetic modelling cases
Old readyNew readyCounter changeReason
FalseTrue+1Entered ready
TrueTrue0Remained ready
TrueFalse0Left ready
Download editable CSV ↓

Work through the distinction

A state condition describes a level; an entry trigger describes a transition. Include old state in the acceptance cases so repeated edits cannot masquerade as repeated entries.

Counter is three. A title edit leaves ready true. What is the counter afterward?

Show the worked answer

Three. There was no false-to-true transition.

Acceptance wording to adapt

Increase activation_count by one only for old_ready=false and new_ready=true. Preserve it for false→false, true→true and true→false. Other edited fields must not trigger an increase.

Related resources