RuleExecutionLog

  • Updated

Log of actions the engine took during rule execution. Will only be populated if a JavaScript rule application was packaged with logging options.

messages Returns: Array of string

Description:

An Array of engine messages

Code Sample:

var session = inrule.createRuleSession(); 
session.createEntity("Entity1");
session.applyRules(function(log){ for(var i=0;i < log.messages.length; i++){
console.log(log.messages[i]); } });

 

hasErrors Returns: bool

Description:

Boolean that indicates whether or not the engine experienced errors during execution

Code Sample:

var session = inrule.createRuleSession(); 
session.createEntity("Entity1");
session.applyRules(function(log){ if(log.hasErrors){ console.log("Errors occurred applying rules"); } });

 

runtimeErrors Returns: Array of Error

Description:

Array of errors experienced during execution

Code Sample:

var session = inrule.createRuleSession(); 
session.createEntity("Entity1");
session.applyRules(function(log){ if(log.hasErrors){ for(var i=0;i < log.runtimeErrors.length; i++){
console.log(log.runtimeErrors[i]); } } });

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.