In a sample form if i replace a text widget by a select widget I have the following exception :
Error while validating expected inputs
Explanations:
Expected input [deliveryTerms] is missing
the data is nullable, the widget is not mandatory and i have this exception just if i don’t select a value. The same think with text or text area work fine.
It don’t think the problem is in the contract itself because it works fine with a text widget. A field contract reflect the presentation of a business field and can be nullable. I think it may be in the contract check interface of the Select component. If I remove the field from the contract it works fine.
Lionel,
I have the following datas :
=> Business Data :
...
...
=> Contract :
All fields of an instance of the class describe above
The contract is not linked to the widgets directly. There is no specific contract for the widget Select by example.
The contract will check the structure and content of the data passed by REST Api call generated by the form on the submit action. If the structure is not as expected, the engine will return an error.
So in your case, you have to make sure that even if no value are selected in your Select widget, you still pass the property deliveryTerms in your JSON response. The value for the property would be empty or NULL if no selection.
Thanks Lionel you’re perfectly right, and that the reason why I suspect a bug : the select should always return the property deliveryTerms : value when a value is selected or null or empty if no value is selected … and it return nothing when no value is selected (unlike text component). Something else, even if Select is mandatory the Submit is validated.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.