Table of Contents

Class RuleBuilder

Namespace
NRules.RuleModel.Builders
Assembly
NRules.RuleModel.dll

Builder to compose a rule definition. Contains methods to specify rule's metadata, as well as create child builders for rule's left-hand side and right-hand side. Creates IRuleDefinition.

public class RuleBuilder
Inheritance
RuleBuilder
Inherited Members

Constructors

RuleBuilder()

Constructs an empty rule builder.

public RuleBuilder()

Methods

Build()

Creates rule definition using current state of the builder.

public IRuleDefinition Build()

Returns

IRuleDefinition

Rule definition.

Dependencies()

Retrieves dependencies builder.

public DependencyGroupBuilder Dependencies()

Returns

DependencyGroupBuilder

Dependencies builder.

Dependencies(DependencyGroupBuilder)

Sets dependencies builder.

public void Dependencies(DependencyGroupBuilder builder)

Parameters

builder DependencyGroupBuilder

Builder to set.

Description(string)

Sets rule's description.

public void Description(string description)

Parameters

description string

Rule description value.

Filters()

Retrieves filters builder.

public FilterGroupBuilder Filters()

Returns

FilterGroupBuilder

Filters builder.

Filters(FilterGroupBuilder)

Sets filters builder.

public void Filters(FilterGroupBuilder builder)

Parameters

builder FilterGroupBuilder

Builder to set.

LeftHandSide()

Retrieves left-hand side builder (conditions).

public GroupBuilder LeftHandSide()

Returns

GroupBuilder

Left hand side builder.

LeftHandSide(GroupBuilder)

Sets left-hand side builder (conditions).

public void LeftHandSide(GroupBuilder builder)

Parameters

builder GroupBuilder

Builder to set.

Name(string)

Sets rule's name.

public void Name(string name)

Parameters

name string

Rule name value.

Priority(int)

Sets rule's priority. Default priority is 0.

public void Priority(int priority)

Parameters

priority int

Rule priority value.

Properties(IEnumerable<RuleProperty>)

Adds rule's properties.

public void Properties(IEnumerable<RuleProperty> properties)

Parameters

properties IEnumerable<RuleProperty>

Rule property.

Property(string, object)

Adds rule's property.

public void Property(string name, object value)

Parameters

name string

Property name.

value object

Property value.

Repeatability(RuleRepeatability)

Sets rule's repeatability. Default repeatability is Repeatable.

public void Repeatability(RuleRepeatability repeatability)

Parameters

repeatability RuleRepeatability

RightHandSide()

Retrieves right-hand side builder (actions).

public ActionGroupBuilder RightHandSide()

Returns

ActionGroupBuilder

Right hand side builder.

RightHandSide(ActionGroupBuilder)

Sets right-hand side builder.

public void RightHandSide(ActionGroupBuilder builder)

Parameters

builder ActionGroupBuilder

Builder to set.

Tag(string)

Adds rule's tag.

public void Tag(string tag)

Parameters

tag string

Rule tag value.

Tags(IEnumerable<string>)

Adds rule's tags.

public void Tags(IEnumerable<string> tags)

Parameters

tags IEnumerable<string>

Rule tag values.