fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
lgessler 2020-09-26T01:44:07.032600Z

thanks @tony.kay, i got it now--I think the problem in my intuition was that I was expecting the load to merge the new data with the old data rather than replace the old data. Nothing a pre-merge can't fix though

Adrian Aleixandre 2020-09-26T20:13:32.036900Z

Hey folks! Spent the last few weeks diving into Fulcro in my evening hours. Awesome stuff! I have a question that I haven't been able to figure out on my own: I am wondering if it is possible to define a new state machine at runtime. I want to take a domain-specific data-structure (entered by a user) and convert it into a state machine that I can then run. Is this possible?

➕ 1
currentoor 2020-09-26T20:36:05.037100Z

it should be possible

currentoor 2020-09-26T20:36:55.037300Z

take a look at the definitions of uism/defstatemachine you'll see it adds the machine definition to a global registry key'd by a fully qualified symbol

currentoor 2020-09-26T20:38:04.037500Z

so you'll have to do that yourself after building the machine (which is just a map)

currentoor 2020-09-26T20:38:37.037700Z

and pass that machine definition into uism/begin!

currentoor 2020-09-26T20:39:10.037900Z

now whether you really actually or should do that is a different matter

currentoor 2020-09-26T20:41:00.038100Z

if you look at the source of RAD in com.fulcrologic.rad.form you'll see a state machine that works for an arbitrary form with all kinds of customization options

currentoor 2020-09-26T20:41:19.038300Z

and @tony.kay did not need to dynamically define that machine at runtime

currentoor 2020-09-26T20:41:54.038500Z

but again, depends on your use case

Adrian Aleixandre 2020-09-26T21:14:27.038700Z

Yeah that's a good point. I may be able to create a machine that directly uses my domain-specific data without actually creating a whole custom machine every time. Appreciate your detailed response!