diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java index e0dbbf5ee99..740deb8a75f 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java @@ -184,7 +184,7 @@ private WorkflowElementIdentifier handleCompensation(RuleFlowNodeContainerFactor Transition transition = compensation.getState().getTransition(); compensation.handleTransitions(embeddedSubProcess, transition, compensation.getNode()); compensation.handleConnections(embeddedSubProcess); - return compensation.getNode().getNode().getId(); + return compensation.getOutgoingNode().getNode().getId(); } public void handleState() { @@ -335,6 +335,10 @@ private void connectEnd(RuleFlowNodeContainerFactory factory) { return node; } + public final NodeFactory getOutgoingNode() { + return outgoingNode; + } + public S getState() { return state; } diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json index 8c35b7c4fc6..18439b8bf9a 100644 --- a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json +++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json @@ -70,7 +70,18 @@ "errorRef": "OddException", "transition": "OddHandler" } - ] + ], + "transition": "compensating_even_more" + }, + { + "name": "compensating_even_more", + "usedForCompensation" : true, + "type": "parallel", + "branches": [ + {"name": "branch1", "actions" :[]}, + {"name": "branch2", "actions" :[]} + + ] }, { "name": "OddHandler", "type":"inject",