From 9f5aa9c8be4301c57a457ea03f0b6c34137db133 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 18 Nov 2016 08:42:56 +0100 Subject: [PATCH] add more documentation explain in comment why 'Done' is output when a workflow transition can be executed but the trigger is already there. --- views/bootstrap/class.ViewDocument.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index d04e3b181..4deaa1297 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -837,7 +837,18 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { foreach($transitions as $transition) { echo ""; if($latestContent->executeWorkflowTransitionIsAllowed($transition)) { - echo "Done"; + /* If this is reached, then the transition should have been executed + * but for some reason the next state hasn't been reached. This can + * be causes, if a transition which was previously already executed + * is about to be executed again. E.g. there was already a transition + * T1 from state S1 to S2 triggered by user U1. + * Then there was a second transition T2 from + * S2 back to S1. If the state S1 has been reached again, then + * executeWorkflowTransitionIsAllowed() will think that T1 could be + * executed because there is already a log entry saying, that U1 + * has triggered the workflow. + */ + echo "Done "; } $wkflogs = $latestContent->getWorkflowLog($transition); foreach($wkflogs as $wkflog) {