0
votes

I want to call drools via kie server per REST-Call. I created a container with runtime strategy "Singleton" without Kie Basis Name and without Kie Session Name.

Here is my rest call: - URL: http://10.199.0.211:8080/kie-server-6.5.0.Final-ee7/services/rest/server/containers/instances/test1 - Authorization: basic - Header: Content-Type: application/xml Body:

<batch-execution lookup="defaultKieSession">
<insert out-identifier="message" return-object="true" entrypoint="DEFAULT">
<de.salt.d4s.test2.test2.input>
<order>1</order>
</de.salt.d4s.test2.test2.input>
</insert><fire-all-rules></fire>
</batch-execution>

I get this result:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="FAILURE" msg="Error calling container test1: Session 
'defaultKieSession' not found on container 'test1'."/>

I tried to do this with a "kie session name" in process-configuration but got the same error.

What can I do to solve this?

Thank you! Michael

1

1 Answers

0
votes

Check if, in the directory resources/META-INF, the file kmodule.xml contains a default ksession, if not you can place it:

<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <kbase name="myBase" default="true">
    <ksession name="mySession" type="stateless" default="true" clockType="realtime"/>
    <ksession name="mySession2" default="true" clockType="realtime"/>
  </kbase>
</kmodule>

For more details about the xml values you can take a look here: https://docs.jboss.org/drools/release/6.2.0.CR3/drools-docs/html/KIEChapter.html#d0e1533