Types of Activities
- UML notation for Do-activity denoted as “do/” for all or part of duration that an object is in a state.
- It can only occur within a state and can’t attach to a transition.
- Do-activity may be interrupted by an event that received during its execution.
- Such event may or may not cause a transition out of the state containing the do-activity.
Entry and Exit Activities
- We can also bind activities to entry or to exit from a state as an alternative to show the activity on transition.
- There is no difference between binding an activity to a transition or to a state.
- Activity which more concise to attach the activity of a state should specify inside the state.
- When the state entered by an incoming transition, entry activity performed.
- Also, An entry activity equivalent to attaching the activity to every incoming transition.
- If incoming transition already has an activity, it performed first.
- Moreover, Exit activity less common compared entry activities and occasionally useful.
- Whenever the state is exited, by any outgoing transition, the exit activity performed first.
This diagram shows the states of door controller. A user generates depress event with a pushbutton to open and close the door. Each event reverses the direction of the door. For safety, the door must open fully before it can close. Motor Up and Motor Down are activities which generate the control.