ISession Interface |
Namespace: NRules
public interface ISession
The ISession type exposes the following members.
Name | Description | |
---|---|---|
![]() | DependencyResolver |
Rules dependency resolver.
|
![]() | Events |
Provider of events from the current rule session.
Use it to subscribe to various rules engine lifecycle events.
|
Name | Description | |
---|---|---|
![]() | Fire |
Starts rules execution cycle.
This method blocks until there are no more rules to fire.
|
![]() | Insert |
Inserts a new fact to the rules engine memory.
|
![]() | QueryTFact |
Creates a LINQ query to retrieve facts of a given type from the rules engine's memory.
|
![]() | Retract |
Removes existing fact from the rules engine memory.
|
![]() | TryInsert |
Inserts a fact to the rules engine memory if the fact does not exist.
|
![]() | TryRetract |
Removes a fact from the rules engine memory if the fact exists.
|
![]() | TryUpdate |
Updates a fact in the rules engine memory if the fact exists.
|
![]() | Update |
Updates existing fact in the rules engine memory.
|
Event Type | Reason |
---|---|
IEventProviderFactInsertingEvent | Before processing fact insertion. |
IEventProviderFactInsertedEvent | After processing fact insertion. |
IEventProviderFactUpdatingEvent | Before processing fact update. |
IEventProviderFactUpdatedEvent | After processing fact update. |
IEventProviderFactRetractingEvent | Before processing fact retraction. |
IEventProviderFactRetractedEvent | After processing fact retraction. |
IEventProviderActivationCreatedEvent | When a set of facts matches a rule. |
IEventProviderActivationUpdatedEvent | When a set of facts is updated and re-matches a rule. |
IEventProviderActivationDeletedEvent | When a set of facts no longer matches a rule. |
IEventProviderRuleFiringEvent | Before rule's actions are executed. |
IEventProviderRuleFiredEvent | After rule's actions are executed. |
IEventProviderConditionFailedEvent | When there is an error during condition evaluation, before throwing exception to the client. |
IEventProviderActionFailedEvent | When there is an error during action evaluation, before throwing exception to the client. |
Exception | Condition |
---|---|
RuleConditionEvaluationException | Error while evaluating any of the rules' conditions. This exception can also be observed as an event ConditionFailedEvent. |
RuleActionEvaluationException | Error while evaluating any of the rules' actions. This exception can also be observed as an event ActionFailedEvent. |