Throw Validation Error From Policy
From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS
<keywords content="keywords"> thrpwvalidationerror, policy, web application </keywords>
How to throw validation errors in the Web Application from a Policy
When the user is creating a policy in Bizagi, it is not possible to throw a validation error or message when defining the THEN part of the policy directly. However, if the user saves the error message in a vocabulary element, he will be able to create an expression in a function in order to throw the validation in the Web Application. This is how:
1. Define the constant definition in the vocabulary.
2. Right click in Constant Definition in order to create a new one.
3. Select a name, display name and a description for the constant Definition.
4. Select the constant value for the constant definition, and the constant type as string.
5. Create a function that returns the constant definition.
6. In the function, create an expression that returns the message written in the constant definition with the throwvalidationerror method.
7. Create the Xpath Definitions for the vocabulary
8. In the THEN part of the policy definition, associate the function previously created.
9. Associate the policy with the process and test the change.
<comments />