[Zope] manage_changeWorkflow question - solved

David Pratt fairwinds at eastlink.ca
Sat Apr 9 15:11:50 EDT 2005


Solved this after trying more things. Here is what I used:

        # Modify workflow chain (Workflow by type)
         
workflow_tool.manage_changeWorkflows(default_chain='default_workflow',
                                                                         
props=({'chain_Image':'image_workflow','chain_Folder':'', 
'chain_Topic':''}),
                                                                         
REQUEST=None)

Regards,
David


On Saturday, April 9, 2005, at 02:41 PM, David Pratt wrote:

> I am getting closer:
>
>         # Modify workflow chain (Workflow by type)
>         
> workflow_tool.manage_changeWorkflows(default_chain='default_workflow',
>                                                                        
>  props=({'name':'chain_Image','value':'image_workflow'}),
>                                                                        
>  REQUEST=None)
>
> No errors now, but it sets all to Default instead of just the 
> Image....  It seems  I am not passing the correct properties.  I am 
> getting name and value from the html source of the form.  Anyone know 
> what these need to be?
>
> David
>
>
> On Saturday, April 9, 2005, at 12:41 PM, David Pratt wrote:
>
>> 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 at 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 )
>>
> _______________________________________________
> Zope maillist  -  Zope at 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 )
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3287 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050409/d2c9dd1d/attachment.bin


More information about the Zope mailing list