uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

W072 Refactored Final State

Umple 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();}
    }
  }
}

      

Load the above code into UmpleOnline

 

Another Example

// The following shows how to avoid the warning

class X {
  status{
    on{
      turnoff -> off;
      powerOff-> FINAL;
    }    
    off{
      turnOn -> on;  
    }
    final FINAL{
      entry/{entry();}
    }
  }
}

      

Load the above code into UmpleOnline

 

Another Example

// 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