This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new 77825112a6 Immediately log when action finished, fixes #6587 (#6589)
77825112a6 is described below

commit 77825112a67238d0fe43cf5c74731a7f5db72e8c
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Mon Feb 16 16:13:51 2026 +0100

    Immediately log when action finished, fixes #6587 (#6589)
---
 .../java/org/apache/hop/workflow/Workflow.java     | 34 ++++++++++------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/engine/src/main/java/org/apache/hop/workflow/Workflow.java 
b/engine/src/main/java/org/apache/hop/workflow/Workflow.java
index ce70bc20b7..b31e1546f5 100644
--- a/engine/src/main/java/org/apache/hop/workflow/Workflow.java
+++ b/engine/src/main/java/org/apache/hop/workflow/Workflow.java
@@ -680,16 +680,6 @@ public abstract class Workflow extends Variables
       return res;
     }
 
-    // If previous is not null then that action has finished
-    if (previous != null && log.isBasic()) {
-      log.logBasic(
-          BaseMessages.getString(
-              PKG,
-              "Workflow.Log.FinishedAction",
-              previous.getName(),
-              previousResult.isResult() + ""));
-    }
-
     // Start this action!
     if (log.isBasic()) {
       log.logBasic(
@@ -769,6 +759,7 @@ public abstract class Workflow extends Variables
 
       // Action execution duration
       newResult.setElapsedTimeMillis(System.currentTimeMillis() - start);
+      newResult.setEntryNr(nr);
 
       activeActions.remove(actionMeta);
 
@@ -776,6 +767,17 @@ public abstract class Workflow extends Variables
         actionListener.afterExecution(this, actionMeta, cloneAction, 
newResult);
       }
 
+      // Log action as finished as soon as its body has completed (action can 
no longer fail after
+      // this point)
+      if (log.isBasic()) {
+        log.logBasic(
+            BaseMessages.getString(
+                PKG,
+                "Workflow.Log.FinishedAction",
+                actionMeta.getName(),
+                newResult.isResult() + ""));
+      }
+
       Thread.currentThread().setContextClassLoader(cl);
       addErrors((int) newResult.getNrErrors());
 
@@ -950,10 +952,10 @@ public abstract class Workflow extends Variables
       }
     }
 
-    // Perhaps we don't have next transforms??
-    // In this case, return the previous result.
+    // Perhaps we don't have next actions??
+    // In this case, return the result of the action we just ran.
     if (res == null) {
-      res = prevResult;
+      res = newResult;
     }
 
     // See if there were any errors in the parallel execution
@@ -984,12 +986,6 @@ public abstract class Workflow extends Variables
     if (res.getNrErrors() > 0) {
       res.setResult(false);
     }
-    // Log the final action that has finished
-    if (res.getEntryNr() == nr && log.isBasic()) {
-      log.logBasic(
-          BaseMessages.getString(
-              PKG, "Workflow.Log.FinishedAction", actionMeta.getName(), 
res.isResult() + ""));
-    }
 
     return res;
   }

Reply via email to