Commit a8361d4f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* Reimplement Delivery_solveDivergenceAutomatically by using Solver Process...

* Reimplement Delivery_solveDivergenceAutomatically by using Solver Process Tool's API instead of ad-hoc way.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36749 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6dcd000a
...@@ -53,41 +53,15 @@ ...@@ -53,41 +53,15 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>delivery = context\n
solver_process_tool = delivery.getPortalObject().portal_solver_processes\n
delivery = context\n # XXX We sometimes want to store solver process document persistently.\n
\n solver_process = solver_process_tool.newSolverProcess(delivery, temp_object=True)\n
portal = delivery.getPortalObject()\n solver_process.buildTargetSolverList()\n
solver_tool = portal.portal_solvers\n solver_process.solve()\n
solver_process_tool = portal.portal_solver_processes\n # XXX It can be required to wait indexing.\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
target_solver = solver_process.newContent(\n
portal_type=solver.getId(),\n
delivery=simulation_movement.getRelativeUrl()\n
)\n
# Calculate and pass default values.\n
target_solver.updateConfiguration(\n
**solver.getDefaultConfigurationPropertyDict(target_solver))\n
solver_process.solve()\n
\n
delivery.updateCausalityState(solve_automatically=False)\n delivery.updateCausalityState(solve_automatically=False)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -134,22 +108,9 @@ delivery.updateCausalityState(solve_automatically=False)\n ...@@ -134,22 +108,9 @@ delivery.updateCausalityState(solve_automatically=False)\n
<string>context</string> <string>context</string>
<string>delivery</string> <string>delivery</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string>
<string>solver_tool</string>
<string>solver_process_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>True</string>
<string>solver_list</string>
<string>len</string>
<string>_getitem_</string>
<string>solver_process</string> <string>solver_process</string>
<string>solver</string>
<string>target_solver</string>
<string>_apply_</string>
<string>False</string> <string>False</string>
</tuple> </tuple>
</value> </value>
......
2010-06-30 kazuhiko 2010-06-30 kazuhiko
* Reimplement Delivery_solveDivergenceAutomatically by using Solver Process Tool's API instead of ad-hoc way.
* Move Solver Decision portal type from the experimental erp5_simulation business template to the erp5_base business template. * Move Solver Decision portal type from the experimental erp5_simulation business template to the erp5_base business template.
* Calculate and pass default values to automatic solvers. * Calculate and pass default values to automatic solvers.
* Add fallback scripts for target solvers' default configuration values. * Add fallback scripts for target solvers' default configuration values.
......
785 786
\ No newline at end of file \ 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