[Zope-CMF] Question about DCWorkflow Patches & _executeTransition
k_vertigo at objectrealms.net
Tue Apr 13 00:59:06 EDT 2004
On Tue, 2004-04-06 at 08:00, Evan Henshaw wrote:
> I'm new to the Zope community so please forgive me if i'm asking this
> in the wrong place. I'm trying to figure out how best to contribute
> back to the community.
> I've been using DCWorkflow for a little while. Today i ran in to a
> problem. I was trying to use a workflow variable to store a list. But
> addVariable expects text. I could have wrote something to create a
> string which was comma separated and then extracts it when needed, but
> that feels like a hack.
variables in dcworkflow are expressed as tales expressions, and are
capable of returning lists. the default value does seem to be restricted
to a string.
> So i was looking at writing an script to set / update the more complex
> variable on the object instead of using the workflow variable. This
> also feels like a hack. I don't want to run another script, i want to
> call a method on my object to allow for tracking more complex state
> It feels to me like it's bad style to create a script just to call one
> function in my object, but that would work.
cmfcore/dcworkflow also has an option for a workflowmethod, which is a
method on the object whose invocation triggers a state change.
> A better solution would be to update DCWorkflow one of two ways.
> First we could change the way workflow variables worked so they aren't
> expected to just be strings, but could allow for dict's, lists, and
> other more complex objects than just strings. This wouldn't be too
> hard, but i believe it might break existing code, which is bad style.
> Another solution would be to add two new attributes to transitions. A
> before_method and after_method. These would be like before_script_name
> and after_script_name in that they would be called to allow specific
> functionality to be added to the transition.
> Looking at _executeTransition it shouldn't be very hard to add this
> functionality. I think _executeTransition should probably be refactored
> anyway because it's quite long.
dcworkflow already supports before and after transition scripts, if you
haven't already done so i'd recommend reading the docs here
> The only disadvantage of this addition is if it somehow violates the
> model employed within DCWorkflow. I'm not sure if workflows are
> supposed to be treating the objects they are moving around as more or
> less black boxes or not.
> What i want to know, is do people think this is a good idea? How do i
> go about submitting a patch to DCWorkflow? Beyond that, what is the
> process for contributing code to a CMF in the 'collective'?
re contributions, adding it to the collector is probably best
hope that helps,
More information about the Zope-CMF