diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_solveDivergenceAutomatically.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_solveDivergenceAutomatically.xml index d38576394d49ed29a38431df224a1d421b51be4b..2e651df5e491234bf0757c053b777237d03ab898 100644 --- a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_solveDivergenceAutomatically.xml +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_solveDivergenceAutomatically.xml @@ -75,11 +75,13 @@ if len(solver_movement_list) > 0:\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 + # 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 @@ -147,6 +149,7 @@ delivery.updateCausalityState(solve_automatically=False)\n <string>solver_process</string> <string>solver</string> <string>target_solver</string> + <string>_apply_</string> <string>False</string> </tuple> </value> diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Solver_getDefaultConfigurationPropertyDict.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Solver_getDefaultConfigurationPropertyDict.xml new file mode 100644 index 0000000000000000000000000000000000000000..84a29d330f4b8f474dd4691c9b73fd86851ccbc6 --- /dev/null +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Solver_getDefaultConfigurationPropertyDict.xml @@ -0,0 +1,120 @@ +<?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># This script is just a fall back script returns nothing meaningful.\n +return {}\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>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/> + </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>Solver_getDefaultConfigurationPropertyDict</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Solver_getDefaultConfigurationPropertyListDict.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Solver_getDefaultConfigurationPropertyListDict.xml new file mode 100644 index 0000000000000000000000000000000000000000..1cb951c6cf25d047815e173e9fc3945f254dc785 --- /dev/null +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Solver_getDefaultConfigurationPropertyListDict.xml @@ -0,0 +1,120 @@ +<?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># This script is just a fall back script returns nothing meaningful.\n +return {}\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>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/> + </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>Solver_getDefaultConfigurationPropertyListDict</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Workflow_solveDivergenceAutomatically.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Workflow_solveDivergenceAutomatically.xml index da910fbb99ba4e389c7b762136394f241b318019..39a65a06e4ebec113fb4d0a184414f0400bbcdfd 100644 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Workflow_solveDivergenceAutomatically.xml +++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Workflow_solveDivergenceAutomatically.xml @@ -109,16 +109,15 @@ else:\n <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>getattr</string> + <string>None</string> <string>solver_tool</string> <string>solver_process_tool</string> <string>activate_kw</string> - <string>False</string> + <string>_apply_</string> </tuple> </value> </item> diff --git a/bt5/erp5_base/bt/change_log b/bt5/erp5_base/bt/change_log index 0dbdc182fed1e6d38f821291c343aa8b8929b13b..e389e291d303c73272c7a31bb56cf943889f36e1 100644 --- a/bt5/erp5_base/bt/change_log +++ b/bt5/erp5_base/bt/change_log @@ -1,3 +1,7 @@ +2010-06-30 kazuhiko +* Calculate and pass default values to automatic solvers. +* Add fallback scripts for target solvers' default configuration values. + 2010-06-29 kazuhiko * Move portal_solvers and portal_solver_processes from the experimental erp5_simulation business template to the erp5_base business template. diff --git a/bt5/erp5_base/bt/revision b/bt5/erp5_base/bt/revision index 17863f9c517816f36137e0d362ea558df53cde00..d0af645045d096707d6e694c9e18670b58def552 100644 --- a/bt5/erp5_base/bt/revision +++ b/bt5/erp5_base/bt/revision @@ -1 +1 @@ -782 \ No newline at end of file +783 \ No newline at end of file