validations in UI form in bonita 7.10.5 community version
I am a beginner in Bonita development. I am using Bonita 7.10.5 community version how can I achieve validations for input controls
like emailId, mobile no, dropdown list, checkbox, radio button, date, and others .when I did some R&D I found that we should use angular js validation from the link (https://community.bonitasoft.com/questions-and-answers/form-validation-ui-designer) Is it the right way of the proceeding if angular js then how can I implement in Bonita UI designer. Also, there is constraints tab in the contracts menu where we can add constraints which way should I proceed when to use which .
but not able to find "To add a specific validator, select widget for the field, then Details - > Validators -> Add. " in the community version of Bonita maybe is it for enterprise and other versions only
Could you please suggest how to proceed
the second link you refer to is based on a deprecated version (Bonita 5.x) and is not working with Bonita 7.10.x
Nevertheless, here is an how-to from our documentation which could be helpful for you: https://documentation.bonitasoft.com/bonita/7.11/manage-control-in-forms. It includes an example of implementation.
From what I have seen, the constraints are validations that are done server-side, while UI Designer AngularJS validations are done frontend side.
To test this, what I did was I created a simple process with one task. The task had a contract containing 1 input and 1 constraint that verifies that "input1.equals("test");". I autogenerated the form for this task by just clicking on the pencil in the form tab under execution for the task. After launching the process and trying to input anything, but test, there is an error from the api call telling me that it needs to be test.
For the angularjs part, I went to the form that was previously created and I added a variable called ctrl with the content:
return $data.formInput.input1 === "test";
I also created a text container with the text "ERROR: Value is not test", and the hidden value "ctrl.verifyValueIsTest()" (I switched to fx). This will show the text whenever the input field does not have the value test. After running the process, you can see that the check is done frontend side, which means that there is no API call.
So, that is the difference between using AngularJS validation or Constraints, the validation is done user side or server side.
Hope this helps.