Commit 27ba82bc authored by wenjie.zheng's avatar wenjie.zheng

Workflow.py: deploy accessor in getCatalogVariableFor.

parent 81a0c5b4
......@@ -1118,18 +1118,18 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
state_var = self.getStateVariable()
status = self.getCurrentStatusDict(ob)
for vdef_ref, vdef in self.getVariableValueList().iteritems():
if vdef.for_catalog:
if vdef.getForCatalog():
default_expr = vdef.getDefaultExpr()
if status.has_key(vdef_ref):
value = status[vdef_ref]
# Not set yet. Use a default.
elif vdef.default_expr is not None:
elif default_expr is not None:
ec = createExprContext(StateChangeInfo(ob, self, status))
# convert string to expression before execute it.
value = Expression(vdef.default_expr)(ec)
value = Expression(default_expr)(ec)
else:
value = vdef.default_value
res[vdef_ref] = value
value = vdef.getInitialValue()
if hasattr(self, 'getSourceValue'):
if self.getSourceValue() is not None:
initial_state = self.getSourceValue().getReference()
......
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