[Zope-CMF] Workflow not found, problem with doActionFor()

Florent Guillaume fg@nuxeo.com
Tue, 11 Mar 2003 18:52:18 +0100


In article <20030311174834.GA29742@flo.in.nuxeo.com> you write:
> This should BTW read:
> 
>   try:
>     parent.invokeFactory(obj.getPortalTypeName(),id) # important
>   except:
>     print 'Could not create '+str(parent.getPhysicalPath()+( str(id), ))
>   else:
>     newobj = getattr(context, id) # simpler
>     if ( review_state == 'published' ):
>       context.portal_workflow.doActionFor(newobj, 'publish')

Huh, I mean:

  try:
    parent.invokeFactory(obj.getPortalTypeName(),id) # important
  except: # BAAAAAAAD find the real exception you must catch here
    print 'Could not create '+str(parent.getPhysicalPath()+( str(id), ))
  else:
    newobj = getattr(parent, id) # simpler
    if ( review_state == 'published' ):
      context.portal_workflow.doActionFor(newobj, 'publish')


Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com