-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
HSM works generally but the following minimal example
state ONLINE {
' default handling
ONLINE : WANT
IDLE -> REQUESTED : WANT
REQUESTED -> IDLE : GIVE
}
[*] --> IDLE
generates the code that is legit in JS, C# etc but is a hard-stop "Unreachable code" compile error in Java
private void IDLE_want() {
boolean consume_event = false;
{
IDLE_exit();
REQUESTED_enter();
// Step 4: complete transition. Ends event dispatch. No other behaviors are checked.
return;
} // end of behavior for IDLE
// Check if event has been consumed before calling ancestor handler.
if (!consume_event) {
ONLINE_want();
}
}Feels like (not java-specifica) SS should use consume_event = true; not return; here or (far better) elide the cascading handler altogether since it is unreachable!
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Will Do Soon