How to slim down the kie-server-client payload?

Solution Verified - Updated -

Issue

When using kie-server-client for interaction with the Decision Server it is possible to display the actual request being sent to the server. This can be useful if these requests has to be sent from other than Java client ( i.e. .NET application).

For example, following code:

KieServicesClient client =  KieServicesFactory.newKieServicesClient(config);
RuleServicesClient ruleClient = client.getServicesClient(RuleServicesClient.class);
List<GenericCommand<?>> commands = new ArrayList<GenericCommand<?>>();

commands.add((GenericCommand<?>) KieServices.Factory.get().getCommands().newInsert("MyInputFact"));
commands.add((GenericCommand<?>) KieServices.Factory.get().getCommands().newFireAllRules());

BatchExecutionCommand batchCommand = KieServices.Factory.get().getCommands().newBatchExecution(commands,session);
ServiceResponse<ExecutionResults> response = ruleClient.executeCommandsWithResults(container, batchCommand);

Will produce the this JSON payload:

{
  "lookup" : "statelessSession",
  "commands" : [ {
    "insert" : {
      "object" : "MyInputFact",
      "disconnected" : false,
      "out-identifier" : null,
      "return-object" : true,
      "entry-point" : "DEFAULT"
    }
  }, {
    "fire-all-rules" : {
      "max" : -1,
      "out-identifier" : null
    }
  } ]
}

Is it necessary to send all of these information for a successful request? Is it possible to somehow slim down this request and include only JSON/XML representation of serialised facts in the request?

Environment

  • Red Hat JBoss BRMS
    • 6.1+
  • Red Hat JBoss BPM Suite
    • 6.1+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content