Skip to content

Instantly share code, notes, and snippets.

@buildmotion
Created August 28, 2021 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buildmotion/d91e22c9155c38f301a7d2fbbdf6b9c1 to your computer and use it in GitHub Desktop.
Save buildmotion/d91e22c9155c38f301a7d2fbbdf6b9c1 to your computer and use it in GitHub Desktop.
// Load the error/rule violations into the ServiceContext so that the information bubbles up to the caller of the service;
this.validationContext.results.forEach( (e) => {
if(!e.isValid && e.rulePolicy.isDisplayable) {
let serviceMessage = new ServiceMessage(e.rulePolicy.name, e.rulePolicy.message, MessageType.Error);
this.serviceContext.addMessage(serviceMessage);
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment