General
It is a curious fact that none of the four main diagram types (DBD, ERD, STD and PFD) used for code generation actually show events.
Usually, events travel between object state machines that lie in the same domain. Such an event is generated in a state action and consumed by a state transition. However, some events may originate from outside the domain or alternatively be sent out across the domain boundary.
The state event transition notation uses directed lines to show actual events. Transitions, labelled with event names shown on State Transition Diagrams (STD) should not be confused with the actual events.
Pathways defined by relationships shown on the Entity Relationship Diagram (ERD) constrain the sending of events to certain entities since the target object must be navigated to before event generation can take place.
The Windows Wix Installer model demonstrates the notation and event pathways in use .
Single and Many Events
An event produced by a state may be a Single or Many. Whether an event is Single or Many depends on the context in which it is generated. An event is called a Single event because it is directed at a single object and can only be directed at a single object. Many events are directed at multiple objects. They are sent when a sending GenerateEvent statement lies in a Many context and is not constrained to send one event. All Many events are sent to objects that belong to the same entity.
On entering a state the context is always Single. An event sent from a Single context will, of course, be Single. If after a Traverse navigation across a Many relationship the context becomes a Many context then the event may still be Single or Many. The event may be Single because the sending GenerateEvent statement lies within a Many context that has been constrained by for example, a SelectionHead statement.
Conditional and Unconditional Events
An event may also be considered Conditional or Unconditional. A Conditional event may or may not be produced by the state. An Unconditional event is always produced by the state.
Whether an event is Conditional or Unconditional depends on the relationship that has been navigated to reach the destination object. If any relationship in the navigation is Conditional then the event must be Conditional. If all relationships in the navigation are Unconditional then the event can be Conditional or Unconditional. The event may still be Conditional because the sending GenerateEvent statement lies within a context that has been constrained by for example, a CaseSelection statement.
Event Representation
A Single event is represented by a directed line with a single arrowhead. Many events are represented by a directed line with a double arrowhead. A Conditional event is represented by a line with a dash near the arrowhead while an Unconditional event is left as is.
All events are labelled with the name of the event except for the self-directed event which has no label. Events are labelled because there may be some distance between the sending state and the destination transition. Indeed, the source state and target transition may even be on different diagrams.
Lines and text of different colours are used to represent the different types of events:
- Inter State Machine Events
- Incoming Domain Boundary Crossing Events
- Outgoing Domain Boundary Crossing Events
Inter State Machine Event - Single Unconditional
Event travels between two object state machines that belong to different entities in the same domain.
Inter State Machine Event - Single Conditional
Event travels between two object state machines that belong to different entities. Event may or may not be generated by sending state.
Inter State Machine Event - Many Unconditional
Event produced in a Many context that travels from one object state machine to many other object state machines that all belong to the same entity.
Inter State Machine Event - Many Conditional
Event produced in a Many context that travels from one object state machine to many other object state machines that all belong to the same entity. Event may or may not be generated by sending state.
Incoming Domain Boundary Crossing Event
An incoming event that crosses the domain boundary. Can originate from another domain across a bridge or from the environment. Only the event name must placed on the event line.
Outgoing Domain Boundary Crossing Event - Single Unconditional
Outgoing event that crosses domain boundary. A single event is always generated by sending state.
Outgoing Domain Boundary Crossing Event - Single Conditional
Outgoing event that crosses domain boundary. A single event may or may not be generated by sending state.
Outgoing Domain Boundary Crossing Event - Many Unconditional
Outgoing event that crosses domain boundary. One of more events are always generated by sending state.
Outgoing Domain Boundry Crossing Event - Many Conditional
Outgoming event that crosses domain boundary. One of more events may or may not be generated by sending state.
Self Directed Event - Single Unconditional
An event that is generate by a state for the purpose of moving the same state machine on to the next state. Unlabelled due to the close proximity of the generating state and the destination transition.
Self Directed Event - Single Conditional
An event that is generate by a state for the purpose of moving the same state machine on to the next state. Unlabelled due to the close proximity of the generating state and the destination transition. Event may or may not be generated by sending state.
Intra Entity Event - Single Unconditional
Event sent by an object state machine to another object state machine (not itself) where both state machines belong to the same entity.
Intra Entity Event - Single Conditional
Event sent by an object state machine to another object state machine (not itself) where both state machines belong to the same entity. Event may or may not be generated by sending state.
Intra Entity Event - Many Unconditional
Event sent by an object state machine to other object state machines (but not itself) where all state machines belong to the same entity. Indicates model has a recursive nature.
Intra Entity Event - Many Conditional
Event sent by an object state machine to other object state machines (but not itself) where all state machines belong to the same entity. Indicates a recursive nature. Event may or may not be generated by sending state.
|