[Erp5-dev] Changing workflow association and restoring document's workflow state

Jérome Perrin jerome at nexedi.com
Wed Oct 24 16:43:34 CEST 2007


Łukasz Nowak a écrit :
> Hello,
> 
> On 2007-10-24, 15:45:05
> Jérome Perrin <jerome at nexedi.com> wrote:
> 
> (...)
>> Another way is to directly hack the content of workflow_history
>> on those documents. It's IMHO the easiest, especially if you want to
>> keep history details (date, comments).
> 
> Yes, I'd love to. Thanks for idea, I'll try to invoke such "hacks",
> but I'm afraid it will require more in depth of understanding :(
> Zope/DCWorkFlow.

Look at workflow_history attribute on document, it's easy to understand 
how it's structured (with pprint).
This http://svn.erp5.org/?view=rev&revision=17171 was to change the 
state variable name, so it's not exactly the same. If only workflow ID 
changed, I think you can simply do:
ob.workflow_history['new_workflow_id'] =\
          ob.workflow_history.pop('old_workflow_id')

Jérome



More information about the Erp5-dev mailing list