Click or drag to resize

IContext Interface

Rules engine execution context. Can be used by rules to interact with the rules engine, i.e. insert, update, retract facts.

Namespace:  NRules.RuleModel
Assembly:  NRules.RuleModel (in NRules.RuleModel.dll) Version: 0.9.3
Syntax
C#
public interface IContext

The IContext type exposes the following members.

Properties
  NameDescription
Public propertyCancellationToken
Enables cooperative cancellation of the rules execution cycle.
Public propertyMatch
Current rule match.
Public propertyRule
Current rule definition.
Top
Methods
  NameDescription
Public methodGetLinked
Retrieves a fact linked to the current rule activation by key.
Public methodGetLinkedKeys
Retrieves keys of facts linked to the current rule activation.
Public methodHalt
Halts rules execution. The engine continues execution of the current rule and exits the execution cycle.
Public methodInsert
Inserts a new fact to the rules engine memory.
Public methodInsertAll
Inserts new facts to the rules engine memory.
Public methodInsertAllLinked
Inserts new facts and links them to the current rule activation. The facts will be automatically retracted if this activation is removed.
Public methodInsertLinked
Inserts a new fact and links it to the current rule activation. The fact will be automatically retracted if this activation is removed.
Public methodResolve
Resolves a registered service (normally via an IoC container).
Public methodRetract
Removes existing fact from the rules engine memory.
Public methodRetractAll
Removes existing facts from the rules engine memory.
Public methodRetractAllLinked
Retracts existing facts that are linked to the current rule activation.
Public methodRetractLinked
Retracts existing fact that's linked to the current rule activation.
Public methodTryInsert
Inserts a fact to the rules engine memory if the fact does not exist.
Public methodTryRetract
Removes a fact from the rules engine memory if the fact exists.
Public methodTryUpdate
Updates a fact in the rules engine memory if the fact exists.
Public methodUpdate
Updates existing fact in the rules engine memory.
Public methodUpdateAll
Updates existing facts in the rules engine memory.
Public methodUpdateAllLinked
Updates existing facts that are linked to the current rule activation.
Public methodUpdateLinked
Updates existing fact that's linked to the current rule activation.
Top
Extension Methods
  NameDescription
Public Extension MethodResolveTService
Resolves a registered service (normally via an IoC container).
(Defined by ContextExtensions.)
Public Extension MethodUpdateT
Updates existing fact in the rules engine's memory. First the update action is applied to the fact, then the fact is updated in the engine's memory.
(Defined by ContextExtensions.)
Top
See Also