You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: example with dynamically defined states? #518
Hi! I stumbled on your library today, and it's exactly what I'm looking for to drive a series of jobs in a workflow that will be run in Kubernetes. For most of the examples, it looks like the State and relationships need to be defined in advance (and added as class attributes) and I'm wondering if you could point me to an example where this is done dynamically? E.g., ideally I could either define the class in a function (and return it) or somehow add the objects dynamically to the base StateMachine. I started looking at that class and seeing if I could figure out how to do it, but this seems like it would be a common want so I wanted to ask here first. Thanks!
Currently, this method is not bundled with the library, but I'm working on this in the #501 PR. The version in the PR is newest and more mature, including a formal schema using typed dicts. I've used to test all the examples in the .scxml format.
Activity
fgmacedo commentedon Jan 21, 2025
Hi @vsoch, how are you?
I've put an example here: #414 (reply in thread)
Currently, this method is not bundled with the library, but I'm working on this in the #501 PR. The version in the PR is newest and more mature, including a formal schema using typed dicts. I've used to test all the examples in the
.scxmlformat.Please let me know if it works for you.
Best!
vsoch commentedon Jan 21, 2025
Ah, that is perfect! ❤
I'll use that strategy for now, and I subscribed to the PR thread so I'll be notified when it's merged.
Thank you for your quick help, and this library! Closing issue.