Request and response schema

In the REST service for ruleset execution, requests and responses follow specific schemas, depending on whether the ruleset XOM is based on XML classes or on Java™ classes. The schema determines how the types are serialized.

The request and response schema results from the signature of the target ruleset.
  • The request part is composed of the following elements:
    • The IN and INOUT parameters of the ruleset, in alphabetical order.
    • Optionally, a decision ID if you want to set it to a specific value.
    • Optionally, a trace filter.
  • The response part is composed of the following elements:
    • The INOUT and OUT parameters of the ruleset, in alphabetical order.
    • The decision ID: either the default identifier or the value that you set in the request.
    • The returned trace, depending on the filter that you set in the request.

The XML payload is analyzed against the generated XSD files. The execution response is sent in the same format as the execution request (XML or JSON).

XML request validation

The validation response is returned in JSON format:
  • If the request is valid, the response is an empty JSON list [].
  • If the request is invalid, the tool returns the list of errors. Each error contains the following fields:
    • Type: the type of the error. Possible values are "Error", "Fatal" and "Warning".
    • Line: the number of the line that contains the error in the .xml file
    • Column: the number of the column that contains the error in the .xml file
    • Message: the error message itself
The JSON payload cannot be validated.
Here are examples of error messages:
{"type": "Error", "line": 8, "column": 32, "message": "cvc-datatype-valid.1.2.1: 'falseee' is not a valid value for 'boolean'."}
{"type": "Error", "line": 9, "column": 22, "message": "cvc-datatype-valid.1.2.1: '5d' is not a valid value for 'integer'."}
 {"type": "Fatal", "line": 39, "column": 24, "message": "The element type \"par:longParam\" must be terminated by the matching end-tag \"</par:longParam>\"."}