Next: , Up: Why use external?   [Contents]


4.1.1 What can go wrong?

For the example in this section, a snapshot containing Dezyne models and C++ source code is available on https://github.com/VerumSoftwareTools/DezyneTutorial/tree/master/External/Ch1_Alarm_System.

Consider the following situation:

images/sequence_2

In the above sequence diagram, a valid password has been entered on the IController interface. This resulted in the Controller moving to the Armed state, turning on the Sensor as well.

images/watch_1

At this point the Sensor was triggered, resulting in the starting of the Timer as well as the Controller transitioning to the Alarming state. The corresponding Watch window with this sequence of events is included and it confirms that the Controller is in the Alarming state and that the Timer is Running.

Say we were to perform another passwordEntered event, with a valid password. The following sequence will occur:

images/sequence_3 images/watch_2

So far so good, right? The Dezyne model encounters no illegal behavior and the Watch window tells us that the Controller has moved back to the Armed state, ITimer is Idle again and the Sensor is Sensing.

An important remark to make at this point is that the passwordEntered event from iController led to a series of events that took an arbitrary amount of time, x. This is important to keep in mind for the next paragraph.