Hi, I have been working through programatically adding and modifying my workflows. I managed to get my workflow factories installed and then used the manage_addWorkflow to obtain the desired workflow with the appropriate id. Where I am having trouble is changing my default workflow to my new workflow. In the ZMI this would be through the Workflow by Type (the first screen you come into when choosing the portal_workflow tool) once you had built one. For images, if I look at the source for images is 'chain_image' which is set to (Default). I am thinking it is the props should perhaps be a different type but I can't find anything googling that suggest that it is anything but a string. Should it a tuple?

The method is manage_changeWorkflows(self, default_chain, props=None, Request=None)

This is what I am doing to try and use it:

        workflow_tool = getToolByName(self, 'portal_workflow')  

        # Modify workflow chain (Workflow by type)
        workflow_tool.manage_changeWorkflows(default_chain='chain_image',
                                                                        
props='image_workflow',
                                                                        
REQUEST=None)

Here is the traceback:

File "/usr/local/zope/instance1/Products/CMFCore/WorkflowTool.py", line 175, in manage_changeWorkflows
chain = props.get(field_name, '(Default)').strip()


AttributeError: 'str' object has no attribute 'get'

It is probably something simple, hope someone can help me with where I am going wrong. Many thanks.

Regards,
David
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to