RuleContext class
Represents a rule context. The rule context is used to evaluate the conditions and execute the actions of a rule.
A rule context contains information about facts, conditions, and actions that are used to evaluate the rules.
Constructors
-
RuleContext.new({Map<
String, dynamic> facts = const {}, List<MemberAccessor> resolve = const []})
Properties
- currentRuleId → String?
-
Returns the current rule ID.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addFact(
String key, dynamic value) → void - Adds a fact to the context with the specified key and value.
-
clearFacts(
) → void -
getError(
) → dynamic - Returns the error message associated with the current activation.
-
getFact(
String key) → dynamic - Returns the value of a fact with the specified key.
-
getFacts(
) → Map< String, dynamic> - Returns the facts stored in the context.
-
getResolve(
) → dynamic -
Returns the list of
MemberAccessor
objects used to access the fields of a user-defined object. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited