You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added a listener to my code only to do some logging to make it easy when debugging some situations.
Here is the listener implementation I am using.
// ExecuteRuleEntry will be called by the engine if it execute a rule entry in a cycletyperuleEngineListenerstruct{}
funcNewRuleEngineListener() ruleEngineListener {
returnruleEngineListener{}
}
// EvaluateRuleEntry will be called by the engine if it evaluate a rule entryfunc (ruleEngineListener) EvaluateRuleEntry(cycleuint64, entry*ast.RuleEntry, candidatebool) {}
// ExecuteRuleEntry will be called by the engine if it execute a rule entry in a cyclefunc (ruleEngineListener) ExecuteRuleEntry(cycleuint64, entry*ast.RuleEntry) {
log.Info(context.Background()).Msgf("Rule Engine - Matched Rule: %s, Entry Data: %v", entry.RuleName, entry)
}
// BeginCycle will be called by the engine every time it start a new evaluation cyclefunc (ruleEngineListener) BeginCycle(cycleuint64) {}
So, I would like to know if there is a way for me to access the fact data from the listeners. If yes, can you tell me how I can do that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I have added a listener to my code only to do some logging to make it easy when debugging some situations.
Here is the listener implementation I am using.
So, I would like to know if there is a way for me to access the fact data from the listeners. If yes, can you tell me how I can do that?
Beta Was this translation helpful? Give feedback.
All reactions