Skip to content

Commit

Permalink
[JBPM-10233] Using original list of nodes for dispatching (#2424) (#2425
Browse files Browse the repository at this point in the history
)

Co-authored-by: Francisco Javier Tirado Sarti <[email protected]>
  • Loading branch information
github-actions[bot] and fjtirado authored Jun 18, 2024
1 parent 211671f commit 5a3f224
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 5a3f224

Please sign in to comment.