If a state has multiple activities, they performed in following order:
1: Activities on incoming transition
2: Entry Activities
4: Exit Activities
5: Activities on outgoing transition
- If a Do-Activity interrupted by the transition out of the state, the exit activity is still performed.
- Therefore any event can occur within a state can cause a Multiple Activities to perform.
- The main purpose of the state is to perform the sequential Multiple Activities.
- When an activity completed, transition fires to another state.
- An arrow without an event name indicates an automatic transition that fires when activity associated with the source state completed.
- Such unlabeled transition known as Completion Transition.
- Stuck Condition: Guard condition tested only once when an event occurs. If a state has one or more completion transition, but none of the guard conditions satisfied, then the state remains active and may become “stuck”.
- The completion event does not occur the second time, therefore no completion transition will fire later to change the state.
- If the state has completion transition leaving it, normally the guard condition should cover every possible outcome.
- We can use some special condition such as else to apply if all other condition is false.
- The better approach is not to use guard condition on a completion transition, instead change event should be used.
- The object can perform the activity by sending signal and system of objects interacts by exchanging signals.
- The activity “send target.S (attributes)” send signal S with given attributes to the target object or objects.
- E.g. phone line sends connect (phone number) signal to the switcher when the complete number has dialed.
- A signal can direct at a set of object or the single object.
- If the target is set of objects, each of them receives a separate copy of signal and each of them independently processes the signal.
- If an object can receive signals from more than one object, the order in which concurrent signals received may affect the final state. This known as race condition.