14. Composition of the commands model program in Figure 14.12 with the FSM in Figure 14.13.
Labels on states show the value of cmd.
Inactive
Activating
ReqSetup()
Active
ReqWork()
ResWork()
ResSetup(_, _, STATUS("Cancelled"))
ResSetup(_, _, STATUS("Completed"))
FSM("Inactive", AcceptingStates("Active"),
Transitions(t("Inactive",ReqSetup(),"Activating"),
t("Activating",ResSetup(_,_,STATUS("Cancelled")),"Inactive"),
t("Activating",ResSetup(_,_,STATUS("Completed")),"Active"),
t("Active",ReqWork(),"Active"),
t("Active",ResWork(),"Active")))
Figure 14.15. Setup model program.
238 Compositional Modeling
14.2.6 Composing the features
Let us nowconsider a composition of all of the features.We also need some scenarios
to restrict the parameter domains, so that the composed model program becomes
explorable. We consider two scenarios shown in Figure 14.16.
The scenario CreditScenario describes a client who always uses the minimum
available request ID and asks for two credits when sending a request. The scenario
also limits the number of requests to three. In addition, the scenario describes a
???generous??? server who always grants the maximum number credits to the client.
Note that this scenario model program is a dependent feature of the credits model
program and can therefore not be explored independently of it.
The second scenario, called CancelScenario, describes a client that cancels only
the last request that was sent, and only if there is more than one request pending.
Pages:
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316