[Zope-CMF] Question about DCWorkflow Patches & _executeTransition
Evan Henshaw
evan at partecs.com
Tue Apr 6 08:00:56 EDT 2004
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.
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
variables.
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.
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.
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'?
Thanks,
evan
More information about the Zope-CMF
mailing list