REST
Get started using the RESTful interface by pointing your app (a browser will do) at /rulesEngine/rest/applyRules and add a couple of parameters like:- ruleSet=Means Test
- income=900
- expenses=400
-> /rulesEngine/rest/applyRules?ruleSet=Means Test&facts=[{income:900,expenses:400}]
You can GET or POST your facts to the rules engine as JSON, and it will return a JSON map/object of the results.
If you're a masochist you can post the facts as (encoded) XML and get XML results. e.g.
<list>
<map>
<entry key="income">900</entry>
<entry key="expenses">400</entry>
</map>
</list>
If you use POST you can do a call as pure JSON or XML using the contentType e.g. application/json or text/xml. So you can just post {ruleSet: 'Questions', facts: [{code: '428606'}]} using contentType application/json then you'll get back a JSON response.Example of using JSON encoded post in the poster plugin for firefox.
To send a REST call as XML you'd sendthe following with the contentType set to text/xml.
<params>
<ruleSet>Means Test</ruleSet>
<facts>
<list>
<map>
<entry key="income">900</entry>
<entry key="expenses">300</entry>
</map>
</list>
</facts>
</params>
<ruleSet>Means Test</ruleSet>
<facts>
<list>
<map>
<entry key="income">900</entry>
<entry key="expenses">300</entry>
</map>
</list>
</facts>
</params>
Sending an XML REST request to One Ring via Poster.