From a45e1ad3e3429118cb742b2fbcd4b52a26a90ff9 Mon Sep 17 00:00:00 2001 From: Marc Berger Date: Wed, 27 Sep 2023 16:04:10 +0200 Subject: [PATCH 1/3] EventSubProcess for error treatment should not be searched in children --- .../bpmn/model/FlowElementsContainer.java | 4 ++++ .../org/flowable/bpmn/model/SubProcess.java | 20 +++++++++++++++++++ .../impl/bpmn/helper/ErrorPropagation.java | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/FlowElementsContainer.java b/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/FlowElementsContainer.java index 2890b69bcc3..657225fe14c 100644 --- a/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/FlowElementsContainer.java +++ b/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/FlowElementsContainer.java @@ -20,6 +20,10 @@ */ public interface FlowElementsContainer { + + //Custom PROTOOLS: + FlowElement getFlowElement(String flowElementId, boolean searchRecursive); + FlowElement getFlowElement(String id); Collection getFlowElements(); diff --git a/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/SubProcess.java b/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/SubProcess.java index ee02cd8eea8..c83de3d5c3e 100644 --- a/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/SubProcess.java +++ b/modules/flowable-bpmn-model/src/main/java/org/flowable/bpmn/model/SubProcess.java @@ -33,6 +33,26 @@ public class SubProcess extends Activity implements FlowElementsContainer { protected List artifactList = new ArrayList<>(); protected List dataObjects = new ArrayList<>(); + + //Custom PROTOOLS: + @Override + public FlowElement getFlowElement(String flowElementId, boolean searchRecursive) { + if (searchRecursive) { + return flowElementMap.get(flowElementId); + } else { + return findFlowElementInList(flowElementId); + } + } + protected FlowElement findFlowElementInList(String flowElementId) { + for (FlowElement f : flowElementList) { + if (f.getId() != null && f.getId().equals(flowElementId)) { + return f; + } + } + return null; + } + //END CUSTOM + @Override public FlowElement getFlowElement(String id) { FlowElement foundElement = null; diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java index 90d1b02af43..90fd615d3e7 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java @@ -160,7 +160,7 @@ protected static void executeCatch(Map> eventMap, DelegateEx String refActivityId = refId.substring(0, refId.indexOf('#')); String refProcessDefinitionId = refId.substring(refId.indexOf('#') + 1); if (parentExecution.getProcessDefinitionId().equals(refProcessDefinitionId) && - currentContainer.getFlowElement(refActivityId) != null) { + currentContainer.getFlowElement(refActivityId,false) != null) { matchingEvent = getCatchEventFromList(events, parentExecution); String errorCode = getErrorCodeFromErrorEventDefinition(matchingEvent); From b446620ba3f6c0901c9cb9bde0700039de77f415 Mon Sep 17 00:00:00 2001 From: BERGER Marc Date: Wed, 27 Sep 2023 19:17:17 +0200 Subject: [PATCH 2/3] Update modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java Co-authored-by: David B Malkovsky --- .../org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java index 90fd615d3e7..e5babf0a71d 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java @@ -160,7 +160,7 @@ protected static void executeCatch(Map> eventMap, DelegateEx String refActivityId = refId.substring(0, refId.indexOf('#')); String refProcessDefinitionId = refId.substring(refId.indexOf('#') + 1); if (parentExecution.getProcessDefinitionId().equals(refProcessDefinitionId) && - currentContainer.getFlowElement(refActivityId,false) != null) { + currentContainer.getFlowElement(refActivityId, false) != null) { matchingEvent = getCatchEventFromList(events, parentExecution); String errorCode = getErrorCodeFromErrorEventDefinition(matchingEvent); From e58b30d4a77d1241870e5b04a7633e6a06e4997d Mon Sep 17 00:00:00 2001 From: Marc Berger Date: Thu, 7 Mar 2024 14:34:44 +0100 Subject: [PATCH 3/3] Avoid an exception as pathInfo can be null --- .../service/api/repository/DeploymentResourceResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceResource.java index 7e75639cea2..3448c1a2458 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceResource.java @@ -83,8 +83,8 @@ public DeploymentResourceResponse getDeploymentResource(@ApiParam(name = "deploy restApiInterceptor.accessDeploymentById(deployment); } - String pathInfo = request.getPathInfo(); - String resourceName = pathInfo.replace("/repository/deployments/" + deploymentId + "/resources/", ""); + String ressourceURI = request.getRequestURI(); + String resourceName = ressourceURI.replace(request.getContextPath()+"/repository/deployments/" + deploymentId + "/resources/", ""); List resourceList = repositoryService.getDeploymentResourceNames(deploymentId);