Commit e9991c00 authored by Arnaud Fontaine's avatar Arnaud Fontaine

BusinessProcess: Fix getPreviousPhaseDict() for BL with >1 children/parents BLs.

Called by TransformationSimulationRule and did not work with the
following use case (where child_BL1):

  BL(trade_phase=TP1, successor=trade_state/TS1):
    * child_BL1(predecessor=trade_state/TS1,
                trade_phase=TP1/InventoryAccounting)
    * child_BL3(predecessor=trade_state/TS1,
                trade_phase=Transforming)
parent 260f1b00
......@@ -875,11 +875,15 @@ class BusinessProcess(Path, XMLObject):
# i.e. edit next phases to replace current phase by previous ones
for next in next_set:
phase_set = result[next]
phase_set.remove(phase)
# Not remove() as it may have already been removed earlier
# if >1 elements of next_set have the same parent
phase_set.discard(phase)
phase_set |= previous_set
# and previous phases to replace current by next ones
for previous in previous_set:
phase_set = next_dict[previous]
phase_set.remove(phase)
# Not remove() as it may have already been removed earlier
# if >1 elements of previous_set have the same child
phase_set.discard(phase)
phase_set |= next_set
return result
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