-
Bug
-
Resolution: Done
-
Critical
-
6.1.0
+++ This bug was initially created as a clone of Bug #1245616 +++
Description of problem:
When PerProcessInstance strategy is used and GetProcessInstanceByCorrelationKeyCommand is sent to /execute endpoint via REST then following exception is raised:
[org.drools.persistence.SingleSessionCommandService] (http-/127.0.0.1:8080-3) Could not commit session: java.lang.IllegalStateException: Invalid session was used for this context org.kie.internal.runtime.manager.context.ProcessInstanceIdContext@79f8494f
Version-Release number of selected component (if applicable):
6.1.1
How reproducible:
always
Steps to Reproduce:
1. Start any process StartCorrelatedProcessCommand
2. Try to get this process with GetProcessInstanceByCorrelationKeyCommand
Process definition can be the simplest one.
I have used following exact commands (sent to /execute endpoint):
https://gist.github.com/anonymous/36173d7009da03b46f55
Actual results:
Exception is raised when GetProcessInstanceByCorrelationKeyCommand is used via REST with PerProcessInstance strategy
Expected results:
Corresponding process should be correctly returned when GetProcessInstanceByCorrelationKeyCommand is used via REST API
Additional info:
This may be caused by the fact, that behind the scenes the wrong context is used for obtaining the RuntimeEngine, i.e. maybe something like this:
manager.getRuntimeEngine(ProcessInstanceIdContext.get())
while this one should be used instead:
manager.getRuntimeEngine(CorrelationKeyContext.get(key)) when CorrelationKey related commands are used.