[Zope-CMF] Workflow not found, problem with doActionFor()
Raphael Ritz
r.ritz@biologie.hu-berlin.de
Tue, 11 Mar 2003 09:17:09 +0100
Jean-Francois.Doyon@CCRS.NRCan.gc.ca wrote:
>I am now running into a problem using doActionFor in order to publish
>programmatically created objects.
>
>The interesting bit of code looks like this:
>
> # Create the empty new object using the proper method invokeFactory
> try:
> parent.invokeFactory(obj.Type(),id)
> except:
> print 'Could not create '+str(parent.getPhysicalPath()+( str(id), ))
> else:
> newobj = context.restrictedTraverse(parent.getPhysicalPath()+( str(id),
>))
> if ( review_state == 'published' ):
>context.portal_workflow.doActionFor(newobj, 'publish')
>
>Problem is, I keep being told that the requested workflow definition was not
>found!
>
>
>
1. Just for clarification: is the workflow or the workflow
action/transition not found?
2. If it's not a typo in the code above: Trying to publish a published
item usually doesn't
work because there is no such transition from the published to the
published state.
So make sure that you test on a state from where the 'publish'
transition exists.
Raphael
>
>