Commit 35e069e4 authored by Sebastien Robin's avatar Sebastien Robin

Workflow cleanup: review way to store workflow states associated to a worklist (part 2)

- before we had "getMatchedSimulationStateList()" returning ("state_ordered", "state_draft"), use now
  directly ("ordered", "draft")
- handle causality state in the same way as simulation state and validation state, like a multi value
parent 1c94ebb8
......@@ -157,27 +157,17 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject,
def getVarMatch(self, id):
""" return value of matched keys"""
matches = None
matches_ref_list = []
if id == 'portal_type':
v = self.getMatchedPortalTypeList()
if v: matches = tuple(v)
elif id in ['validation_state', 'simulation_state']:
elif id in ['validation_state', 'simulation_state', 'causality_state']:
if id == 'validation_state':
matches_id_list = self.getMatchedValidationStateList()
match_reference_list = self.getMatchedValidationStateList()
elif id == 'simulation_state':
matches_id_list = self.getMatchedSimulationStateList()
# Get workflow state's reference:
parent = self.getParentValue()
for state_id in matches_id_list:
state = getattr(parent, state_id, None)
if state is not None:
matches_ref_list.append(state.getReference())
else: matches_ref_list = matches_id_list
matches = tuple(matches_ref_list)
elif id == 'causality_state':
matches_id = self.getMatchedCausalityState()
matches_ref_list.append(matches_id)
matches = tuple(matches_ref_list)
match_reference_list = self.getMatchedSimulationStateList()
elif id == 'causality_state':
match_reference_list = self.getMatchedCausalityStateList()
matches = tuple(match_reference_list)
elif id:
# Local dynamic variable:
dynamic_variable = self._getOb('variable_'+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