Camunda BPMN Custom Form Field Validator using expressions or scripts

I am searching for a Custom Form Field validator on generated tasks forms. I found the example for the implementation of Custom form field validator using FormFieldValidatorinterface, but I need to implement custom form field validation using scripts or expressions.

Is it supported or possible in Camunda?

From the docs:
<camunda:constraint name="validator" config="${validatorBean}" />

Is this the right way? If yes, where and how we can define validatorBean ?

@khangm The class which implementing the FormFieldValidator should have @Component annotation at class level and the class should present in the classpath of camunda server.

Check the below example and refer the docs for configuration:

Thanks for the reply. Is there any way to write the custom form field validator using expressions or scripts instead of implementing FormFieldValidator?

Hi @khangm,

not out of the box, as the form is generated by the server.

If it’s worth to have the feature, you can extend and replace the form builder in the engine. You can start investigating here: https://github.com/camunda/camunda-bpm-platform/tree/master/engine/src/main/java/org/camunda/bpm/engine/impl/form/engine

Hope this helps, Ingo