Contract variables need to be fulfilled even if not mandatory?
formOutput is in the field "Data sent on click" of a button in the form. Even if the text area is NOT mandatory, when I try to submit the form with EMPTY text area, I get always the error saying the contract is not fulfilled (clearly as note variable is null).
Can anyone help me?
How is it possible to define a NOT MANDATORY text area without having contract troubles?
I think this is not the correct answer (for my purpose).
I'll make an example: I got a process with 3 steps, in each of them the user can write a comment to explain what he/she did in his/her step. The comment (entity) is a BDM object, linked to the main BDM object (entity) of the process (may be a purchase, an order, a decision iter, and so on). If I do what you say, I will put a lot of empty string in my database, and it's surely not correct.
Do you agree with me?
But you didn't make that clear in your original post however...
Based on what you've got, a BDM within a BDM, then this is perfectly acceptable.
Just don't add the empty note to the main BDM object.
I would write something like this as my Output Operation:
mainBDM.setNote(noteBDM) //only set the field if not null
This way you end up with an empty field in the BDM rather than empty string in the BDM.
I assume you've done it this way because you can have multiple notes per main BDM... :)
Sometimes it is a neessary to have blank fields...which is what an empty field is after all..
The problem with a contract is that a contract is between the form and the process, it is not between the BDM and the process.
I understand the problem you're having, but that's the way Bonitasoft designed it...