Adding constraint for complex and multiple contract
Hi
Can I add constraint for a variable that it's complex and multiple?
I define family as a complex and multiple contract and adding constraints similar simple contract, but it doesn't work!
It's my code in constraints:
for(row in family){
if(row.A.length() != 10)
return false
}
return true;
If length of A doesn't equal to 10, it shows my error message but after correcting it doesn't work and still show error message!
I'm using Bonita Studio 7.8 community version.
Logs:
2021-07-07 13:20:00.796 +0430 WARNING: org.bonitasoft.engine.bpm.contract.validation.ContractConstraintsValidator THREAD_ID=53 | HOSTNAME=Pournajar | TENANT_ID=1 | Constraint [constraintFamily] on input(s) [family] is not valid
2021-07-07 13:20:00.796 +0430 INFO: org.restlet.Component.BonitaRestletApplication Error while validating constraints
Thanks
Comments
Thanks it work.
If I have complicated constraints, Can I write a function there?
Thanks!
Hi Romain
In this way, for all row return one message. Is there a way that specify wrong row exactly?
Ok, thanks.
For this goal, I added angular js module in my custom widget and if value was wrong, my class has been added like : ng-invalid-myCod
In this way, How do I show proper message after my custom widget?
Actually I'd like to add my message in ng-message of angular js!
Comments
Thanks it work.
If I have complicated constraints, Can I write a function there?