Open faisal00813 opened 4 years ago
Some inspiration, https://github.com/davidkpiano/xstate
Hi @faisal00813,
Adding support for SCXML will allow standardisation.
If you are looking for a python engine capable of working with SCXML, you could have a look at PySCXML. It's not maintained anylonger but maybe it is sufficient for your purposes.
About the 'standardisation': With my current knowledge I would say that it is not possible for transitions
to be SCXML-compatible:
transition
's callbacks in general are hard to translate - this could be compensated by definining a custom event typeprepare
, before
, after
, finalize
are not supported by SCXML and I dont see how this can be compensatedbetween
states is not supported by transitions
. A transitions
model is never 'between states'.unless
- it could be replaced with 'not condition' maybetransitions
has no <history>
state - this could be a state extension maybetransitions
does not support datamodels - SCXML expects for instance the evaluation of ecmascript
expression but I don't see something similar for transitions
as evaluating strings as Python code or similar can caue a lot of damage. But afaik a datamodel other than None
is not a must.transition
does not support a transition without a trigger/event - those could be dropped when parsing thoughinvoke
and communication with other services is (imho) out of scope for a 'simple' state machine such as transitions
Some inspiration, https://github.com/davidkpiano/xstate
It's a great state chart library for sure. But I could not find documentation about how SCXML can be imported or exported. Can you provide a link or Codepen/JSFiddle?
So, long story short: transitions
and SCXML are designed significantly different. Is it possible to create an export/import system for a simple state machine without most transition callbacks, configuration capabilities and a very limited set of 'Executable content'? Probably. Will transitions
support a majority of SCXML features? Probably not. Can transitions
export/import xstate
SCXML exports? I don't know (yet) :).
That being said, I do think it is possible to build an SCXML engine based on transitions
and add all the web technology the w3c likes to see in an SCXML implementation. This could be part of the pytransitions organisation but would be an individual module/package.
Finally, SCXML is now complete for adoption. Adding support for SCXMl will allow standardisation.