dan
July 20, 2018, 6:24pm
1
I am building a process with a form, and I would like to add a generic read-only text field to it.
Example: A link (the read-only text field) and a checkbox for the user to click on to verify that they have clicked the link
My first thought was to add a form field, and make the field validator “read-only”.
https://docs.camunda.org/manual/7.9/user-guide/task-forms/#form-field-validation
However, I am using the Fluent Builder API, and while there are methods for
camundaId
camundaLabel
camundaType
camundaDefaultValue
There is no implementation for adding validators as shown here in the AbstractCamundaFormFieldBuilder class.
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.model.bpmn.builder;
import org.camunda.bpm.model.bpmn.BpmnModelInstance;
import org.camunda.bpm.model.bpmn.instance.BaseElement;
import org.camunda.bpm.model.bpmn.instance.camunda.CamundaFormField;
/**
* @author Kristin Polenz
This file has been truncated. show original
A naive attempt has been made by me to add something like
public B camundaValidator(CamundaValidation validation) {
element.setCamundaValidation(validation);
return myself;
}
But this appears to be much more involved than I previously thought. Any ideas or recommendations?
Hi @dan ,
You could add the validators in a non-fluent way, i.e. first build the model and then add the validator elements via the non-fluent APIs. If you would like to extend the builder, we are happy to receive a pull request and can give you feedback on API design.
Cheers,
Thorben
dan
July 23, 2018, 2:25pm
3
Thorben,
Thanks for the feedback! I am trying it out, and I believe that adding it after-the-fact in a non-fluent way will work.
I much prefer the fluent builder, so if I can get it together I will open a pull request!
1 Like