class staticbo.rules. ResultBase
Source: rules/
Serves as the base class for the failed result of executing a rule.
Properties
Method
new ResultBase(ruleName, propertyName, message)
Creates a new rule result object.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
ruleName |
string |
|
The name of the rule. |
propertyName |
string |
|
The name of the property the rule belongs to. |
message |
string |
|
Human-readable description of the reason of the failure. |
- Throws
-
Argument error: The rule name must be a non-empty string.
-
Argument error: The message must be a non-empty string.
Properties
read-onlyisPreserved
boolean
Indicates whether the broken rule of this failure is preserved when a new verification starts. Typically the broken rules of authorization rules are retained.
read-onlymessage
string
Human-readable description of the reason of the failure.
read-onlypropertyName
string
The name of the property the rule belongs to.
read-onlyruleName
string
The name of the rule.
read-onlyseverity
bo.rules.RuleSeverity
The severity of the rule failure.
read-onlystopsProcessing
boolean
Indicates whether processing the rules of the property should stop.
Method
toBrokenRule() → bo.rules.BrokenRule
Maps the rule result to broken rule.
- Returns
-
bo.rules.BrokenRule
The broken rule companion of the rule result.