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

Most upvoted comments

Remove and throw a warning would be the best approach.