From d0529b4aa5e311c66c1b19b4d11abb6957f038ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Andr=C3=A9?= Date: Sat, 20 Jun 2026 23:31:46 -0300 Subject: [PATCH] Refactor catch task executor creation to include position property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matheus André --- .../io/serverlessworkflow/impl/executors/TryExecutor.java | 4 +++- .../io/serverlessworkflow/impl/test/RetryTimeoutTest.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/impl/core/src/main/java/io/serverlessworkflow/impl/executors/TryExecutor.java b/impl/core/src/main/java/io/serverlessworkflow/impl/executors/TryExecutor.java index 00e765d5e..bd242bae5 100644 --- a/impl/core/src/main/java/io/serverlessworkflow/impl/executors/TryExecutor.java +++ b/impl/core/src/main/java/io/serverlessworkflow/impl/executors/TryExecutor.java @@ -79,7 +79,9 @@ protected TryExecutorBuilder( catchTaskDo != null && !catchTaskDo.isEmpty() ? Optional.of( TaskExecutorHelper.createExecutorList( - position.copy().addProperty("catch"), catchTaskDo, definition)) + position.copy().addProperty("try").addProperty("catch"), + catchTaskDo, + definition)) : Optional.empty(); Retry retry = catchInfo.getRetry(); this.retryIntervalExecutor = retry != null ? buildRetryInterval(retry) : Optional.empty(); diff --git a/impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java b/impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java index 909e4af61..e252cdcdb 100644 --- a/impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java +++ b/impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java @@ -164,7 +164,7 @@ void testRetryDo() throws IOException { assertThat(retryListener.taskCompleted.get("do/0/attemptTask/try")).isEqualTo((short) 0); assertThat(retryListener.taskCompleted) - .containsKey("do/0/attemptTask/catch/do/0/executeAfterFailingTask"); + .containsKey("do/0/attemptTask/try/catch/do/0/executeAfterFailingTask"); } @Test