Information Technology Reference
In-Depth Information
do
1
( (transition Armed to Alarm;
2
call AlarmArmed SetOff ;
3
call OpticalAlarm SetOn;
4
call AcousticAlarm SetOn )
5
[ ] transition OpenAndLocked to ClosedAndLocked
6
[]
/
.. other transitions ..
/
7
) //
dequeue()
8
od
9
As can be seen, entry and exit actions, e.g., call AlarmArmed SetOff ,arese-
quentially composed with the transition action. Transition effects, if present,
are treated in the same manner. Dequeuing of the event is done in the dequeue
action by removing the head-element of the event-list. The dequeue action is
enabled only if there is no enabled transition left. This allows modeling of events
triggering multiple transitions as well as events that enable no transition, as re-
quired by the standard (cf. [1], State Machine, p.566 ). We discuss the handling
of multiple transitions for one event in detail in Subsection 4.3.
Calls and Signals. After an object has received a signal or a method of the object
was called, the corresponding events are added to the object's event queue.
(Currently, there is no support for handling synchronous method calls.) We
represent these events in the OOAS as data-tuples, hence the event queue is
a list of tuples, and is initially empty.
types
1
t eventname AlarmSystem =
received AlarmSystem Close ,
received AlarmSystem Lock ,
{
2
. . .
}
;
/
enumeration
/
t event AlarmSystem = (t eventname AlarmSystem)
/
tuple
/
3
var
4
/
object event queue
/
5
events :
list [7] of t event AlarmSystem = [ nil ]
6
7
8
methods
/
add a lock event to queue
/
9
rcv Lock =
10
events := events ˆ [ t event AlarmSystem(
received AlarmSystem Lock) ]
11
end ;
12
If there are call parameters and signal properties, the event-type has to be
extended to provide place for the event name itself and all parameters. In the ex-
ample above, there are no properties or parameters, hence t event Alarmsystem
is a 1-tuple.
According to the UML standard, signal transmission might be lossy, out of or-
der, or even allow duplication of signals. As a practical example we may consider
a distributed embedded system using the CAN bus: there, message transmission
is based on priorities. If we want to model this kind of behavior, we need to ex-
plicitly represent it in the UML-model as our transformation guarantees in-order
message processing.
4.3 Object Concurrency and Regions
There are two different sources of concurrency in UML models. One source are
active classes, the other one are orthogonal regions in state machines. Since the
 
Search WWH ::




Custom Search