UML state diagram execution

Each business class in your model may optionally have an associated UML state diagram. Once defined and source code has been updated ECO is capable of executing these state machines.

Features include

  • Triggers: Signals to ECO that a transition should be made from the current state to a new state.
  • Guards: An OCL expression that indicates whether a specific transition is currently permitted or not. When multiple transitions use the same trigger the guard expression determines which transition to take.
  • Sub regions: Each state may have zero or multiple concurrent regions, allowing your state diagrams to be as simple or complex as required.

UML state machine
The above image illustrates a UML state machine for a fictitious "Article" class.
  1. Once an instance of the Article class is created it's modeled state machine will be executed.
  2. The Initial state (solid black circle) will immediately exit via its only transition into the Authoring state.
  3. To exit the Authoring state the application must execute MyArticle.Publish. Two transitions leaving the Authoring state are triggered by the Publish method.
  4. At this point the correct transition is determined by evaluating the OCL Guard expression on each transition.
  5. If the author of the article has AutoPublishArticles set to True then the expression self.Author.AutoPublishArticles will evaluate to True and the article will become Published.
  6. Alternatively the ECO state machine will enter the Reviewing state.
  7. The Reviewing state is a complex state, it contains what could be considered to be an embedded state machine. A reviewer would then be responsible for checking the spelling and grammar of the article and either approving the article or rejecting it.

ECO state machines are a very powerful feature, enabling not only embedded state machines but also multiple concurrent state machines and even multiple concurrent state machines within a single state and multiple levels of nested state machines.