Statements
GenerateEvent
GenerateDataEvent
Overview
Sending events is similar to shouting in a crowded room. Although we may think we are sending an event to a specific entity object, this is misleading on a conceptual level. When an object sends an event it is actually more of a broadcast to any object that is listening out for it.
However, in practice this would mean all event names in a domain would have to be unique instead of just unique within an entity. Since the target is always known by the analyst, it is convenient and practical to name the destination entity.
Matrix does not allow object references (signifiers) to be specified in attribute data, state data, process data, object data or carried on events as event data.
A non-creation event is directed to particular single object. The identity of the target object is not specified by the analyst but provided implicitly by the current context.
The purpose of a creation event is to create an object. They are not directed at an object but the entity as a whole. Creation events are unique as each one is only used to enter a single creation state. The creation event cannot be used to transition to any other state as they do not have the context provided identity that all non-creation events have.
GenerateEvent Statement
GenerateEvent
Ping : Fire
Pong : Wait
This statement is used to send an event from one object to another. The event is sent to the object referred to in the entity context.
There is no dataset associated with this type of generate event.
This statement may be used to send individual events to several objects.
GenerateDataEvent Statement
GenerateDataEvent:Ping:Fire
Start_value : <<IntegerOne>>
Lower_limit : <<FixedZero>>
Count : Count_variable
Free_day : Weekday'MONDAY
Limit : Ping_Spec.Limit
Index : Integer_Type'Adjustment
This statement sends a single data carrying event from one object to another. Each data carrying event requires a separate GenerateDataEvent statement.
The name of the statement is followed by a target entity name and an event name. In the data subregion, the first field corresponds to a destination state's dataset data name. In other words, the names listed match the event's destination state dataset list.
The second field is an entity attribute, state data or process data item specifying data item values.
GenerateDataEvent Example
A dataset is defined for one or more states. It lists and names the state data accepted by the states and specifies their types.
Entity:Customer
...
State
Dataset:Details
Name : Full_name
Location : Address
Money : Amount
Typically, a data carrying event is generated in some other entity in the same domain or it can be sent by way of a bridge from another domain.
StateAction
GenerateDataEvent:Customer:Customer_joins
Full_name : Customer_name
Address : Applicant_address
Amount : Initial_payment
The event data names in the GenerateDataEvent statement must match the state data names in the Dataset statement.
|