I thought I could differentiate between event and guard. But I came across an event being similar to guard:
counter > 4 [pin is high] / switch on
^^^^^^^^^^^
event
where I viewed the variable counter changes from some value smaller than 4 to that greater than 4 as event. Does that mean event can also be a condition like guard?
An event is the thing that triggers the transition. In your case
counter > 4is a change event, meaning "the counter value has changed and its value is now greater than 4".The code between the brackets is the guard. In your case
pin is high, meaning "the transition is only enabled if the pin is high".switch onis the behavior that is executed when the transition is executed.Footnote: In your example the event is indeed very similar to the guard.
In C it could look like that:
From the UML 2.5 specification:
In other words:
trigger [guard] / behavior