Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 3.22 KB

readme.md

File metadata and controls

57 lines (39 loc) · 3.22 KB

Short description

Wikipedia - UML state machine

UML state machine, also known as UML statechart, is a significantly enhanced realization of the mathematical concept of a finite automaton in computer science applications as expressed in the Unified Modeling Language (UML) notation.

The concepts behind it are about organizing the way a device, computer program, or other (often technical) process works such that an entity or each of its sub-entities is always in exactly one of a number of possible states and where there are well-defined conditional transitions between these states.

Spring Statemachine - Projects

Spring statemachine - Reference Documentation

Simply put, a state machine allows to manage the transition between a state Sn to an other state Sn+1, or between the states from Sn to Sn-1, with the use of events
example_0

With a state machine you declare which states is expected depending oh the event used.
example_0
Here I have define this configuration :

  • if I'm the the state S1 and then I receive the event E1 then I'm changing to the state S2
  • then if I'm the the state S2 and then I receive the event E2 then I'm changing to the state S3
  • otherwise, all other events on different states are to be refused

Then if we have this examples :

  • let an entity at the state S1, if we use the event E1 then the transition will be accepted and the entity will have his state changed to S2
    example_0
  • let an entity at the state S1, if we use the event E2 then the transition will be refused and the entity will stay at its state S1
    example_0
  • let an entity at the state S2, if we use the event E2 then the transition will be accepted and the entity will have its state changed to S3
    example_0
  • let an entity at the state S2, if we use the event E1 then the transition will be refused and the entity will stay at its state S2
    example_0

Use cases used for the demonstration

We will use a very simple model for the state-machine : an amazon order as everyone know it and can this way understand it
/!\ it's a false workflow, create just for the demonstration /!\

  1. basic
    simple_use_case

  2. using action
    1_action_use_case

  3. using guard
    2_guard_use_case

  4. using choice
    3_choice_use_case

  5. having interactions
    4_interaction_use_case