Commit 1c94ebb8 authored by Sebastien Robin's avatar Sebastien Robin

Workflow cleanup: review way to store workflow states associated to a worklist

- 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 bb203478
......@@ -94,7 +94,7 @@
<string>my_matched_portal_type_list</string>
<string>my_matched_simulation_state_list</string>
<string>my_matched_validation_state_list</string>
<string>my_matched_causality_state</string>
<string>my_matched_causality_state_list</string>
<string>my_action_name</string>
<string>my_action</string>
<string>my_icon</string>
......
......@@ -10,14 +10,14 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>display_width</string>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_matched_causality_state</string> </value>
<value> <string>my_matched_causality_state_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -42,6 +42,10 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -57,6 +61,20 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -64,18 +82,24 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_parallel_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Matched Causality State</string> </value>
......@@ -86,4 +110,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x.getTitle(), x.getReference()) for x in here.getParent().objectValues(portal_type=\'State\')]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -118,7 +118,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x.getTitle(), x.getId()) for x in here.getParent().objectValues(portal_type=\'State\')]</string> </value>
<value> <string>python: [(x.getTitle(), x.getReference()) for x in here.getParent().objectValues(portal_type=\'State\')]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -118,7 +118,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x.getTitle(), x.getId()) for x in here.getParent().objectValues(portal_type=\'State\')]</string> </value>
<value> <string>python: [(x.getTitle(), x.getReference()) for x in here.getParent().objectValues(portal_type=\'State\')]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -30,7 +30,7 @@
</item>
<item>
<key> <string>multivalued</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
......@@ -463,22 +463,11 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if key == 'portal_type':
worklist.setMatchedPortalTypeList(values)
elif key == 'simulation_state':
state_id_list = []
for value in values:
state_id = 'state_'+value
state_id_list.append(state_id)
worklist.setMatchedSimulationStateList(state_id_list)
worklist.setMatchedSimulationStateList(values)
elif key == 'validation_state':
state_id_list = []
for value in values:
state_id = 'state_'+value
state_id_list.append(state_id)
worklist.setMatchedValidationStateList(state_id_list)
worklist.setMatchedValidationStateList(values)
elif key == 'causality_state':
state_id_list = []
for value in values:
state_id = value
worklist.setMatchedCausalityState(state_id)
worklist.setMatchedCausalityState(values)
else:
# dynamic variable.
worklist_variable_value = worklist.newContent(portal_type='Worklist Variable',
......
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