-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load workflow specification from YAML file? #92
Comments
A workflow is definied by a Specification object. Normally it is created with We will presumably have to separate the |
Just extracted the To do what you want to do please create Workflow::Specification in some way, e.g. from definition in yml file. Then call |
Thanks a lot, Vladimir. This really helps. I'll try this out and provide feedback to you. |
Hello @geekq I see this old issue, matching my exact business need |
You need:
As explained in the 68951c9 example, you can load a specification object from yaml, then run Or you maybe want to load your specially designed yaml and then call methods on the spec object like
The requirements on which workflow aspects, and how to be represented in yaml, may vary greatly. So they are better implemented in your application specific code. |
Thanks, very clear on the Specification part My next question is where to call assign_workflow. So let say I have a BusinessProcess model, intended to represent various workflows, each modelized in a yaml.
something like this ? |
I recommend https://www.manning.com/books/the-well-grounded-rubyist-second-edition book to learn about advanced, class level- and meta-programming.This is very good! One user #55 (comment) also recommended http://ruby-metaprogramming.rubylearning.com/ (I have not read this one myself though) For multiple workflows please also see the example https://github.com/geekq/workflow-activerecord/blob/develop/test/multiple_workflows_test.rb
|
This is pretty straight-forward, I achieved it like this:
|
I'm trying to build a user extensible workflow. So I wanted to check if there are any plans on building functionality to load the workflow specification from a YAML file?
I would love to work on this myself if you could give some pointers on how to get started.
The text was updated successfully, but these errors were encountered: