From 6c546ff77db74d64a830484db8f67012315b3b13 Mon Sep 17 00:00:00 2001 From: Hans Van Akelyen Date: Tue, 10 Dec 2024 10:17:47 +0100 Subject: [PATCH] add parent to logging pipeline, fixes #4690 --- .../hop/reflection/pipeline/xp/PipelineStartLoggingXp.java | 3 +++ .../hop/reflection/workflow/xp/WorkflowStartLoggingXp.java | 3 +++ .../main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/pipeline/xp/PipelineStartLoggingXp.java b/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/pipeline/xp/PipelineStartLoggingXp.java index 24db2210b40..304c28146fb 100644 --- a/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/pipeline/xp/PipelineStartLoggingXp.java +++ b/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/pipeline/xp/PipelineStartLoggingXp.java @@ -227,6 +227,9 @@ private synchronized void executeLoggingPipeline( LocalPipelineEngine loggingPipeline = new LocalPipelineEngine(loggingPipelineMeta, variables, pipeline); + // Link logged pipeline as parent + loggingPipeline.setParentPipeline(pipeline); + // Flag it as a logging pipeline so we don't log ourselves... // loggingPipeline.getExtensionDataMap().put(PIPELINE_LOGGING_FLAG, "Y"); diff --git a/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/workflow/xp/WorkflowStartLoggingXp.java b/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/workflow/xp/WorkflowStartLoggingXp.java index 96ea69291f4..858bcdc1a57 100644 --- a/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/workflow/xp/WorkflowStartLoggingXp.java +++ b/plugins/misc/reflection/src/main/java/org/apache/hop/reflection/workflow/xp/WorkflowStartLoggingXp.java @@ -191,6 +191,9 @@ private synchronized void executeLoggingPipeline( LocalPipelineEngine loggingPipeline = new LocalPipelineEngine(loggingPipelineMeta, variables, workflow); + // Linked logged workflow as parent + loggingPipeline.setParentWorkflow(workflow); + // Flag it as a logging pipeline so we don't log ourselves... // loggingPipeline.getExtensionDataMap().put(PipelineStartLoggingXp.PIPELINE_LOGGING_FLAG, "Y"); diff --git a/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java b/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java index e639d1a8d1f..155343b64e1 100644 --- a/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java +++ b/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java @@ -1207,7 +1207,7 @@ public static final Map getStateMap(PipelineMeta pipelineMeta) { public static final PipelineUnitTest getCurrentUnitTest(PipelineMeta pipelineMeta) { // When rendering a pipeline on a server status page we never have a current unit test // - if ("Server".equalsIgnoreCase(Const.getHopPlatformRuntime())) { + if (!"GUI".equalsIgnoreCase(Const.getHopPlatformRuntime())) { return null; } Map stateMap = getStateMap(pipelineMeta);