AnsweredAssumed Answered

Loss of ID when converting BpmnToJson

Question asked by eee on Oct 9, 2015
Latest reply on Oct 27, 2015 by kotslon
I'm trying to convert Bpmn model (bpmn20.xml) to Json format for a new editor. There are problems with conversion values in "formProperty".
Example source text:

<formProperty id="priority" name="уровень срочности:" required="false" type="enum" variable="priority" writable="false">
   <value id="3" name="на заказ (от 2 недель)"/>
   <value id="2" name="средний (до 2 недель)"/>
   <value id="1" name="высокий ( от 1 до 3 дней)"/>

After converting using BpmnJsonConverter I get the following:

"id": "priority",
"name": "уровень срочности:",
"type": "enum",
"expression": null,
"variable": "priority",
"enumValues": [{
   "value": "на заказ (от 2 недель)"
   }, {
   "value": "средний (до 2 недель)"
   }, {
   "value": "высокий ( от 1 до 3 дней)"
"required": false,
"readable": true,
"writable": false

It is evident that the ID information has not been converted.
Looking at the source code I found the place where this information is discarded (

if (CollectionUtils.isNotEmpty(property.getFormValues())) {
                ArrayNode valuesNode = objectMapper.createArrayNode();
                for (FormValue formValue : property.getFormValues()) {
                    ObjectNode valueNode = objectMapper.createObjectNode();
          valueNode.put("value", formValue.getName());
                propertyItemNode.put(PROPERTY_FORM_ENUM_VALUES, valuesNode);

In valuesNode only added the field "value".
The reverse converting Json to Bpmn in the field "id" and "name" of Bpmn model will copy one field value from Json (

FormValue formValue = new FormValue();

Is this a bug? How can I store the ID?

In our system, the id field is often used: to sort, to highlight the system values, etc.