You view the ruleset and test it in the Rule Execution Server console.
About this task
You test your ruleset in REST by using the OpenAPI.
Procedure
- Open the Rule Execution Server console by switching to
the Samples Console perspective and clicking Rule Execution Server console in the Sample Server
view. You use the console in the remaining tasks of the tutorial.
- Log in by using resAdmin as the user name and password.
- Click the Explorer tab. In the Navigator pane,
expand the RuleApps.
- Expand /PreTradeChecksRuleApp/1.0, and click
PreTradeChecks/1.0.
- In the Ruleset View page, click Retrieve HTDS Description
File.
- Select REST in the Service protocol type field,
and select the Open API - JSON option.
- Select the Decision trace information option, and then click
Test.
- Set the customer parameter as shown in the following text:
"customerParameter": {
"name": "John Smith",
"owner": "George Smith@IBM",
"initialValue": 2000,
"currentValue": 800,
"sectorPosition": 800,
"bankStockPosition": 800,
"oilStockPosition": 800,
"railStockPosition": 800,
"bondPosition": 800,
"futurPosition": 800,
"stockPosition": 800,
"currency": "EURO"
},
- Set the order parameter as shown in the following text:
"orderParameter": {
"id": "string",
"stock":
"Company X",
"amount": 90,
"exchange": "Nouveau Marche",
"currency": "EURO",
"destination": "France",
"action": "BUY",
"securityType": "STOCK",
"dateTime": "2004-02-14T19:44:14.000+0000",
"sector": "OIL",
"status": "PENDING",
"reasons": "BAD_CLIENT"
},
- Set the trace parameters that are described by TraceFilter. Set the none and infoTotalRulesFired parameters to
true. Set the rest of the trace parameters to false.
- Click the Execute Request button, and check the Server
Response section:
{
"__decisionTrace__": {
"totalRulesFired": 4
},
"__DecisionID__": "string",
"reportParameter": {
"id": "string",
"stock": "Company X",
"amount": 90,
"exchange": "Nouveau Marche",
"currency": "EURO",
"destination": "France",
"action": "BUY",
"securityType": "STOCK",
"dateTime": "2004-02-14T19:44:14.000+0000",
"sector": "OIL",
"status": "BLOCKED",
"reasons": "BLACK_LIST_STOCKS" }}
The trace shows that four rules were run. The order status was blocked because of
BlackListStocks.
What to do next
In the next task, you continue working in the
Rule Execution Server console. You retrieve an OpenAPI description
and call the service in a generated client.