In this exercise we show how to introduce environment controls into the model to provide more meaningful simulations. The goal of adding environment controls is to make the model deterministic. When we do this, we do not use the Path Selection dialog. Instead, we explicitly tell the model what to do by sending signals from the environment.
All source MSC PR files, Telelogic Tau diagrams, and the synthesized SDL model can be found in the following directory:
<KLOCwork MSC to SDL installation directory>/doc/examples/InfoServer_step3
As we observed before, the InfoServer model is non-deterministic because the input scenarios do not contain information about the decision made between the Request and Done messages done by the User actor. The KLOCwork MSC to SDL Synthesizer propagates the non-deterministic choice into the synthesized SDL model.
Note, that the signal from the environment and the timeout signals arrive in the so-called MSC coregion (see the first two of the figures that follow). We use the coregion symbol to emphasize that the timeout (introduced in order to fix the failure problem) and the environment control (introduced in order to provide more control over the execution of the model) are independent.
The Telelogic Validator handled the non-determinism gracefully. It produces MSC traces for various combinations of actions by the User process. However, the manual exploration of the behavior of the Server mode through the Simulator UI used the Path Selection dialog. With the insertion of the environment controls, the model becomes deterministic. The logic of selecting between Request and Done signals now resides with the environment. The model only reacts to the incoming signals. By sending these signals, we control the behavior of the model.
Simulation performs more events and then stops.
Observe that the Simulator is waiting for the events from the environment. Note, however, that the Simulator is using the event-driven simulation. The timeout from the timer T occurred immediately after the timer was set. In the event-driven simulation this happens because the timeout is always the next scheduled event. This prevents us from exploring the failure behavior in which we need to inject the fail signal before the timeout.
In this exercise, we showed how to introduce environment controls into the model to provide more meaningful simulations.
In the next exercise we will demonstrate how to run the a real-time simulation in which the events will be handled in exactly the same order as they occur. As the result, timeouts will be delayed for the exactly the amount of time for which the timer was set.