Business Rules in JSON. A standard, specification and schema.
We are currently in 0.x.x versioning: some core changes are still being pushed out. A version 1.0.0 will be released following best practices when identified as final.
A BRIJ compliant file is a JSON document that contains an array that is a list of objects for each of your rule definitions. In the simplest form, a BRIJ compliant document looks like this:
Each rule object in the array is defined by the following main properties:
- id: optional
- description: optional
- rule: required
- property: required
- condition: required
- actions: optional
Unless custom actions are defined, the engine should simply evaluate the defined rule as boolean true or false.
Defining a Rule
Custom function call
You'll probably want to validate that your rules are written correctly, so that an engine that adheres to the BRIJ specification can accurately parse, and evaluate your rules.
As a node library
npm install --save brij-spec
To validate your rule
var brijSpec = ;var result = brijSpec;
More likely though, you'll want to validate a file with your rules defined
var fs =brijSpec = ;var ruleData = fs;var result = brijSpec;
There is also a command line client for your convenience.
npm install -g brij-spec
brij-validate --help for usage:
Options:--filename, -f JSON rules file to validate--quiet, -q less output [default: false]--help, -h, -? this help message
We encourage anyone who's interested in participating in the formation of this standard to join the discussions here on GitHub. Also feel free to fork this project and submit new ideas to add to the
brij-spec adheres to Semantic Versioning 2.0.0. If there is a violation of this scheme, report it as a bug. Specifically, if a patch or minor version is released and breaks backward compatibility, that version should be immediately yanked and/or a new version should be immediately released that restores compatibility. Any change that breaks the public API will only be introduced at a major-version release. As a result of this policy, you can (and should) specify any dependency on
brij-spec by using the Pessimistic Version Constraint with two digits of precision.