json-rule-editor
Advanced concepts of json-rules-engine
json rules engine provides other feature to load the input fact value aynchronously from remote system via api. Go through the advance concepts explained in detail here to understand better.
We will take the same example “Employee-Salary” to handle path parameter. Lets assume, designation
, experience
and type
fact values are coming via api.
Step by Step process explained below to add path parameter along with facts in decisions
Step1: Add object reference
- Go to Facts tab
- Click Add icon at right corner of tool bar.
- Specify the fact object name and select object as type
-
Click Add facts button
Step2: Add path parameter reference
- Go to Decisions tab
- Click Add icon at right corner of tool bar.
- Select all / any in “Step 1: Add Toplevel”
- Select Add facts menu in “Step 2: Add / Remove facts”
- Select Add path icon at top right corner of panel.
-
Give fact object name, operator, value along with path parameter as below
-
Add other facts with path parameter
- Click Add Rulecase button
Caution
You can’t validate such path parameter decisions in our rule editor though, because these values are coming from real time api, so its not possible to retrieve and validate such decisions in this tool.
Add more parameters in output
Sometimes, it would make sense to add more values along with output value. In order to add extra values, you can click ‘Add Params’ icon in output panel. You can add any number of key value pairs along with the output type.
Examples
Couple of sample examples are available here under examples folder. Play with these files by importing it into rule editor.
Feel free to raise issues or concerns in github or contact here vinzdeveloper@gmail.com. Happy to look into your concerns!!