09.08.2013 Views

Architecture Modeling - SPES 2020

Architecture Modeling - SPES 2020

Architecture Modeling - SPES 2020

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sequences of Events<br />

It is typical to specify the order of the occurrences of different events. To do so, there are two<br />

language constructs:<br />

and<br />

Event and then Event<br />

N times Event<br />

<strong>Architecture</strong> <strong>Modeling</strong><br />

Sequences with “and then”<br />

The “and then” construct postulates a sequence of events. The following example demonstrates the<br />

use of the pattern.<br />

Requirement: When a crash was detected, first the airbag shall inflate and then the doors<br />

shall be unlocked.<br />

whenever CrashDetected occurs InflateAirbag and then UnlockDoors<br />

occurs.<br />

This pattern does not say anything about timing, it just specifies the order. To express timing<br />

behaviour it is possible to use intervals with the events. E.g. if the door shall be unlocked in<br />

at least 50 ms after the airbag inflated the pattern would look like this:<br />

whenever CrashDetected occurs ReCheckSensors and then InflateAirbag<br />

and then UnlockDoors during [0ms,50ms] and then EngineOff during<br />

[0ms,300ms] occurs.<br />

The “during” with timing entities differs semantically from the filter that can be used to constrain<br />

events. If “during” with timing entities is used in an “and then” statement the interval is demanding, i.e.<br />

that the event has to occur in the specified interval. The timer starts with the occurrence of the<br />

preceding event. If the event does not occur in the specified interval the “and then” statement<br />

continues its execution from the latest previous event in the chain, that was not constraint by timing<br />

properties. The clock for the interval with the timing constraints is restarted by this event. This means<br />

for the above example that a failing of the EngineOff events 300ms after the unlocking of the doors,<br />

the observer would wait for a new InflateAirbag message, since this event has no timing constraints to<br />

the preceding event.<br />

In contrast to timing intervals the use of events in the intervals is semantically identical to the filter<br />

described in section 0.<br />

This backtracking behaviour can be further specified by the use of brackets.<br />

whenever a occurs b and then (c and then d and then e during<br />

[0ms,7ms]) occurs.<br />

If e does not occur in the specified interval the observer would wait for a new c instead of a<br />

new d.<br />

114/ 156

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!