17. Event Package
The Event package defines a set of meta-model elements whose purpose is to represent high-level behavior of applications, in particular event-driven state transitions. Elements of the KDM Event package represent states, transitions and event. States can be concrete, for example, the ones which are explicitly supported by some state-machine based runtime framework or a high level programming language, such as CHILL. On the other hand, KDM Event model can represent abstract states, for example, states which are associated with a particular algorithm, resource or a user interface.
Organization of the Event Package
The Event package consists of the following 6 class diagrams:
The Event package depends on the following packages:
EventModel Class Diagram
The EventModel class diagram follows a uniform pattern for KDM models to extend the KDM framework with specific meta-model element related to event-driven state transition behavior.
The class diagram shown in See – EventModel Class Diagram. captures these classes and their relations.
– EventModel Class Diagram
EventModel Class
The EventModel is a specific KDM model that represents entities and relations describing events and responses to events in an enterprise application.
eventElement:AbstractEventElement[0..*] | event elements owned by the given event model |
EventModel is a container for instances of event elements. It is the implementer’s responsibility to arrange event elements into one or more event models.
AbstractEventElement Class (abstract)
The AbstractEventElement is an abstract superclass for various event elements.
Implementation AbstractCodeElement should be owned by some CodeModel
Implementation AbstractCodeElement should be subclass of ComputationalObject or ActionElement
abstraction ActionElement should be owned by the same EventModel
Implementation AbstractCodeElement are the one or mode ComputationalObject or ActionElement that are represented by the current EventElement. “Abstraction” actions can be used to represent precise semantics of the EventElement.
AbstractEventRelationship Class (abstract)
The AbstractEventRelationship is the superclass of associations of the event model. This is an abstract meta-model element for representing various relations involving states and events.
EventInheritances Class Diagram
The EventInheritances class diagram defines how classes of the Event package inherit core meta-model classes from KDM Core package. The classes and associations that make up the EventInheritances diagram are shown in See – EventInheritances Class Diagram..
– EventInheritances Class Diagram
EventResources Class Diagram
The EventResources class diagram defines specific event elements. The class diagram shown in See – EventResourcesClass Diagram. captures these classes and their relations.
– EventResourcesClass Diagram
EventResource Class (generic)
The EventResource is the generic AbstractEventElement that can be instantiated in KDM instances.
eventElement:AbstractEventElement[0..*] | Event elements owned by this EventResource |
Event Class
The Event is the generic AbstractEventElement that can be instantiated in KDM instances.
kind:String | represents the nature of this Event |
State class
The State class represents a state associated with certain behavior. This can be a concrete state, for example, supported by a state-machine runtime framework. This can also be an abstract state associated with some process, algorithm, component, or resource, discovered during the analysis of the software system. An example of an abstract state is the step of the protocol that involves a messaging resource. An abstract state may not have any direct and tangible manifestation in the artifacts of the software system. On the other hand, a concrete state may be implemented in a tangible way, for example, using a variable or as a class provided by the application framework. States can be nested.
InitialState class
The InitialState class is a subclass of the State class. It represents a default initial state.
Transition class
The Transition class represents a transition that is performed when a certain event is consumed is a certain state. Transition element should be owned by some state element. Transition can be associated with the corresponding Event by using the “ConsumesEvent” resource relation. A transition element can also own some Event elements. Transition does not have an “implementation” group. Instead, it is considered as some sort of a trigger. The association between the transition and corresponding behavior is achieved through the “abstraction” action container of the transition. Usually, this is a Calls action relation. For more complex situations, the “CodeGroup” capability of the “abstraction” action element can be used.
OnEntry class
The OnEntry class represents specific transitions that are configured to be performed by the runtime framework when a certain state has been entered.
OnExit class
The OnExit class represents specific transitions that are configured to be performed by the runtime framework when a certain state has been exited.
EventAction class
EventAction class follow the pattern of a “resource action” class, specific to the event package. The nature of the action represented by a particular element is designated by its “kind” attribute. Descriptions of the common platform action kind are provided in Appendix 2. Resource Layer actions.
kind:String | represents the nature of the action performed by this element |
eventElement:Event[0..*] | the set of Event elements that owned by the current EventAction element |
EventRelations Class Diagram
EventRelations diagram defines meta-model relationship elements which represent several structural properties of event-driven systems. The class diagram shown in See – EventRelations Class Diagram. captures these classes and their relations.
– EventRelations Class Diagram
NextState class
The NextState class represents the knowledge that upon completion of the behavior associated with a certain transition element, the corresponding behavior will enter the given state. For example, in statically configured state-machine based frameworks this information can be derived from the initialization of framework specific data structures. When there exists several NextState relations originating from a given transition, this means that an unspecified choice is made by the behavior associated with the transition. More precise “abstraction” can be provided by using the “abstraction” action containers associated with various elements involved.
to:Transition[1] | the transition |
from:State[1] | the state |
ConsumesEvent class
The ConsumesEvent class represents the knowledge that a certain transition element, is associated with a certain event. For example, in statically configured state-machine based frameworks this information can be derived from the initialization of framework specific data structures.
from:Transition[1] | the transition |
to:Event[1] | the event |
EventActions Class Diagram
The EventActions class diagram defines basic KDM relations between The class diagram shown in See – EventRelations Class Diagram. captures these classes and their relations.
– EventActions Class Diagram
ReadsState class
ReadsState class follows the pattern of a “resource action relationship”. It represents various types of accesses to the state-based runtime framework that provides a concrete implementation of states, where access is made to a particular state (for example, accessing the current state, setting the next state). ReadsState relationship is similar to Addresses relationship from Action Package. The nature of the operation on the resource is represented by the “kind” attribute of the EventAction that owns this relationship through the “abstracted” action container property.
Action::AbstractActionRelationship
from:ActionElement[1] | “abstracted” action owned by some resource |
to:EventResource[1] | the event resource being accessed |
This relationship should not be used in Code models
The to endpoint of the relationship should be State of one of its subclasses
ProducesEvent class
ProducesEvent class follows the pattern of a “resource action relationship”. It represents various types of accesses to the state-based runtime framework where the application produces the event. ProducesEvent relationship is similar to Writes relationship from Action Package. The nature of the operation on the resource is represented by the “kind” attribute of the EventAction that owns this relationship through the “abstracted” action container property.
Action::AbstractActionRelationship
from:ActionElement[1] | “abstracted” action owned by some resource |
to:EventResource[1] | the event resource being produced |
This relationship should not be used in Code models
The “to” endpoint of the relationship should be Event
HasState class
HasState class follows the pattern of a “resource action relationship”. HasState is a structural relationship. It does not represent resource manipulations. HasState relationship uses the “abstracted” action container mechanism to provide certain capabilities to other Resource Layer packages. “HasState” relationship makes it possible to associate an element of an event model with any resource.
Action::AbstractActionRelationship
from:ActionElement[1] | “abstracted” action owned by some resource |
to:EventResource[1] | the event resource being accessed |
This relationship should not be used in Code models
ExtenededEventElements Class Diagram
The ExtendedEventElements class diagram defines two “wildcard” generic elements for the event model as determined by the KDM model pattern: a generic event entity and a generic event relationship.
The classes and associations of the ExtendedEventElements diagram are shown in See – ExtendedEventElements Class Diagram.
– ExtendedEventElements Class Diagram
EventElement Class (generic)
The EventElement class is a generic meta-model element that can be used to define new “virtual” meta-model elements through the KDM light-weight extension mechanism
EventElement should have at least one stereotype
An event entity with under specified semantics. It is a concrete class that can be used as the base element of a new “virtual” meta-model entity types of the event model. This is one of the KDM extension points which can integrate additional language-specific, application-specific or implementer-specific pieces of knowledge into the standard KDM representation.
EventRelationship Class (generic)
The EventRelationship class is a generic meta-model element that can be used to define new “virtual” meta-model elements through the KDM light-weight extension mechanism
from:AbstractEventElement[1] | The event element origin endpoint of the relationship |
to:KDMEntity[1] | the target of the relationship |
EventRelationship should have at least one stereotype
An event relationship with under specified semantics. It is a concrete class that can be used as the base element of a new “virtual” meta-model relationship types of the event model. This is one of the KDM extension points which can integrate additional language-specific, application-specific or implementer-specific pieces of knowledge into the standard KDM representation.