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

patches/Expression.py: deploy universal method to get workflow scripts; correct a typo error.

parent 0b96534d
...@@ -34,14 +34,7 @@ def Expression_createExprContext(sci): ...@@ -34,14 +34,7 @@ def Expression_createExprContext(sci):
''' '''
ob = sci.object ob = sci.object
wf = sci.workflow wf = sci.workflow
if wf.getTypeInfo().getId() == 'Workflow' or\ scripts = wf.getScriptValueList()
wf.getTypeInfo().getId() == 'InteractionWorkflow':
script_list = wf.objectValues(portal_type='Workflow Script')
scripts = {}
for script in script_list:
scripts[script.getId()] = script
else:
scripts = wf.scripts
container = aq_parent(aq_inner(ob)) container = aq_parent(aq_inner(ob))
data = { data = {
'here': ob, 'here': ob,
...@@ -64,7 +57,7 @@ def Expression_createExprContext(sci): ...@@ -64,7 +57,7 @@ def Expression_createExprContext(sci):
Expression.createExprContext = Expression_createExprContext Expression.createExprContext = Expression_createExprContext
def StateChanceInfo_getHistory(self): def StateChangeInfo_getHistory(self):
wf = self.workflow wf = self.workflow
if getattr(wf, 'getTypeInfo'): if getattr(wf, 'getTypeInfo'):
tool = wf.getPortalObject().portal_workflow tool = wf.getPortalObject().portal_workflow
...@@ -78,5 +71,5 @@ def StateChanceInfo_getHistory(self): ...@@ -78,5 +71,5 @@ def StateChanceInfo_getHistory(self):
else: else:
return () return ()
StateChangeInfo.getHistory = StateChanceInfo_getHistory StateChangeInfo.getHistory = StateChangeInfo_getHistory
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