Hello,
we have defined additional filters/options on form fields using our workflow
namespace:
<bpmn:userTask completionQuantity="1" camunda:assignee="${requester}" id="Task_2"name="Third task">
<bpmn:extensionElements>
<camunda:formData>
<camunda:formField id="Response" label="Response" type="string">
<workflow:fieldFilter>
<workflow:editable>true</workflow:editable>
<workflow:included>true</workflow:included>
</workflow:fieldFilter>
</camunda:formField>
</camunda:formData>
</bpmn:extensionElements>
</bpmn:userTask>
In the application we are processing the filters with the following code:
CamundaFormData camundaFormData = (CamundaFormData) userTask.getExtensionElements().getUniqueChildElementByNameNs("http://camunda.org/schema/1.0/bpmn", "formData");
CamundaFormField camundaFormField = camundaFormData.getCamundaFormFields().stream().filter(field->field.getCamundaId().equals("Response")).findFirst().get();
ModelElementInstance filters = camundaFormField.getUniqueChildElementByNameNs("http://example.com/schema/1.0/workflow", "fieldFilter");
In general, this works fine. However, in production we sometimes see the following error logs:
java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification
at java.util.ArrayList$Itr.next
at org.camunda.bpm.model.xml.impl.ModelBuilderImpl.build(ModelBuilderImpl.java:75)
at org.camunda.bpm.model.xml.impl.ModelInstanceImpl.registerGenericType(ModelInstanceImpl.java:111)
at org.camunda.bpm.model.xml.impl.util.ModelUtil.getModelElement(ModelUtil.java:91)
at org.camunda.bpm.model.xml.impl.util.ModelUtil.getModelElement(ModelUtil.java:52)
at org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl.getUniqueChildElementByNameNs(ModelElementInstanceImpl.java:192)
at com.example.workflow.WorkflowFormFieldCamunda.getFilters(WorkflowFormFieldCamunda.java:142)
Any ideas why the CamundaFormField.getUniqueChildElementByNameNs()
is throwing a java.util.ConcurrentModificationException
? Usually this error occurs if a list is modified during iteration. Is it possible that there is a problem with the implementation?