|
W072 Refactored Final State
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] W072 Refactored Final StateUmple sematic warning when do activities, exit actions, outgoing transitions, and/or nested state machines are removed by the compiler from final states.In Umple, final states are allowed to be empty, or they can contain entry actions. Example
// The following shows how to generate the warning
class InvalidFinalState {
status{
on{
turnoff -> off;
powerOff-> FINAL;
}
off{
turnOn -> on;
}
final FINAL{
entry/{entry();}
do{exe();}
reboot -> on;
nestedSm {
s1 {
-> s2;
}
s2 {
}
}
exit/{exit();}
}
}
}
// @@@skipcompile no method entry written for line 15
Load the above code into UmpleOnline Solution to The Above So the Message No Longer Appears
// The following shows how to avoid the warning
class X {
status{
on{
turnoff -> off;
powerOff-> FINAL;
}
off{
turnOn -> on;
}
final FINAL{
entry/{entry();}
}
}
}
// @@@skipcompile no method entry written line 13
Load the above code into UmpleOnline Solution to The Above So the Message No Longer Appears
// The following shows how to avoid the warning
class X {
status{
on{
turnoff -> off;
powerOff-> FINAL;
}
off{
turnOn -> on;
}
final FINAL{
}
}
}
Load the above code into UmpleOnline |