On January 3, 2011 08:33:27 am Spiralis wrote: > I am planning an app where I need to have a dynamic lifecycle for a model. > > Consider an app where the user (admin) can control which states and > transitions a lifecycle is to have. Does anyone have a suggestion on how to > implement something like that? > > Thoughts: > > - Define states and transitions via info from a separate model that > defines states and transitions. This will create new dryml-pages while > in production. > - Changing the state-transition could make existing records invalid > (catch these and allow manual override - or disallow changes that make > existing records invalid - or ignore the problem) > > > Other thoughts? >
I do this one of two ways, using transition arguments: "available_to => :authorized_acting_users", where "authorized_acting_users" is a method that lists of authorized users ":if => :authorized_transition, where "authorized_transition" is a method that indicates if the acting user is authorized to make that transition Generally, the "<transition-buttons>" displays the correct set of buttons in my applications. Of course, the "authorized_transition" method can also be used in your DRYML code. Cheers, Henry > ~Ronny -- Henry Baragar Instantiated Software -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
