RuleSet
Instance of an authored Independent Rule Set.
getName()
Returns: string
Description: Returns a string of the Rule Set's name
Code Sample:
var session = inrule.createRuleSession();
var ruleSet = session.createIndependentRuleSet("RuleSet1");
var ruleSetName = ruleSet.getName(); // ruleSetName is "RuleSet1";
execute(arguments, callback)
Returns: void
Description: Executes the Rule Set with the specified name on the Entity. If arguments are provided they are passed to the Rule Set.
Code Sample:
var session = inrule.createRuleSession();
var ruleSet = session.createIndependentRuleSet("RuleSet1");
ruleSet.execute([1, "value"], function(log){
// Code that checks the Execution Log
});
getParameterValue(name)
Returns: void
Description: Returns a RuleSet parameter's value for the specified name
Code Sample:
var session = inrule.createRuleSession();
var ruleSet = session.createIndependentRuleSet("RuleSet1");
ruleSet.execute([1, "value"], function(log){
console.log(ruleSet.getParameterValue("Value1");
});