IDE & Navigation
Properties & Tools
Triggers are the events fired/executed at certain point in the model execution. You can attach MScript or java method to each trigger. When the trigger fires, the MScript or java method attached will be executed.
Triggers can be used to format and output test cases to files or used to drive AUT for test automation or both.
Understanding when triggers are fired can help you determine which trigger your automation script (MScript or java method) should be attached to.
Some triggers are fired at the beginning of the model execution, some are fired at the specific state or transition and some are generic triggers fired for any state/transition. Below you will find more information about these triggers. They are listed in the order relevant to the order in which they are fired:
Triggers are executed in the predefined order as the states and transitions are traversed by the sequencers.
MBT Start trigger is executed at the beginning of each model execution and is only executed once per model execution.
MBT End trigger is executed at the end of the each model execution and is only executed once per model execution.
State and transition triggers are executed between MBT Start and MBT End as the states and transitions are traversed.
When state is traversed, the following state triggers are executed in order:
Upon state is traversed, a transition is chosen to be traversed. The transition triggers are exeuted in the following order:
Guard trigger is executed for all transitions leaving the state to evaluate which transition is feasible before choosing a transition. Once the transition is chosen, the transition triggers of the chosen transition are then executed in the order described above.
You may also define OnException and OnError triggers to handle test failures (Exceptions) and runtime errors (coding error).