Validation

Warewolf validation is carried out both on the server and client via the Warewolf validation framework. At the most atomic level, it is carried out by executing a Validation Rule that implements the IRuleBase interface. An example of a rule would be an IsValidSyntax rule that validates the syntax of user input.

Validation occurs as and when it is needed, as such; there is no standard project or location for the definition of validation rules.
There are currently two methods of composing rules:

  • The first is an aggregation called RuleSet. A RuleSet is a collection of rules in which all rules must evaluate to true. Give a RuleSet [A, B, C] the RuleSet will evaluate {A && B && C}.
  • The other mechanism, is a ComposableRule rule that provides a fluent composition of rules with both [and] and [or] semantics.

RuleSets are tailored towards re-use while composition tailored toward edge cases.

Studio Validation

This is carried out on the design surface on the large view of each of the Activities when the “Done” button is clicked. Or If a user inputs an error when defining variables or other errors occur, then validation is triggered and a message is delivered to the user. At this point the user is forced to fix validation errors before continuing.
Validation is defined, in the Studio, by overriding the ValidateThis or ValidateCollection methods of the ActivityDesignerViewModel depending on whether they are Grid activities or Non-grid Activities.

Server Validation

Activities in general perform validation during execution because of the dynamic nature of Warewolf services. If a rule fails, then the service execution will in most cases bubble up an error to the user. There are certain use cases for failing validation but allowing execution to continue, but these are discouraged.

Not what you were looking for? Ask our expert users in the Community Forum.

FacebookTwitterLinkedInGoogle+Email
Updated on July 19, 2017

Was this article helpful?

Related Articles

Enjoying Warewolf?

Write a review on G2 Crowd
Stars