Unable to abort process instance with PerProcessInstance strategy using Java remote API

Solution Verified - Updated -

Issue

We are using the PerProcessInstance strategy, and we are capable of create instances with the java remote API, but we are not able to get or abort process instances.

Calling KieSession.abortProcessInstance(processInstanceId) fails with the following stacktrace:

DEBUG org.kie.services.client.api.command.AbstractRemoteCommandObject - Sending POST request with AbortProcessInstanceCommand to http://host:port/business-central/rest/runtime/com.redhat.bpms.examples:mortgage:1.2/execute
org.kie.services.client.api.command.exception.RemoteApiException: IllegalStateException thrown with message 'Invalid session was used for this context org.kie.internal.runtime.manager.context.ProcessInstanceIdContext@18dbb046':
java.lang.IllegalStateException: Invalid session was used for this context org.kie.internal.runtime.manager.context.ProcessInstanceIdContext@18dbb046
    at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager.validate(PerProcessInstanceRuntimeManager.java:142)
    at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:90)
    at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:273)
    at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:269)
    at org.jbpm.process.instance.ProcessRuntimeImpl.abortProcessInstance(ProcessRuntimeImpl.java:436)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.abortProcessInstance(StatefulKnowledgeSessionImpl.java:347)
    at org.drools.core.command.runtime.process.AbortProcessInstanceCommand.execute(AbortProcessInstanceCommand.java:47)
    at org.drools.core.command.runtime.process.AbortProcessInstanceCommand.execute(AbortProcessInstanceCommand.java:28)
...

The code works properly when using Singleton runtime manager strategy.

Environment

  • Red Hat JBoss BPM Suite
    • 6.0.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content