Wiki

Clone wiki

scenariotools-sml / isBlocked()

#isBlocked# The isBlocked function checks, if a message event is blocked by an active scenario. The scenario blocks the message, if it would cause a safety violation in the scenario.

#!java

interface ActiveScenario {
   // ...
    public boolean isBlocked(MessageEvent event);
   // ...
}
The return value of the isBlocked function of the scenario depends on the state of the scenario's active interaction, a similar but more elaborate function is defined in the ActivePart interface.

#!java

interface ActivePart{
   // ...
    public BlockedType isBlocked(MessageEvent event);
   // ...
}
| case | BlockedType | description | results in | |-|-|-|-| | 0 | Enabled | event is enabled and will not be blocked. | false | | 1 | CutNotstrict | event may be forbidden by constraints. | false, if not forbidden somewhere | | 2 | Forbidden | event is to be blocked due to constraints. | true | | 3 | Ignore | "constraints" specify that event should be ignored. | false | | 4 | CutStrict | cut is strict, therefore event will be blocked, if it occurs in the scenario. May lead to case 6. | true if event covered by an interaction. | | 5 | StrictConsidered | the cut is strict and the interaction constraints specify to consider this event, therefore it will be blocked. | true | | 6 | Blocked | event is blocked, but may be allowed to happen by interaction constraints. | true with possibility of becoming false | | 7 | Interrupted | constrains of an interaction specify that the event should be ignored, so it will not be blocked. | false |

An active scenario delegates the isBlocked() call to its active interaction. The active interaction is the root of an active part tree. The call is delegated down to enabled nested active parts. When a BlockedType information is returned, it can only be strengthened, but not be inverted. This means, that if a lower enabled active part returns blocked, the event will stay blocked. If it returns ignore, then the event cannot be blocked by upper nodes in the tree. previous content ##Assumptions for a consistent specification:##

BlockedType
0 - Enabled -> ever false
1 - CutNotStrict -> false until a forbidden constraint is unifiable(leads to forbidden)
2 - forbidden -> ever true
3 - ignore -> ever false
4 - CutStrict -> false until coverd events are unifiable leads to (6) other case: (5) or (7) happens
5 - StrictConsidered -> if CutStrict and a considerd message is unifiable -> ever true
6 - Blocked -> true until ignore, forbidden, interrupted
7 - Interrupted -> ever false

*("ever" means value don't change anymore)

Updated