Skip to content

Commit

Permalink
[JBPM-10233] Using original list of nodes for dispatching (#2424)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado authored Jun 11, 2024
1 parent 492f41a commit 2ed7d56
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ public void signalEvent(String type, Object event) {


try {
List<NodeInstance> currentView = getNodeInstances().stream().map(e -> (NodeInstance) e)
.collect(Collectors.toList());
this.activatingNodeIds = new ArrayList<>();
List<EventListener> listeners = eventListeners.get(type);
if (listeners != null) {
Expand All @@ -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()) {
Expand Down Expand Up @@ -737,8 +740,8 @@ public void signalEvent(String type, Object event) {
}
}

private void signal(NodeInstanceContainer container, Function<Node,NodeInstance> nodeInstanceSupplier, Supplier<Node[]> resolveNodes, String type, Object event) {
List<NodeInstance> currentView = container.getNodeInstances().stream().map(e -> (NodeInstance) e).collect(Collectors.toList());
private void signal(List<NodeInstance> currentView, Function<Node, NodeInstance> nodeInstanceSupplier,
Supplier<Node[]> resolveNodes, String type, Object event) {
for (Node node : resolveNodes.get()) {
if (node instanceof EventNodeInterface
&& ((EventNodeInterface) node).acceptsEvent(type, event, getEventFilterResolver(this, node, currentView))) {
Expand Down

0 comments on commit 2ed7d56

Please sign in to comment.