Adding constraint for complex and multiple contract


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.


Constraints errors don't appear in the form

Hi everybody,

I created a contract which has one constraint, when the expression it's true the form is submitted as expected. However, when it's false the error is not shown in the form, it only appears in the log file.

Any idea of what could be happening?


Access DAO object in Constraint script

Hello All,

It seems it's not possible to access DAO objects in a Constraint validation script. For instance, when I try to validate using objectDAO.findByCode(input.myCode, 0, 1), I get the following error:

objectDAO is neither defined in the script nor in dependencies.

Is it so or am I doing something wrong? And if so, what alternative is feasible to validate input data against BDM (database) values?

Thank you in advance.