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 @@ ...@@ -94,7 +94,7 @@
<string>my_matched_portal_type_list</string> <string>my_matched_portal_type_list</string>
<string>my_matched_simulation_state_list</string> <string>my_matched_simulation_state_list</string>
<string>my_matched_validation_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_name</string>
<string>my_action</string> <string>my_action</string>
<string>my_icon</string> <string>my_icon</string>
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>display_width</string> <string>items</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_matched_causality_state</string> </value> <value> <string>my_matched_causality_state_list</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -57,6 +61,20 @@ ...@@ -57,6 +61,20 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </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> </dictionary>
</value> </value>
</item> </item>
...@@ -64,18 +82,24 @@ ...@@ -64,18 +82,24 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value> <value> <string>my_parallel_list_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </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> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Matched Causality State</string> </value> <value> <string>Matched Causality State</string> </value>
...@@ -86,4 +110,17 @@ ...@@ -86,4 +110,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</item> </item>
<item> <item>
<key> <string>multivalued</string> </key> <key> <string>multivalued</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
...@@ -463,22 +463,11 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -463,22 +463,11 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if key == 'portal_type': if key == 'portal_type':
worklist.setMatchedPortalTypeList(values) worklist.setMatchedPortalTypeList(values)
elif key == 'simulation_state': elif key == 'simulation_state':
state_id_list = [] worklist.setMatchedSimulationStateList(values)
for value in values:
state_id = 'state_'+value
state_id_list.append(state_id)
worklist.setMatchedSimulationStateList(state_id_list)
elif key == 'validation_state': elif key == 'validation_state':
state_id_list = [] worklist.setMatchedValidationStateList(values)
for value in values:
state_id = 'state_'+value
state_id_list.append(state_id)
worklist.setMatchedValidationStateList(state_id_list)
elif key == 'causality_state': elif key == 'causality_state':
state_id_list = [] worklist.setMatchedCausalityState(values)
for value in values:
state_id = value
worklist.setMatchedCausalityState(state_id)
else: else:
# dynamic variable. # dynamic variable.
worklist_variable_value = worklist.newContent(portal_type='Worklist 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