Bug 1245723 - [GSS] (6.1.z) REST API is using wrong context for Correlation Key related commands
Summary: [GSS] (6.1.z) REST API is using wrong context for Correlation Key related com...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: CR1
: 6.1.0
Assignee: Shelly McGowan
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On: 1245616 1247639
Blocks: bpms6.1.3-payload
TreeView+ depends on / blocked
 
Reported: 2015-07-22 15:15 UTC by Martin Weiler
Modified: 2020-03-27 20:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1245616
Environment:
Last Closed: 2020-03-27 20:10:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Weiler 2015-07-22 15:15:15 UTC
+++ 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.

Comment 8 Ivo Bek 2015-09-02 11:01:06 UTC
Verified in BPM Suite 6.1.3.CR1


Note You need to log in before you can comment on or make changes to this bug.