umple: the sequence of exit actions are not executed correctly
Here is somehow a complete example shows how exit must be treated. @TimLethbridge @opeyemiAdesina I wonder if you guys can check if the semantics related to execution order is correct or not?
class X{
sm{
on{
exit /{exit_on_execute();}
e1-> off;
e2-> on;
s1{
exit /{exit_s1_execute();}
e3-> s2;
e4-> s1;
e5-> on;
e6-> off;
m1{
exit /{exit_m1_execute();}
e7-> m2;
e8-> m1;
e9-> s1;
e10->s2;
e11->on;
e12->off;
}
m2{}
}
s2{}
}
off{}
}
void exit_on_execute(){System.out.println("exited on");}
void exit_s1_execute(){System.out.println("exited s1");}
void exit_m1_execute(){System.out.println("exited m1");}
}
The following part shows the execution oders of exits for each event. It shows which is supported currently by Umple.
//e1-> off; : exit_on_execute(); //correct //e2-> on; : exit_on_execute(); //correct //e3-> s2; : exit_s1_execute(); //correct //e4-> s1; : exit_s1_execute(); //correct //e5-> on; : exit_s1_execute(); -> exit_on_execute(); //Not correct //e6-> off; : exit_s1_execute(); -> exit_on_execute(); //Not correct //e7-> m2; : exit_m1_execute(); //correct //e8-> m1; : exit_m1_execute(); //correct //e9-> s1; : exit_m1_execute(); ->exit_s1_execute(); //Not correct //e10->s2; : exit_m1_execute(); ->exit_s1_execute(); //Not correct //e11->on; : exit_m1_execute(); -> exit_s1_execute(); -> exit_on_execute(); //Not correct //e12->off; : exit_m1_execute(); -> exit_s1_execute(); -> exit_on_execute(); //Not correct
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 25 (25 by maintainers)
@jblang94
Yes. my bad.
Yes. This is called hierarchical state. It means it doesn’t matter in which internal state the system is, once an event comes in the top state, the internal states must be left. This is also applied to parallel regions as well.
Yes. Work on Java