Mini-Spec Implementation : Reactive Activities

Reactive Activities

The syntax for reactive mini-spec is “E[C]/A,” that is on the event E, when the condition C is true, do the reaction A. Consider the following example, for a mini-spec defined as:

ALARM_ON[WORKING]/SET_SIGNAL
 
With Event - ALARM_ON, Condition – WORKING, and Event -
SET_SIGNAL
The code would be:
if(ALARM_ON && WORKING){
GENERATE_EVENT(SET_SIGNAL);
};
 
 
Note:  

[C1 or C2]/A0

rather than

[C1]/A0;;[C2]/A0