ProtectedconstructorOptionalcondition: Expression | nullOptionalconsequence: ExecutableAction | nullOptionalchecker: TypeCheckerOptionalnameOptional name for the rule, which can be used for identification and debugging purposes.
OptionalhintAn optional hint or description for the rule, which can provide additional information about its purpose or usage. This is primarily for documentation and user guidance when working with the rule.
ProtectedchangeProtected Optionalcompiled_ProtectedconditionProtectedconsequenceGet the original syntax string from which this rule was created. This can be useful for debugging and error reporting, as it allows you to see the exact rule definition that led to a particular rule instance.
the original syntax string of the rule.
Get the salience (priority) of the rule, which determines the order in which rules are evaluated and executed when multiple rules are applicable. Higher salience means higher priority. If salience is not set, it defaults to 0.
the salience (priority) of the rule where 0 is default and 10 is the highest.
Set the salience (priority) of the rule, which determines the order in which rules are evaluated and executed when multiple rules are applicable. Higher salience means higher priority. If salience is not set, it defaults to 0.
the salience (priority) of the rule where 0 is default and 10 is the highest.
Check whether the rule is currently disabled. A disabled rule will not be evaluated or executed by the engine.
true if the rule is disabled, false otherwise.
Disable the rule, preventing it from being evaluated or executed by the engine. This can be useful for temporarily turning off rules without removing them from the system, such as during testing. Optionally, a reason can be provided for why the rule is being disabled, which will be included in the hint if no hint is already set for the rule.
Optionalreason: stringa hint or reason for why the rule is being disabled.
Enable the rule, allowing it to be evaluated and executed by the engine if it is applicable. This can be used to re-enable a rule that was previously disabled.
Optionalvalue: unknownProtectedrequireWhat data keys are required for this rule to be applicable? This is determined by the specific implementation of the rule and should be set during the construction of the instance. The rule engine uses this information to determine which rules are applicable based on the current context.
a set of data keys required for this rule to be applicable.
ProtectedwillDeclare what keys (and their types) that are expected in the relevant context when this rule is executed.
a record mapping changed data keys to their expected types.
Whether this rule is applicable in the given context, based on whether all of its required data keys are present in the context.
the current working context containing data and constants.
true if the rule is applicable, false otherwise.
StaticparseOptionalworkspace: WorkspaceThe condition to be evaluated and satisified.
the expression to be evaluated in this rule.
StaticparsedOptionalchecker: TypeCheckerReturns a string representation of an object.
Check the types of the rule using the provided type checker. This method should validate that all expressions and components of the rule are type-correct according to the types known to the checker instance.
Optionalchecker: TypeCheckerthe type checker to use for validating the rule.
the result of the type check, indicating whether the rule is valid.
Get the data keys that this executor will change when executed, along with their expected types.
Optionalchecker: TypeCheckera record mapping data keys to their expected types.
Evaluate the rule in the given context to determine if it is satisfied and should be executed.
the current working context containing data and constants.
an executor if the rule is satisfied, null otherwise.
Execute the rule in the given context and return the effect of the execution. This method should only be called if the rule has been evaluated and found to be satisfied.
the current working context containing data and constants.
the effect of executing the rule.
A conditional rule that is executed if a condition is satisified.