[Zope-CMF] Updating workflow variables from within scripts

Adam Fields fields@surgam.net
Thu, 20 Mar 2003 16:29:22 -0500


On Thu, Mar 20, 2003 at 09:15:14PM +0100, Florent Guillaume wrote:
> On Thu, 2003-03-20 at 21:02, Adam Fields wrote:
> > On Thu, Mar 20, 2003 at 08:11:54PM +0100, Florent Guillaume wrote:
> > > Yes I'd increment a variable in the transition looping back to the
> > > initial state. To increment a var you'd use something like (see more doc
> > > in doc/expressions.stx):
> > >    python:status.myvar + 1
> > > 
> > > (DCWorkflow.Expression.createExprContext has the full expression context
> > > definition if the doc is not enough.)
> > 
> > Thanks, I'll try that.

Incidentally, this is close but not exact. status is a hash, so you
have to do this:

python:status['myvar'] + 1

Otherwise, that works great.

> Yes, doActionFor. Portal_workflow only has three public methods, one of
> which is doActionFor(ob, action). 'action' is the transition id. If the
> transition doesn't have a title field, it won't appear in
> getActionsFor() thus in the GUI, but it's still available to python
> code.

I think that's totally clear now. Thanks for your help!

-- 
				- 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