Search code examples
ibm-cloudbusiness-rules

How do I verify the correct input payload format for the Business Rules on Bluemix?


I want to make sure that the payload I pass to the ruleset request for the Business Rules service on Bluemix is correctly formed. How do I do so?


Solution

  • I used the following GET request on the URL to generate a JSON payload: https://brsv2-12345678.ng.bluemix.net/DecisionService/rest/MyRuleApp/2.0/myrules/1.0/json

    For an XML payload, I used the following: I used the following GET request on the URL to generate a XML payload: https://brsv2-12345678.ng.bluemix.net/DecisionService/rest/MyRuleApp/2.0/myrules/1.0/xml

    I was able to do the same from the Bluemix console. I used the Decision Services tab of the Business Rules service instance, and clicked on the arrow beside the ruleset with the tooltip "Test your service". This displayed a "Decision Request". I chose the JSON format and the corresponding sample payload data was generated under "Decision Request". I could have also chosen the XML format.

    I pasted the input data payload I was working with and clicked on "Run Test" to ensure my input data was also correctly formed. If it was incorrectly formed, I got an "Unable to run test" error, whose details showed what was incorrect.