Skip to content
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

does anyone see dynamically formulated workflows fly at all? #55

Closed
wdiechmann opened this issue Oct 24, 2012 · 2 comments
Closed

does anyone see dynamically formulated workflows fly at all? #55

wdiechmann opened this issue Oct 24, 2012 · 2 comments

Comments

@wdiechmann
Copy link

Back on 1.2 and 2.0.3 I used AASM and fellows - lately I've been trying out state_machine - but then I googled 'dynamic state machine' and Mountain View 'coughed up' this gem!

Pitch

I'd like to allow users to setting up workflows themselves, selecting from a bunch of available events/transistions, and in the proces I18n'ifying the body of the work :)

One use case would be several groups of users processing workflows on the same codebase - but with totally different workflow use cases (multi-site)

One other use case would be users adjusting workflows to changes to business policies - like: we at Corp XYZ are now 'green' and thus our SourcingOrders should not print before they are emailed/faxed to our suppliers - unless the Order Total exceeds 1,000,000...

UI design

I'm working off of a generic abstract_action_base.rb model which gets inherited by models like Project, Product, Item, Partner, etc. and then (as STI models) like Partner being inherited by models like Customer, Supplier, Bank, etc

Ideally I'd like my abstract_action_base to provide the workflow_states as a Hash

{ sourcing: :requested, selling: :ordered, stock: :backlogged }

and all state_questions to work like Product.find(419).sourcing_requested? and persisted to ActiveRecord (AR) in a quasi-searchable fashion - something along the lines of:

workflow_states = '----1R--2O--3B----'

which would allow quick searches on workflow states like:

Product.where{ workflow_states.like_all [ '-1R-','-3B-'] }.where( "workflow_states like '%-2O-% " )

Workflow transitions

Workflow transitions would - again ideally - be persisted to AR as something like:

t.string :transition_label  # what to label the transition and use as key for I18n.translations
t.text :guard               # code to eval true/false guarding the transition on an instance
t.text :from_to             # hash of transition like { drafted: { requested: :some_condition_attribute_or_method, archived: :other_condition_or_method }, requested: {} }
                                    # persisted as serialized object

Epilogue

Am I totally loosing it here? Or does you (the reader) see dynamically formulated workflows fly at all?

@frangelli
Copy link

The same issue here. I need to let my users generate their own workflows, save it and then run it. Any evolution there?

@OpenCoderX
Copy link

You could use ruby meta-programming methods to dynamically define the workflow; send etc. http://ruby-metaprogramming.rubylearning.com/

@geekq geekq closed this as completed May 29, 2022
@geekq geekq closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants