Commit c0102399 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* Add automatic divergence solving function in delivery_causality_workflow.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36654 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8fb64136
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
delivery = context\n
\n
portal = delivery.getPortalObject()\n
solver_tool = portal.portal_solvers\n
solver_process_tool = portal.portal_solver_processes\n
\n
solver_movement_list = []\n
for tester, simulation_movement in delivery.getDivergentTesterAndSimulationMovementList():\n
solver_list = filter(lambda x:x.isAutomaticSolver(),\n
solver_tool.searchTargetSolverList(tester, simulation_movement, automatic_solver_only=True))\n
if len(solver_list) == 1:\n
solver_movement_list.append((solver_list[0], simulation_movement))\n
\n
if len(solver_movement_list) > 0:\n
# XXX We sometimes want to store solver process document persistently.\n
solver_process = solver_process_tool.newContent(\n
portal_type=\'Solver Process\', temp_object=True)\n
for solver, simulation_movement in solver_movement_list:\n
# XXX Do we need grouping here?\n
# XXX Do we need to split activities for each target solver?\n
# XXX We need to calculate and pass default values for some solvers\n
target_solver = solver_process.newContent(\n
portal_type=solver.getId(),\n
delivery=simulation_movement.getRelativeUrl()\n
)\n
solver_process.solve()\n
\n
delivery.updateCausalityState(solve_automatically=False)\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>context</string>
<string>delivery</string>
<string>_getattr_</string>
<string>portal</string>
<string>solver_tool</string>
<string>solver_process_tool</string>
<string>solver_movement_list</string>
<string>_getiter_</string>
<string>tester</string>
<string>simulation_movement</string>
<string>filter</string>
<string>True</string>
<string>solver_list</string>
<string>len</string>
<string>_getitem_</string>
<string>solver_process</string>
<string>solver</string>
<string>target_solver</string>
<string>False</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Delivery_solveDivergenceAutomatically</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>delivery = state_change[\'object\']\n
\n
portal = delivery.getPortalObject()\n
solver_tool = getattr(portal, \'portal_solvers\', None)\n
solver_process_tool = getattr(portal, \'portal_solver_processes\', None)\n
\n
if solver_tool is None or solver_process_tool is None:\n
delivery.diverge()\n
return\n
else:\n
activate_kw = state_change[\'kwargs\'].get(\'activate_kw\') or {}\n
delivery.activate(**activate_kw).Delivery_solveDivergenceAutomatically()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>state_change</string>
<string>delivery</string>
<string>getattr</string>
<string>_getattr_</string>
<string>None</string>
<string>portal</string>
<string>solver_tool</string>
<string>solver_process_tool</string>
<string>activate_kw</string>
<string>False</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Workflow_solveDivergenceAutomatically</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -33,6 +33,7 @@
<tuple>
<string>converge</string>
<string>diverge</string>
<string>solve_automatically</string>
<string>start_building</string>
</tuple>
</value>
......
......@@ -33,6 +33,7 @@
<tuple>
<string>converge</string>
<string>diverge</string>
<string>solve_automatically</string>
<string>solve_divergence</string>
<string>start_building</string>
</tuple>
......
......@@ -34,6 +34,7 @@
<string>calculate</string>
<string>converge</string>
<string>diverge</string>
<string>solve_automatically</string>
<string>solve_divergence</string>
<string>solve_divergence_action</string>
<string>split_and_defer</string>
......
......@@ -34,6 +34,7 @@
<string>calculate</string>
<string>converge</string>
<string>diverge</string>
<string>solve_automatically</string>
<string>start_building</string>
</tuple>
</value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>Workflow_solveDivergenceAutomatically</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>solve_automatically</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>solving</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Solve Automatically</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2010-06-28 kazuhiko
* Add automatic divergence solving function in delivery_causality_workflow.
2010-06-04 kazuhiko
* Do not invoke simulation_movement_causality_interaction_workflow/interactions/calculate_causality for temporary documents.
......
776
\ No newline at end of file
777
\ No newline at end of file
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