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 d99a6d4672..b7c829cc83 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))) {