Commit d9890cc1 authored by Sebastien Robin's avatar Sebastien Robin

use getExpandablePropertyDict instead of getUpdatablePropertyDict

getUpdatablePropertyDict was already used to know which properties
asComposedDocument need to generate. So we need another method name
to copy properties for the composed document to simulation movement
parent 1e793532
......@@ -120,7 +120,11 @@ def _getPropertyDict(document, updating_tester_list=None):
assert updating_tester_list is not None
property_dict = {}
for tester in updating_tester_list:
property_dict.update(tester.getUpdatablePropertyDict(document, None))
property_dict.update(tester.getExpandablePropertyDict(document))
# causality and trade phase are controled by business process, not rules,
# so they are not availables as part of updating tester list
for property_id in ("causality", "trade_phase"):
property_dict.update(**{property_id: document.getPropertyList(property_id)})
return property_dict
def _getPropertyList(document, acquire=True):
......
......@@ -124,6 +124,14 @@ class IEquivalenceTester(Interface):
decision_movement -- a delivery movement (decision)
"""
def getExpandablePropertyDict(input_movement):
"""
Returns a list of properties coming from input movement to
update on simulation movement
input_movement -- a prevision movement
"""
def update(prevision_movement, decision_movement):
"""
Updates decision_movement with properties from
......
......@@ -212,3 +212,10 @@ class EquivalenceTesterMixin:
tested_property = self.getTestedProperty()
return {tested_property: self._getTestedPropertyValue(prevision_movement,
tested_property)}
def getExpandablePropertyDict(self, input_movement):
"""
By default, the result of getUpdatableMovement is doing exactly what
we need
"""
return self.getUpdatablePropertyDict(input_movement, None)
\ 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