Skip to content

Commit

Permalink
fix cancel event
Browse files Browse the repository at this point in the history
  • Loading branch information
elguardian committed Oct 29, 2024
1 parent b6fde6f commit 434aebc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public boolean acceptsEvent(String type, Object event, Function<String, Object>
return false;
}

logger.debug("This event is subscribed to a message type {} with payload {}", type, event);
if (resolver == null) {
return this.type.equals(type);
}

if (this.type.equals(type) && correlationManager != null && correlationManager.isSubscribe(messageRef)) {
logger.debug("This event is subscribed to a message type {} with payload {}", type, event);
if (event == null) {
logger.debug("This event is subscribed to a message ref {}", type);
logger.debug("Cannot compute subscription for messageref {} and type {}", messageRef, type);
return false;
}
CorrelationInstance messageCorrelation = correlationManager.computeCorrelationInstance(messageRef, event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.jbpm.process.instance.impl.Action;
import org.jbpm.workflow.instance.node.CompositeNodeInstance;
import org.kie.api.runtime.process.NodeInstance;
import org.kie.api.runtime.process.WorkflowProcessInstance;
import org.kie.api.runtime.process.NodeInstanceContainer;
import org.kie.kogito.internal.process.runtime.KogitoProcessContext;

public abstract class AbstractNodeInstanceAction implements Action, Serializable {
Expand All @@ -39,7 +39,7 @@ protected AbstractNodeInstanceAction(String attachedToNodeId) {

@Override
public void execute(KogitoProcessContext context) throws Exception {
WorkflowProcessInstance pi = context.getNodeInstance().getProcessInstance();
NodeInstanceContainer pi = context.getNodeInstance().getNodeInstanceContainer();
NodeInstance nodeInstance = findNodeByUniqueId(pi.getNodeInstances(), attachedToNodeId);
if (nodeInstance != null) {
execute(nodeInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

import org.drools.core.common.InternalAgenda;
import org.drools.core.common.ReteEvaluator;
Expand Down Expand Up @@ -100,11 +99,11 @@ public void internalTrigger(KogitoNodeInstance from, String type) {
.generateId()
.timerId(Long.toString(timer.getId()))
.expirationTime(createTimerInstance(timer))
.processInstanceId(getProcessInstance().getStringId())
.rootProcessId(getProcessInstance().getRootProcessId())
.rootProcessInstanceId(getProcessInstance().getRootProcessInstanceId())
.processId(getProcessInstance().getProcessId())
.rootProcessId(getProcessInstance().getRootProcessId())
.nodeInstanceId(Optional.ofNullable(from).map(KogitoNodeInstance::getStringId).orElse(null))
.processInstanceId(getProcessInstance().getStringId())
.nodeInstanceId(this.getId())
.build();
String jobId = jobService.scheduleProcessInstanceJob(jobDescription);
timerInstances.add(jobId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;

Expand Down Expand Up @@ -91,7 +90,7 @@ public void internalTrigger(KogitoNodeInstance from, String type) {
.rootProcessInstanceId(getProcessInstance().getRootProcessInstanceId())
.processId(getProcessInstance().getProcessId())
.rootProcessId(getProcessInstance().getRootProcessId())
.nodeInstanceId(Optional.ofNullable(from).map(KogitoNodeInstance::getStringId).orElse(null))
.nodeInstanceId(this.getId())
.build();
JobsService jobService = processRuntime.getJobsService();
String jobId = jobService.scheduleProcessInstanceJob(jobDescription);
Expand Down

0 comments on commit 434aebc

Please sign in to comment.