From 951d4d0ab0040ce5412760a162d2cbd18d0b0bcc Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 2 Oct 2015 08:32:54 +0200 Subject: [PATCH] BpNode: calculate latest state change --- library/Businessprocess/BpNode.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index 791090d..19f1722 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -156,9 +156,13 @@ class BpNode extends Node protected function calculateState() { $sort_states = array(); + $lastStateChange = 0; foreach ($this->getChildren() as $child) { $sort_states[] = $child->getSortingState(); + $lastStateChange = max($lastStateChange, $child->getLastStateChange()); } + $this->setLastStateChange($lastStateChange); + switch ($this->operator) { case self::OP_AND: $sort_state = max($sort_states);