[Zope-CMF] DCWorkflow using workflow variables in guards expressions

Konstantin E. Steuck phoenix_12 at ngs.ru
Thu Apr 21 05:20:40 EDT 2005


Hi, list.

I'm trying to implement task assignment to a person instead of a role or 
permission in workflow.
While browsing thru DCWorkflow docs I thought I found perfect way to do 
this by creating state variable called 'user' and setting it to whatever 
I need. Then guard expression checks if current user is the one who has 
been assigned to accomplish the task.
So I set guard expression for worklist to
====
python:state.get('user') == 'someone' #  maybe user.getId()
====
but state.get always returns None (or default value if specified), no 
matter what variable is being retrieved.
workflow.getInfoFor(here, 'user') doesn't work either, it says I have no 
enough permissions.
This problem is very similar to 
http://mail.zope.org/pipermail/zope-cmf/2003-August/019221.html expect 
for author tried to guard transitions instead of worklist.

Can anyone tell why guard expressions behave this way? Is there any 
workaround? (the one I see is to store 'user' as object's property, not 
as workflow variable)

Thanks in advice.


More information about the Zope-CMF mailing list