builder

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleBuilder

type RuleBuilder struct {
	KnowledgeBase *ast.KnowledgeBase
	WorkingMemory *ast.WorkingMemory
}

RuleBuilder builds rule from DRL script into contained KnowledgeBase

func NewRuleBuilder

func NewRuleBuilder(KnowledgeBase *ast.KnowledgeBase, memory *ast.WorkingMemory) *RuleBuilder

NewRuleBuilder creates new RuleBuilder instance. This builder will add all loaded rules into the specified knowledgebase.

func (*RuleBuilder) BuildRuleFromResource

func (builder *RuleBuilder) BuildRuleFromResource(resource pkg.Resource) error

BuildRuleFromResource will load rules from a single resource. It will return an error if it encounter an error on the specified resource.

func (*RuleBuilder) BuildRuleFromResources

func (builder *RuleBuilder) BuildRuleFromResources(resource []pkg.Resource) error

BuildRuleFromResources will load rules from multiple resources. It will return an error if it encounter an error on the first script it found.

func (*RuleBuilder) BuildRulesFromBundle added in v1.2.3

func (builder *RuleBuilder) BuildRulesFromBundle(bundle pkg.ResouceBundle) error

BuildRulesFromBundle will load rules from a bundle into knowledge base.

func (*RuleBuilder) MustBuildRuleFromResource

func (builder *RuleBuilder) MustBuildRuleFromResource(resource pkg.Resource)

MustBuildRuleFromResource is similar to BuildRuleFromResource, with the difference is, it will panic if rule script contains error.

func (*RuleBuilder) MustBuildRuleFromResources

func (builder *RuleBuilder) MustBuildRuleFromResources(resource []pkg.Resource)

MustBuildRuleFromResources is similar to BuildRuleFromResources, with the difference is, it will panic if rule script contains error.

func (*RuleBuilder) MustBuildRulesFromBundle added in v1.2.3

func (builder *RuleBuilder) MustBuildRulesFromBundle(bundle pkg.ResouceBundle)

MustBuildRulesFromBundle is the same with BuildRulesFromBundle but it will panic if any error arises during loading resource and inserting it to knowledgebase

Jump to

Keyboard shortcuts

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