Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
triggers [2016/09/22 02:36] 127.0.0.1 external edit |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Model Triggers ===== | ||
- | |||
- | Triggers are the events fired/ | ||
- | |||
- | // | ||
- | |||
- | ---- | ||
- | ==== Triggers ==== | ||
- | |||
- | Understanding when // | ||
- | |||
- | 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/ | ||
- | |||
- | * MBT_start - start of model execution. | ||
- | * //On Entry// - upon entry to the state | ||
- | * // | ||
- | * //On Exit// - on exiting state, usually used to perform some cleanup or updating database, etc. | ||
- | * //Guard// - transition guard trigger, used to define transition constraints | ||
- | * //Prep// - prepare transition, usually used to set values to fields, select options for the lists, etc. | ||
- | for all transitions but needs to be done each time the transition is traversed. | ||
- | * //Action// - transition action trigger, usually used to click on a button or link that caused the state to change. | ||
- | * //Verify// - transition verify trigger, usually used to check fields on the page to confirm the action was performed correctly. | ||
- | * //MBT_end// - executed at the end of model execution to perform teardown/ | ||
- | * // | ||
- | * //OnError// - executed on any runtime error which stops the execution. | ||
- | * [[user_defined_functions | User Defined Function]] - user defined functions can be called from mscript using $callFunc(' | ||
- | |||
- | ---- | ||
- | ==== Execution Order ==== | ||
- | |||
- | // | ||
- | |||
- | //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: | ||
- | |||
- | * //On Entry// | ||
- | * //Proess// | ||
- | * //On Exit// | ||
- | |||
- | Upon state is traversed, a transition is chosen to be traversed. | ||
- | |||
- | * //Guard// | ||
- | * //Prep// | ||
- | * //Action// | ||
- | * //Verify// | ||
- | |||
- | //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 // | ||
- | |||
- | |||