elemental-lowcode

Elemental lowcode development platform.

View the Project on GitHub PhilipSkinner/elemental-lowcode

Back to Services

Rulesets Service

The rulesets service allows you to call into any rulesets defined within the system. It surfaces the following methods:

These methods are covered in more detail below.

callRuleset

Parameters:

Calls the named ruleset with the facts given and returns the JSON response (as a parsed object) within a promise. This method can reject with an error and needs to be handled correctly.

This can be called from your controllers like so:

module.exports = {
	events : {
		load : (event) => {
			return this.rulsetService.callRuleset(
				"isValid",
				{
					my : 'value'
				}
			).then((result) => {
				...
			}).catch((err) => {
				...
			});
		}
	}
};