umple: Final states should not have do activities, exit actions, nested state machines, nor outgoing transitions
The current implementation of Umple doesn’t restrict final states from having do activity, exit and entry actions, and any outgoing transition. Consider the following example
class X{
status{
on{
turnoff -> off;
powerOff-> FINAL;
}
off{
turnOn -> on;
}
final FINAL{
entry/{entry();}
do{exe();}
exit/{exit();}
turnOn-> on;
}
}
}
The snipped parts of the generated code
private void exitStatus()
{
switch(status)
{
case FINAL:
// line 15 "model.ump"
exit();
if (doActivityStatusFINALThread != null) { doActivityStatusFINALThread.interrupt(); }
break;
}
}
private void doActivityStatusFINAL()
{
try
{
exe();
Thread.sleep(1);
}
catch (InterruptedException e)
{
}
}
private void setStatus(Status aStatus)
{
status = aStatus;
// entry actions and do activities
switch(status)
{
case FINAL:
// line 13 "model.ump"
entry();
delete();
doActivityStatusFINALThread = new DoActivityThread(this,"doActivityStatusFINAL");
break;
}
}
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (19 by maintainers)
Commits related to this issue
- Add User Manual entries for E073 and E074 * Add user manual pages and examples for E073 and E074 * Add additional test case which is also used as a user manual example * Modify E074 error message * Up... — committed to jblang94/umple by jblang94 7 years ago
- Add User Manual entries for E073 and E074 * Add user manual pages and examples for E073 and E074 * Add additional test case which is also used as a user manual example * Modify E074 error message * Up... — committed to jblang94/umple by jblang94 7 years ago
Remove and throw a warning would be the best approach.