Commit 8330baff authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

pathces/Expression.py: repare state_change_information script list structure;...

pathces/Expression.py: repare state_change_information script list structure; apply universal method getReference to replace getId.
parent 19881b8f
...@@ -24,6 +24,7 @@ from Products.DCWorkflow.Expression import StateChangeInfo ...@@ -24,6 +24,7 @@ from Products.DCWorkflow.Expression import StateChangeInfo
def Expression_hash(self): def Expression_hash(self):
return hash(self.text) return hash(self.text)
Expression.__hash__ = Expression_hash Expression.__hash__ = Expression_hash
...@@ -33,8 +34,12 @@ def Expression_createExprContext(sci): ...@@ -33,8 +34,12 @@ def Expression_createExprContext(sci):
''' '''
ob = sci.object ob = sci.object
wf = sci.workflow wf = sci.workflow
if wf.getTypeInfo().getId() == 'Workflow': if wf.getTypeInfo().getId() == 'Workflow' or\
scripts = wf.objectValues(portal_type='Workflow Script') wf.getTypeInfo().getId() == 'InteractionWorkflow':
script_list = wf.objectValues(portal_type='Workflow Script')
scripts = {}
for script in script_list:
scripts[script.getId()] = script
else: else:
scripts = wf.scripts scripts = wf.scripts
container = aq_parent(aq_inner(ob)) container = aq_parent(aq_inner(ob))
...@@ -61,11 +66,9 @@ Expression.createExprContext = Expression_createExprContext ...@@ -61,11 +66,9 @@ Expression.createExprContext = Expression_createExprContext
def StateChanceInfo_getHistory(self): def StateChanceInfo_getHistory(self):
wf = self.workflow wf = self.workflow
#raise NotImplementedError (wf)
#raise NotImplementedError(wf.getTypeInfo())
if getattr(wf, 'getTypeInfo'): if getattr(wf, 'getTypeInfo'):
tool = wf.getPortalObject().portal_workflow tool = wf.getPortalObject().portal_workflow
wf_id = wf.getId() wf_id = wf.getReference()
else: else:
tool = aq_parent(aq_inner(wf)) tool = aq_parent(aq_inner(wf))
wf_id = wf.id wf_id = wf.id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment