Commit 5474c085 authored by iv's avatar iv

ERP5Workflow: revert changes on renaming default_expr

changes were also applied to DC workflow, which should not be changed
parent 1a946029
...@@ -168,9 +168,9 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): ...@@ -168,9 +168,9 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
if status is not None and status.has_key(name): if status is not None and status.has_key(name):
value = status[name] value = status[name]
# Not set yet. Use a default. # Not set yet. Use a default.
elif vdef.default_expression is not None: elif vdef.default_expr is not None:
ec = createExprContext(StateChangeInfo(ob, self, status)) ec = createExprContext(StateChangeInfo(ob, self, status))
value = vdef.default_expression(ec) value = vdef.default_expr(ec)
else: else:
value = vdef.default_value value = vdef.default_value
...@@ -271,8 +271,8 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): ...@@ -271,8 +271,8 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
# Preserve former value # Preserve former value
value = former_status[id] value = former_status[id]
else: else:
if vdef.default_expression is not None: if vdef.default_expr is not None:
expr = vdef.default_expression expr = vdef.default_expr
else: else:
value = vdef.default_value value = vdef.default_value
if expr is not None: if expr is not None:
...@@ -445,7 +445,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): ...@@ -445,7 +445,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
variable_reference_list = [] variable_reference_list = []
variable_id_list = sorted(self.variables.keys()) variable_id_list = sorted(self.variables.keys())
variable_prop_id_to_show = {'description':'text', variable_prop_id_to_show = {'description':'text',
'default_expression':'string', 'for_catalog':'int', 'for_status':'int', 'default_expr':'string', 'for_catalog':'int', 'for_status':'int',
'update_always':'int'} 'update_always':'int'}
for vid in variable_id_list: for vid in variable_id_list:
variable_reference_list.append(vid) variable_reference_list.append(vid)
...@@ -456,7 +456,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): ...@@ -456,7 +456,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
variable = SubElement(variables, 'variable', attrib=dict(reference=vdef.getReference(), variable = SubElement(variables, 'variable', attrib=dict(reference=vdef.getReference(),
portal_type='Variable')) portal_type='Variable'))
for property_id in sorted(variable_prop_id_to_show): for property_id in sorted(variable_prop_id_to_show):
if property_id == 'default_expression': if property_id == 'default_expr':
expression = getattr(vdef, property_id, None) expression = getattr(vdef, property_id, None)
if expression is not None: if expression is not None:
property_value = expression.text property_value = expression.text
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>default_expression</string> </key> <key> <string>default_expr</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
......
...@@ -145,29 +145,29 @@ def setupERP5Workflow(wf): ...@@ -145,29 +145,29 @@ def setupERP5Workflow(wf):
for v, property_dict in ( for v, property_dict in (
('action', { ('action', {
'description': 'Transition id', 'description': 'Transition id',
'default_expression': 'transition/getId|nothing', 'default_expr': 'transition/getId|nothing',
'for_status': 1, 'for_status': 1,
'update_always': 1, 'update_always': 1,
}), }),
('actor', { ('actor', {
'description': 'Name of the user who performed transition', 'description': 'Name of the user who performed transition',
'default_expression': 'user/getUserName', 'default_expr': 'user/getUserName',
'for_status': 1, 'for_status': 1,
'update_always': 1, 'update_always': 1,
}), }),
('comment', { ('comment', {
'description': 'Comment about transition', 'description': 'Comment about transition',
'default_expression': "python:state_change.kwargs.get('comment', '')", 'default_expr': "python:state_change.kwargs.get('comment', '')",
'for_status': 1, 'for_status': 1,
'update_always': 1, 'update_always': 1,
}), }),
('history', { ('history', {
'description': 'Provides access to workflow history', 'description': 'Provides access to workflow history',
'default_expression': 'state_change/getHistory', 'default_expr': 'state_change/getHistory',
}), }),
('time', { ('time', {
'description': 'Transition timestamp', 'description': 'Transition timestamp',
'default_expression': 'state_change/getDateTime', 'default_expr': 'state_change/getDateTime',
'for_status': 1, 'for_status': 1,
'update_always': 1, 'update_always': 1,
}), }),
......
...@@ -439,8 +439,8 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None): ...@@ -439,8 +439,8 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
# Preserve former value # Preserve former value
value = former_status[id] value = former_status[id]
else: else:
if vdef.default_expression is not None: if vdef.default_expr is not None:
expr = vdef.default_expression expr = vdef.default_expr
else: else:
value = vdef.default_value value = vdef.default_value
if expr is not None: if expr is not None:
...@@ -545,8 +545,8 @@ def _executeMetaTransition(self, ob, new_state_id): ...@@ -545,8 +545,8 @@ def _executeMetaTransition(self, ob, new_state_id):
# Preserve former value # Preserve former value
value = former_status[id] value = former_status[id]
else: else:
if vdef.default_expression is not None: if vdef.default_expr is not None:
expr = vdef.default_expression expr = vdef.default_expr
else: else:
value = vdef.default_value value = vdef.default_value
if expr is not None: if expr is not None:
...@@ -951,7 +951,7 @@ def DCWorkflowDefinition_showAsXML(self, root=None): ...@@ -951,7 +951,7 @@ def DCWorkflowDefinition_showAsXML(self, root=None):
variable_reference_list = [] variable_reference_list = []
variable_id_list = sorted(self.variables.keys()) variable_id_list = sorted(self.variables.keys())
variable_prop_id_to_show = {'description':'text', variable_prop_id_to_show = {'description':'text',
'default_expression':'string', 'for_catalog':'int', 'for_status':'int', 'default_expr':'string', 'for_catalog':'int', 'for_status':'int',
'update_always':'int'} 'update_always':'int'}
for vid in variable_id_list: for vid in variable_id_list:
variable_reference_list.append(vid) variable_reference_list.append(vid)
...@@ -962,7 +962,7 @@ def DCWorkflowDefinition_showAsXML(self, root=None): ...@@ -962,7 +962,7 @@ def DCWorkflowDefinition_showAsXML(self, root=None):
variable = SubElement(variables, 'variable', attrib=dict(reference=vdef.getReference(), variable = SubElement(variables, 'variable', attrib=dict(reference=vdef.getReference(),
portal_type='Variable')) portal_type='Variable'))
for property_id in sorted(variable_prop_id_to_show): for property_id in sorted(variable_prop_id_to_show):
if property_id == 'default_expression': if property_id == 'default_expr':
expression = getattr(vdef, property_id, None) expression = getattr(vdef, property_id, None)
if expression is not None: if expression is not None:
property_value = expression.text property_value = expression.text
......
...@@ -273,19 +273,19 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow): ...@@ -273,19 +273,19 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
id = vdef.getId() id = vdef.getId()
if not vdef.getForStatus(): if not vdef.getForStatus():
continue continue
expr = None expression = None
if id in tdef_exprs: if id in tdef_exprs:
expr = tdef_exprs[id] expression = tdef_exprs[id]
elif not vdef.getAutomaticUpdate() and id in former_status: elif not vdef.getAutomaticUpdate() and id in former_status:
# Preserve former value # Preserve former value
value = former_status[id] value = former_status[id]
else: else:
default_expression = vdef.getDefaultExpression() default_expression = vdef.getDefaultExpression()
if default_expression is not None: if default_expression is not None:
expr = Expression(default_expression) expression = Expression(default_expression)
else: else:
value = vdef.getInitialValue() value = vdef.getInitialValue()
if expr is not None: if expression is not None:
# Evaluate an expression. # Evaluate an expression.
if econtext is None: if econtext is None:
# Lazily create the expression context. # Lazily create the expression context.
...@@ -294,7 +294,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow): ...@@ -294,7 +294,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
ob, self, former_status, tdef, ob, self, former_status, tdef,
None, None, None) None, None, None)
econtext = createExprContext(sci) econtext = createExprContext(sci)
value = expr(econtext) value = expression(econtext)
status[id] = value status[id] = value
sci = StateChangeInfo( sci = StateChangeInfo(
......
...@@ -505,12 +505,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -505,12 +505,12 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
variable.setTitle(vdef.title) variable.setTitle(vdef.title)
variable.setReference(vdef.id) variable.setReference(vdef.id)
variable.setAutomaticUpdate(vdef.update_always) variable.setAutomaticUpdate(vdef.update_always)
if getattr(vdef, 'default_expression', None) is not None: if getattr(vdef, 'default_expr', None) is not None:
# for a very specific case, action return the reference of transition # for a very specific case, action return the reference of transition
# in order to generation correct workflow history. # in order to generation correct workflow history.
if vid == 'action': if vid == 'action':
variable.setDefaultExpression('transition/getReference|nothing') variable.setDefaultExpression('transition/getReference|nothing')
else: variable.setDefaultExpression(vdef.default_expression.text) else: variable.setDefaultExpression(vdef.default_expr.text)
if vdef.info_guard: if vdef.info_guard:
variable.info_guard = vdef.info_guard variable.info_guard = vdef.info_guard
variable.setRoleList(vdef.info_guard.roles) variable.setRoleList(vdef.info_guard.roles)
......
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