geekq / workflow

Ruby finite-state-machine-inspired API for modeling workflow
MIT License
1.74k stars 207 forks source link

Dynamic runtime/user defined workflows #235

Open oskargargas opened 1 year ago

oskargargas commented 1 year ago

Hi! In my use case I see a need (sometime in future) to add possibility for users to customize the workflow. Ignoring some states is easy enough by conditional transitions. The question is about adding custom states.

Based on #55 and #92 I see that it should be possible to dynamically create a workflow specification and then inject it where it's needed via assign_workflow. On top of that I assume it should be possibile to add some customization via meta-programming (instance_eval and similar magic).

If I come to a point when I'll need to add such feature and if I find it's much easier to modify library itself then to manage such code on application side, would you accept such PR?

tlloydthwaites commented 4 months ago

Hi, I have the same need, see this comment for an example:

https://github.com/geekq/workflow/issues/92#issuecomment-1982203534