You can specify Guard conditions on Transitions using any action language. Open the SmallTestSamples.mdzip to see an example of how to specify Guards on Transitions. 

You can use the properties of a context Classifier (the Classifier that is the context of a State Machine diagram) in Guard expressions as variable names. The real values of the variables will be resolved at runtime. In the example in SmallTestSamples.mdzip, the values come from the slots of the instance of the context Classifier (see the Instance diagram in the sample project). 


Test_guard Example
The Test_guard diagram sample.

During the simulation, any Guard that is not Boolean expression evaluation (the state 2 or state 3 body of the Guard in this case) will show the Question dialog box displaying the body of the Guard as shown in the figure below. You can click Yes to set the evaluation result true with the Transition according to the Path or No to set the evaluation result false without the Transition.

The Question dialog box appears for any Guard not Boolean expression evaluation during the simulation.

Note

If you use a Choice with Transitions, the name of the Choice will be also shown in the Question dialog box with the body of the Guard.