evaluator

package
v4.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneEngine

func CloneEngine(engineID string, cloneRuleBase bool, cloneKnowledgeBase bool) (*ruleeng.RuleEngine, error)

CloneEngine inits a new engine based on an existing one

func GetEngine

func GetEngine(engineID string) (*ruleeng.RuleEngine, bool)

GetEngine return a specific engine

func GetSituationKnowledge added in v4.1.4

func GetSituationKnowledge(situationInstance SituationToEvaluate) (map[string]interface{}, error)

func InitEngine

func InitEngine(engineID string) error

InitEngine inits an engine if it does not exist

func UpdateEngine

func UpdateEngine(engineID string) error

UpdateEngine updates an engine if it exists

Types

type EvaluatedSituation

type EvaluatedSituation struct {
	ID                 int64
	TS                 time.Time
	TemplateInstanceID int64
	Agenda             []ruleeng.Action
}

EvaluatedSituation represents the evaluation of a situation

func EvaluateObjectSituations

func EvaluateObjectSituations(situations []SituationToEvaluate, factObject engine.Fact, objects []map[string]interface{}, engineID string) ([]EvaluatedSituation, error)

EvaluateObjectSituations evaluates a slice of situations and return a slice with the evaluated situations

func EvaluateSituations

func EvaluateSituations(situations []SituationToEvaluate, engineID string) ([]EvaluatedSituation, error)

EvaluateSituations evaluates a slice of situations and return a slice with the evaluated situations

type SituationToEvaluate

type SituationToEvaluate struct {
	ID                 int64
	TS                 time.Time
	TemplateInstanceID int64
	Facts              []int64
	Parameters         map[string]string
}

SituationToEvaluate is used to notify a rule engine instance that a situation must me evaluated

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL