We have setup Drools Workbench Showcase and KIE Execution Server Showcase from the Docker images available.
Drools Workbench Showcase version 7.2.0.
We are trying to use stateful KIESession with Runtime Strategy as PER_REQUEST, since we want to create a new kie-session for each request and destroy the kie-session after the request is completed.
We changed the runtime strategy from process configuration from SINGLETON to PER_REQUEST.

After saving these changes and making an API request to KIE Execution Server, we are getting the same functionality as Singleton.
The rule I have is:
package com.********.testrequest;
rule "Test count"
when
$p : Product()
accumulate(Product(); $cnt: count())
then
$p.setCount($cnt);
end
My request body is as following:
{
"lookup": "session",
"commands": [
{
"insert": {
"out-identifier": "125",
"object": {
"com.********.testrequest.Product": {
"id": "123",
"name": "drools 1",
"count": 0
}
},
"return-object": "true"
}
},
{
"insert": {
"out-identifier": "126",
"object": {
"com.********.testrequest.Product": {
"id": "123",
"name": "drools 2",
"count": 0
}
},
"return-object": "true"
}
},
{"fire-all-rules": "rule1"}
]
}
My expectation here is that for every post request, the count attribute of each inserted object should be set to 2. But that is not happening. With every new request number of objects inserted before is persistent in session and the session is not getting destroyed.
I may be missing some configurations here or my request body is not correct. Please suggest where I am going wrong.
The KIE Execution Server container config can be found below.
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<response type="SUCCESS" msg="Info for container TestRequest:1.0.24">
<kie-container container-alias="" container-id="TestRequest:1.0.24" status="STARTED">
<config-items>
<itemName>KBase</itemName>
<itemValue>kbase</itemValue>
<itemType>BPM</itemType>
</config-items>
<config-items>
<itemName>KSession</itemName>
<itemValue>ksession</itemValue>
<itemType>BPM</itemType>
</config-items>
<config-items>
<itemName>MergeMode</itemName>
<itemValue>MERGE_COLLECTIONS</itemValue>
<itemType>BPM</itemType>
</config-items>
<config-items>
<itemName>RuntimeStrategy</itemName>
<itemValue>PER_REQUEST</itemValue>
<itemType>BPM</itemType>
</config-items>
<messages>
<content>
Unable to create image reference for container TestRequest:1.0.24 by extension jBPM-UI KIE Server extension due to null
</content>
<severity>WARN</severity>
<timestamp>2017-12-08T15:09:35.030Z</timestamp>
</messages>
<messages>
<content>
Container TestRequest:1.0.24 successfully created with module TestRequest:1.0.1.
</content>
<severity>INFO</severity>
<timestamp>2017-12-08T15:09:35.044Z</timestamp>
</messages>
<release-id>
<artifact-id>TestRequest</artifact-id>
<group-id>com.********</group-id>
<version>1.0.1</version>
</release-id>
<resolved-release-id>
<artifact-id>TestRequest</artifact-id>
<group-id>com.********</group-id>
<version>1.0.1</version>
</resolved-release-id>
<scanner status="DISPOSED"/>
</kie-container>
</response>