0
votes

We referred the documentation "https://docs.jboss.org/drools/release/6.4.0.CR2/drools-docs/html/ch22.html" for executing the rules in the kie Server. We used the below steps

Executes operations and commands against the specified Container. You can send commands to this Container in the body of the POST request. For example, to fire all rules for Container with id MyRESTContainer (http://SERVER:PORT/CONTEXT/services/rest/server/containers/instances/MyRESTContainer), you would send the fire-all-rules command to it as shown below (in the body of the POST request):

xample 22.9. Example Server Request to fire all rules

But we did't get any response from the server.

    package com.myspace.test;

function String hello(String name){ 
  return "Hello " + name; 
}

function boolean isNameJoJo(String name){ 
  if(name == "Jo-Jo") 
    return true; 
  else 
    return false; 
}

    rule "Call function directly" 
    when 
  eval(isNameJoJo("Jo-Jo")) 
then 
 hello("isNameJoJo is true");
end

rule "Hello World Using A function defined in the DRL"
    when
    then
     hello("Georgina");

end

Output

  {
  "type" : "SUCCESS",
  "msg" : "Container test_2.0.0 successfully called.",
   "result" : {
    "execution-results" : {
      "results" : [ {
        "value" : 0,
        "key" : "Hello World Using A function defined in the DRL"
      } ],
       "facts" : [ ]
     }
   }
 }

Actually I want the output of the rule. ie, "Hello Georgina";

Can any one had any idea about this.

Appreciate your valuable thoughts.

1

1 Answers

0
votes

Try this as the body of the post request

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <fire-all-rules max="-1"/>