1

I have an application where the UI is driven by a QStateMachine and some of the states can be described as "non interruptible" : once they are entered, the user has to interact with the UI and when it's done then the state can be exited but the transition might depends on external events.

Here is how i would illustrate the problem:

A : initial state
B : "non interruptible" state
C, D, .. : other states

and then some transitions :

event1 -> transition A_to_B
event2 -> transition B_to_C
event3 -> transition B_to_D

Now the application starts the state machine and enters A :

1 - the user click the UI which triggers a QSignalTransition (event1).

2 - while in B, a remote server send something to the app and this should define if we'll enter C (event2) or D (event3) but only after B is exited properly.

The problem is that if we define transition statically (before the state machine is started) then when event2 or event3 are sent, the transition might cause B to be interrupted (let's say the user has not finish to select something for example)

Is it possible to dynamically change a transition between 2 states as soon as we know which one we need ?

Hope the description is clear.

Thank you.

Fryz
  • 2,119
  • 2
  • 25
  • 45
  • 3
    Sounds like you have more actual states than just A, B, C and D. Perhaps you should make your state machine have these extra states as its states, too. – hyde Apr 09 '19 at 18:58
  • 1
    You might actually have [compound states](https://statecharts.github.io/glossary/compound-state.html)-- basically state machines that overlap. – jwernerny Apr 09 '19 at 20:15
  • Thanks, indeed i guess i am missing extra states. – Fryz Apr 10 '19 at 08:18

0 Answers0