The custom type in generated forms is for types which can be rendered as the value of a single html input field, it is not useful to render complex structures like tables or multiple inputs for bean properties.
https://forum.camunda.org/t/camunda-custom-form-field-type/501 describes how the custom type works:
The custom type must extend AbstractFormFieldType
, which provides mappings between model types and form display types, see DateTypeValue
for an example. Then you must tell the bpmn engine about your custom type using ProcessEngineConfiguration.setCustomFormTypes()
in a ProcessEnginePlugin which has access to the bpm engine configuration.
The generated form will render the form display type as a single input field, only alternatives are datepicker for date and select for enum, as you see in HtmlFormEngine#renderFormField
:
if(isEnum(formField)) {
// <select ...>
renderSelectBox(formField, documentBuilder);
} else if (isDate(formField)){
renderDatePicker(formField, documentBuilder);
} else {
// <input ...>
renderInputField(formField, documentBuilder);
}
This is org.camunda.bpm.engine.impl.form.engine.HtmlFormEngine#renderInputField
, it renders a single input:
protected void renderInputField(FormField formField,
HtmlDocumentBuilder documentBuilder) {
HtmlElementWriter inputField = new HtmlElementWriter(INPUT_ELEMENT, true);
addCommonFormFieldAttributes(formField, inputField);
String inputType = !isBoolean(formField) ? TEXT_INPUT_TYPE : CHECKBOX_INPUT_TYPE;
inputField.attribute(TYPE_ATTRIBUTE, inputType);
// add default value
Object defaultValue = formField.getDefaultValue();
if(defaultValue != null) {
inputField.attribute(VALUE_ATTRIBUTE, defaultValue.toString());
}
// <input ... />
documentBuilder.startElement(inputField).endElement();
}