On 2009-03-30, Alex Clark <[email protected]> wrote:
>> Looking at this I just noticed the following:
>>
>> [..]
>>      review_state = wf.getInfoFor(todo, 'review_state')
>>      path = todo.absolute_url_path()
>>
>>      for brain in catalog.searchResults(path=path, portal_type='Todo item'):
>>          obj = brain.getObject()
>>          obj_path = obj.absolute_url_path()
>>          old_state = event.old_state.getId()
>>          log('Changing workflow state on %s from %s to %s.' % (obj_path, 
>> old_state, review_state))
>>          wf.doActionFor(obj,review_state,wf_id='todo_list_workflow')
>> [..]
>>
>> Note that you are passing a review *state* to 'doActionFor'
>> whereas you are supposed to specify a *transition*.
>
> Thanks!
>

Strange, though, even if I pass the transition I get the same error:

    Changing workflow state on /Plone/todo-list/do-stuff/do-this-first from 
not_done to done.
    > /srv/todo/Products/todo/events/handler.py(19)changeWorkflowStates()
    -> wf.doActionFor(obj,review_state,wf_id='todo_list_workflow')
    (Pdb)  wf.doActionFor(obj,review_state,wf_id='todo_list_workflow')
    2009-03-30 08:21:11 INFO Plone  
    Changing workflow state on /Plone/todo-list/do-stuff/do-this-first from 
not_done to done.
    *** Unauthorized: You are not allowed to access 'done' in this context
    (Pdb)  wf.doActionFor(obj,'done',wf_id='todo_list_workflow')
    *** Unauthorized: You are not allowed to access 'done' in this context

Could it be that I don't have the right context? Since I'm trying to change wf 
state on 
a child object… or because of how I acquired my wf tool maybe:

    (Pdb) wf
    <WorkflowTool at /Plone/portal_workflow used for /Plone/todo-list/do-stuff>
    (Pdb) obj
    <Todoitem at /Plone/todo-list/do-stuff/do-this-first>

Something's funny here.

Alex

>> Raphael
>>
>>
>>> 
>>> ?
>>> 
>>> I'm starting to suspect my workflow is broken, after poking around
>>> Module Products.DCWorkflow.DCWorkflow, line 283, in doActionFor
>>> it raises:
>>>     raise WorkflowException(_(u'Object is in an undefined state.'))
>>> which makes no sense to me.
>>> 
>>>> Hedley
>>> 
>
>


-- 
Alex Clark · http://aclark.net
Buy Practical Plone 3: http://tinyurl.com/practical-plone


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to