Interface BusinessLogicError

When Business Logic gathers data from the UI, it runs its own final validation. If its own business rule has been violated, it should be recorded with this interface and passed to ValidationManager.setBusinessLogicErrors where it becomes exposed to the Validation Summary (getIssuesFound) and optionally for an individual ValueHostName, by specifying that valueHostName in AssociatedValueHostName.

interface BusinessLogicError {
    errorMessage: string;
    associatedValueHostName?: string;
    severity?: ValidationSeverity;
    errorCode?: string;
}

Properties

errorMessage: string

The error message to show to the user. It should be fully realized, no tokens or language conversion expected to be handled by the ValidationManager. The same message will be shown in the ValidationSummary and a ValueHost's validation.

associatedValueHostName?: string

If the message is associated with a ValueHost, assign the ValueHostName. That makes the message available to the ValueHost's validation. The Summary can take advantage of it to establish a hyperlink on the message that jumps to the ValueHost's input field/element.

Provides the severity. When unassigned, it uses ValidationSeverity.Error. Values of Error and Severe will change the ValidationReport to Invalid.

errorCode?: string

Optional information about the error to pass along to the ValidationSummary. It should be a short error code as a string. It will be used in the IssueFound instance returned from validate() and getIssuesFound(). Same as ConditionType unless you set the ValidatorConfig.errorCode property. If not supplied, the IssueFound.ConditionType will be assigned a generated value.

Generated using TypeDoc v0.25.12