23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

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.

12.3 The Essential <strong>Specification</strong> 393<br />

Within the productInfoStored state, a keeper is able to perform three alternative behaviours<br />

(see also Figure 12.6):<br />

First it can be asked whether a certain Service is required or not. If this service is<br />

actually needed, the keeper should reply with a required message and the appropriate<br />

RequiredService stored in the PI should be marked ’pending’. This latter is done<br />

by sending the message markPending(Service) to the product info (see also Figure<br />

12.9). If the service is not required, the keeper should answer with the notRequired<br />

message. After the required or notRequired messages have been sent, the keeper<br />

remains in the productInfoStored state.<br />

Second it can receive the servicePerformed message. In this case the product info<br />

should be sent the markPerformed message (see also Figure 12.9) and the keeper<br />

should return to the productInfoStored state.<br />

Third it can receive the retrieve message. Then the keeper should deliver its product<br />

info by sending the take message, and consequently make a transition to the<br />

noProductInfoStored state 18 .<br />

The productInfoStored method is now straightforwardly specified:<br />

productInfoStored id:PIKeeperId service:Service<br />

(prks?serviceRequired(id,service id=myId);<br />

if productInfo requires(service)<br />

then productInfo markPending(service);<br />

prks!required<br />

else prks!notRequired<br />

fi;<br />

productInfoStored<br />

)<br />

or<br />

(pisa?servicePerformed(id,service id=myId);<br />

productInfo markPerformed(service);<br />

productInfoStored<br />

)<br />

or<br />

(pipo?retrieve(id id=myId);<br />

pipo!take(productInfo);<br />

noProductInfoStored<br />

)<br />

The last process class we will specify in this chapter is Transporter Image class. The first<br />

part <strong>of</strong> the specification <strong>of</strong> process class Transporter Image is defined by:<br />

18 One could also decide to first check the absence <strong>of</strong> any pending services. In case one or more pending<br />

services were still available, one could decide to generate an error. This behaviour should be analysed<br />

within an error handling scenario.

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

Saved successfully!

Ooh no, something went wrong!