Solved scxml dynamic load use case
-
What is the use case for dynamically loading an scxml?
After a quick look over the QScxml* classes, I don't see methods for managing changes (new/removed states, transitions, events, etc.) after loading a new statemachine.
Without such methods, it's not clear how to manage such change.
Thanks!
-
Sure did, but that I can see, none of those projects make use of dynamically loading some changed Scxml. Sure, they load one up dynamically, but once it's loaded it's done. Some of the examples even load from a resource file; so to me, that makes it even less dynamic.
I did find a use case however that's fairly straightforward: A generic state machine loader that does nothing more than publish known and active states, and processes events.
I'd sure appreciate it if you could try to answer some of my outstanding questions here, perhaps with some example.
Thanks!
-
Hi
You mean something like
https://doc.qt.io/qt-5/qtscxml-trafficlight-widgets-dynamic-example.html
but without knowing anything about the state it has? -
Yes, exactly. In fact, that is the example I've been playing with. I can see how that QScxmlStateMachine::stateNames would list all (most?) states. But how to list all transitions? Other things like initial, final, history?
-
@wpmccormick
Hi
Sorry, your question floated away.
Im not sure there is such interface.
Some of the info might be available via
https://doc.qt.io/qt-5/qscxmltabledata.html -
An example of how to use the class would be very helpful.
-
@wpmccormick Did you check here https://doc.qt.io/qt-5/examples-qtscxml.html ?
-
Sure did, but that I can see, none of those projects make use of dynamically loading some changed Scxml. Sure, they load one up dynamically, but once it's loaded it's done. Some of the examples even load from a resource file; so to me, that makes it even less dynamic.
I did find a use case however that's fairly straightforward: A generic state machine loader that does nothing more than publish known and active states, and processes events.
I'd sure appreciate it if you could try to answer some of my outstanding questions here, perhaps with some example.
Thanks!