Possible enter into a state based on the condition of other states?


#1

I encountered a problem when I need to enter into a state based on the condition of other states.
I am not sure if my implementation is not correct or such feature is not supported yet.

Basically, I need to enable the submit button when both file & data are ready.

please see the link below
https://sketch.systems/felixgogo/sketch/ce881c6dfddf04d58145545b0377d70d


#2

In order to support this, sketch.systems needs to support the notion of final states. The way final states work with parallel states (in SCXML) is:

  • If the child states of a parallel state contain final children, then upon reaching those states, the done.state.{id} event is sent.
  • Once all the child states have their final child states reached, the done.state.{parallel state id} event is emitted.

According to those semantics, if/when final states are supported, your Inputs_Ready && File_Ready event would actually be the done.state.Data event (which actually makes a lot more sense).

Alternatively, sketch.systems might support guards, the In(...) clause, and transient transitions, in which case you can have a “null event” (which is an empty event that happens on every single transition) and a guard condition like Null [In(Inputs_Ready) && In(File_Ready)] --> Enabled.

The simplest and most idiomatic approach for this would be to support final states. Just some ideas!