From 3ae9785b295b770dd52f82f1e7a94276b794bfc1 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:10:11 +0200 Subject: [PATCH] [JBPM-10233] Using original list of nodes for dispatching (#2424) --- .../instance/impl/WorkflowProcessInstanceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java index 4ced5937be..f90e8ff46d 100644 --- a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java +++ b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java @@ -694,6 +694,8 @@ public void signalEvent(String type, Object event) { try { + List currentView = getNodeInstances().stream().map(e -> (NodeInstance) e) + .collect(Collectors.toList()); this.activatingNodeIds = new ArrayList<>(); List listeners = eventListeners.get(type); if (listeners != null) { @@ -708,7 +710,8 @@ public void signalEvent(String type, Object event) { } } - signal(this, (node) -> this.getNodeInstance(node), () -> this.getWorkflowProcess().getNodes(), type, event); + signal(currentView, (node) -> this.getNodeInstance(node), () -> this.getWorkflowProcess().getNodes(), + type, event); if (((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic()) { for (Node node : getWorkflowProcess().getNodes()) { @@ -737,8 +740,8 @@ public void signalEvent(String type, Object event) { } } - private void signal(NodeInstanceContainer container, Function nodeInstanceSupplier, Supplier resolveNodes, String type, Object event) { - List currentView = container.getNodeInstances().stream().map(e -> (NodeInstance) e).collect(Collectors.toList()); + private void signal(List currentView, Function nodeInstanceSupplier, + Supplier resolveNodes, String type, Object event) { for (Node node : resolveNodes.get()) { if (node instanceof EventNodeInterface && ((EventNodeInterface) node).acceptsEvent(type, event, getEventFilterResolver(this, node, currentView))) {