Commit d9a0deeb authored by Jean-Paul Smets's avatar Jean-Paul Smets

Remove getBusinessProcessValue since this makes no sense in the context of...

Remove getBusinessProcessValue since this makes no sense in the context of multi BPM. It is redundant with asComposedDocument and/or asUnionBusinessProcess

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@36053 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 17213e0e
......@@ -34,12 +34,13 @@ from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5.mixin.explainable import ExplainableMixin
from Products.ERP5Legacy.Document.Rule import Rule
TREE_DELIVERED_CACHE_KEY = 'AppliedRule._isTreeDelivered_cache'
TREE_DELIVERED_CACHE_ENABLED = 'TREE_DELIVERED_CACHE_ENABLED'
class AppliedRule(XMLObject):
class AppliedRule(XMLObject, ExplainableMixin):
"""
An applied rule holds a list of simulation movements.
......@@ -189,46 +190,6 @@ class AppliedRule(XMLObject):
return self
return self.getParentValue().getRootAppliedRule()
def _getExplanationSpecialiseValue(self, portal_type_list):
"""Returns first found specialise value of delivery or order
In case if self is root Applied Rule uses causality
Otherwise uses delivery, than order of parent movements
Recurses to parents"""
def findSpecialiseValueBySimulation(movement):
specialise_value = None
if movement.getPortalType() != 'Simulation Movement':
return None
delivery, order = movement.getDeliveryValue(), movement.getOrderValue()
if delivery is not None:
specialise_value = delivery.getExplanationValue() \
.getRootSpecialiseValue(portal_type_list)
if specialise_value is not None:
return specialise_value
# 'order' category is deprecated. it is kept for compatibility.
if order is not None:
specialise_value = order.getExplanationValue() \
.getRootSpecialiseValue(portal_type_list)
if specialise_value is not None:
return specialise_value
return findSpecialiseValueBySimulation(movement.getParentValue() \
.getParentValue())
if self.getRootAppliedRule() == self:
return self.getCausalityValue() \
.getRootSpecialiseValue(portal_type_list)
movement = self.getParentValue()
return findSpecialiseValueBySimulation(movement)
security.declareProtected(Permissions.AccessContentsInformation,
'getBusinessProcessValue')
def getBusinessProcessValue(self):
"""Return the business process model that has been used in this
simulation, or None if none has been used.
"""
return self._getExplanationSpecialiseValue(
('Business Process',))
def _isTreeDelivered(self):
"""
Checks if submovements of this applied rule (going down the complete
......
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