Import SCXML to xstate #4073
Unanswered
cristiancorredor
asked this question in
Q&A
Replies: 1 comment 2 replies
-
It is possible; we do it in our tests: https://github.com/statelyai/xstate/blob/main/packages/core/src/scxml.ts In the future, we'll add a first-class API for importing from SCXML. It's tricky now because there are some subtle parts where XState deviates from SCXML, but it's still largely compatible for most machines. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm developing a parametrized state machine system for each of my clients, so I would like to store in DB the state machine definition of each client and then load in xstate the corresponding definition depending on the logged user.
For this purpose I am trying to use SCXML to store the definition on DB, but I can't figure out how to create the xstate machine from this SCXML? Is it possibe?
The xstate docs talk about the compatibility with SCXML but nothing about loading from SCXML. I tried the toMachine function (as explained here: https://baptiste.devessier.fr/writing/interpret-scxml-state-machines-with-xstate/) but it is quite limited, for example the scxml tag "transition" (action of xstate machine) is not considered.
In case this was not possible, how do you recommend me to store the xstate definition in DB?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions