list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

E235 SuperCall Conflict

Umple semantic error related to state machine composition algorithm

When clients use more than one trait, using the keyword superCall can cause a conflict. This happens because an order of execution is required.

As seen in the example below, class C1 uses two traits T1 and T2 and there is matching state s1 and matching transition e1 needed to be composed. Since the keyword has been used in the base transition e1, it indicates that the actions of matching transitions are to be executed, but there is more than one action to be executed. Therefore, the Umple compiler prevents these models from being composed.

Example

// In this example, there is an error
// because the keyword superCall can be
// pointed out to two used traits.
trait T1{
  sm{
    s1{ e1 -> /{action1();} s1; }
  }
}
trait T2{
  sm{
    s1{ e1 -> /{action2();} s2;}
    s2{}
  }
}
class C1{
  isA T1,T2;
  sm{
    s1{ e1 -> /{superCall; action3();} s3; }
    s3{}
  }
}
      

Load the above code into UmpleOnline