Commit 3c163c76 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

drop abandoned experimental code.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f41d235e
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
# Łukasz Nowak <luke@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Products.ERP5Type.Globals import InitializeClass
from Products.PythonScripts.Utility import allow_class
from AccessControl import ClassSecurityInfo
from Persistence import Persistent
class DivergenceSolutionDecision(Persistent):
"""Decision class
XXX-JPS DivergenceResolutionDecision ?
Represent decision took during solving divergence between reality and
simulation
Provides possibility to override movement's property value in case of
accepting decision with forcing.
Properties are two types - historical only and really used.
Historical only are for information traceability:
* delivery_solver_name
* target_solver_name
Really used shall impact property value of movement:
* divergence
* decision
* force_property
divergence
instance of DivergenceMessage
decision
string representing took decision:
* accept
* adopt
* split[**** why noy solve JPS-XXX)
delivery_solver_name
delivery solver used during taking decision
target_solver_name
target solver used during taking decision
force_property
If set, property on decision overrides
split_kw
Dictionary passed to TargetSolver in case of splitting. JPS-XXX why only for split
"""
meta_type = "DivergenceSolutionDecision"
security = ClassSecurityInfo()
security.declareObjectPublic() # FIXME need to be decided
# XXX: Is there any place to know all possible decisions?
ALLOWED_DECISION_TUPLE = ('accept', 'adopt', 'split')
def __repr__(self):
repr_str = '<%s object at 0x%x\n' % (self.__class__.__name__, id(self))
for prop in 'divergence', 'decision', 'delivery_solver_name', \
'target_solver_name', 'force_property':
repr_str += '%s = %r\n' % (prop, getattr(self, prop))
repr_str += '>'
return repr_str
def __init__(self, divergence, decision, delivery_solver_name=None,
target_solver_name=None, force_property=False, split_kw=None):
self.divergence = divergence
self.decision = decision
self.delivery_solver_name = delivery_solver_name
self.target_solver_name = target_solver_name
self.force_property = force_property
self.split_kw = split_kw
if not (self.decision in self.ALLOWED_DECISION_TUPLE):
raise ValueError(
'Decision %s is not supported' % self.decision)
InitializeClass(DivergenceSolutionDecision)
allow_class(DivergenceSolutionDecision)
...@@ -398,12 +398,6 @@ class Rule(Predicate, XMLObject): ...@@ -398,12 +398,6 @@ class Rule(Predicate, XMLObject):
else: else:
movement_value = movement.getProperty(k) movement_value = movement.getProperty(k)
if k not in ('quantity',) and v != movement_value: if k not in ('quantity',) and v != movement_value:
if movement.isPropertyForced(k):
# support compensation if not prevent_compensation
LOG('%s:%s' % (self.getRelativeUrl(), movement.getRelativeUrl()), WARNING,
'Property %s forced to stay as %r, even if wanted %r' % (k, movement.getProperty(k), v))
# DivergenceSolutionDecision mangle
continue
prop_dict.setdefault(k, v) prop_dict.setdefault(k, v)
# update movement lists # update movement lists
......
...@@ -102,8 +102,6 @@ def initialize( context ): ...@@ -102,8 +102,6 @@ def initialize( context ):
'WorkflowException') 'WorkflowException')
ModuleSecurityInfo('Products.ERP5.Document.Image').declarePublic( ModuleSecurityInfo('Products.ERP5.Document.Image').declarePublic(
'getSizeFromImageDisplay') 'getSizeFromImageDisplay')
ModuleSecurityInfo('Products.ERP5.DivergenceSolutionDecision') \
.declarePublic('DivergenceSolutionDecision')
# backward compatibility names # backward compatibility names
XML = None XML = None
......
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