[Zope-CMF] Updating workflow variables from within scripts

Adam Fields fields@surgam.net
Thu, 20 Mar 2003 14:03:44 -0500


On Thu, Mar 20, 2003 at 07:49:41PM +0100, Florent Guillaume wrote:
> In article <20030319001628.GB6874@eye.surgam.net> you write:
> > Using DCWorkflow...
> > 
> > I can update custom workflow variables from a transition expression,
> > but I haven't been able to get it working from a script that's
> > executed as part of a transition.
> 
> "to get it working" = ?
> If you mean update a variable "from" a script, no, it doesn't work like
> that. The variables can be changed only by specific expressions in
> transitions or in their definition itself.

Specifically, what I want to do is this:

1) Keep track of how many times a particular object has gone through a
   complete workflow. Examples are very lacking - does the expression
   syntax support mathematical operations? I couldn't figure out how
   to increment a workflow variable in a transition expression.

2) When a child object completes its workflow, I'd like to have it set
   a flag in its parent object telling it that the content contained
   within is ready. So, for example, if I have an article and an
   image within it, I'd like for the article to know whether the image
   is "done" or not.

If properties are actually a better way, I'll buy that, but it seems
to me that this is exactly the kind of thing workflow variables should
be usable for, through scripts.

> > Similarly, I'd like to also update a variable in the workflow of an
> > object's direct parent - is this possible? Again, code examples?
> 
> You'll have to make the parent follow a transition, during which the
> variable is recomputed.
> 
> 
> It looks like what you really want is just object's properties, not
> workflow variables.

In that case, what would you use workflow variables for?

Thanks!

-- 
				- Adam

-----
Adam Fields, Managing Partner, fields@surgam.net
Surgam, Inc. is a technology consulting firm with strong background in
delivering scalable and robust enterprise web and IT applications.
http://www.adamfields.com