ModdleDescriptor form value bug

Hi,

I changed camunda doddle descriptor as flowable descriptor and implemented all form descriptions and properties panel. But I think that there is a bug in modeller loading. The issue:

BPMN:

 <userTask id="theTask" name="my task" flowable:formKey="formDemo">
      <extensionElements>
        <flowable:formProperty id="firstName" name="First Name" type="string"/>
        <flowable:formProperty id="lastName" name="Last Name" type="string"/>
        <flowable:formProperty id="gender" name="Gender" type="enum">
          <flowable:value id="F" name="Female"/>
          <flowable:value id="M" name="Male"/>
        </flowable:formProperty>
      </extensionElements>
    </userTask>

Descriptor:

{
            name: 'FormProperty',
            superClass: ['Element'],
            properties: [
                {
                    name: 'id',
                    type: 'String',
                    isAttr: true,
                },
                {
                    name: 'name',
                    type: 'String',
                    isAttr: true,
                },
                {
                    name: 'type',
                    type: 'String',
                    isAttr: true,
                },
                {
                    name: 'required',
                    type: 'Boolean',
                    isAttr: true,
                },
                {
                    name: 'readable',
                    type: 'Boolean',
                    isAttr: true,
                },
                {
                    name: 'writable',
                    type: 'Boolean',
                    isAttr: true,
                },
                {
                    name: 'variable',
                    type: 'String',
                    isAttr: true,
                },
                {
                    name: 'expression',
                    type: 'String',
                    isAttr: true,
                },
                {
                    name: 'datePattern',
                    type: 'String',
                    isAttr: true,
                },
                {
                    name: 'values',
                    type: 'Value',
                    isMany: true,
                },
                {
                    name: 'value',
                    type: 'String',
                    isAttr: true,
                },
            ],
        },

After loading the bpmn file result:

<userTask id="theTask" name="my task" flowable:formKey="formDemo">
      <extensionElements>
        <flowable:formProperty id="firstName" name="First Name" type="string" />
        <flowable:formProperty id="lastName" name="Last Name" type="string" />
        <flowable:formProperty id="gender" name="Gender" type="enum" value="" />
      </extensionElements>
    </userTask>

All <flowable:value …> tags lost.

But when I remove following block from descriptor file then everything ok. There is a problem with “values”, “Value” and “value” ?

{
                    name: 'value',
                    type: 'String',
                    isAttr: true,
                },

I also encounter the same issue, but it is not about the ‘value’ ‘values’ etc. If you have an attribute on the parent element which has the same name as the name of the child element it doesn’t seem to work.

That’s right. “extensionElements” has “values” field and “flowable:formProperty” has also “values”. Do you have any ide about the solution?

Thank you so much.

I tried quite much but with no lock. If you have attribute and child element which share the same name it just won’t parse them both. The interesting part is if you want to just parse the attribute ignoring the child element. If you say like

let’s say you have some structure like the following;

<flowable:formProperty id="gender" name="Gender" type="enum" value="attributeString">
  <flowable:value id="F" name="Female">BodyString</flowable:value>
</flowable:formProperty>**
          {
            "name": "value",
            "type": "String",
            "isAttr": true
          }

It will parse the child element body as String instead of parsing the attribute content. But interestingly if you say some invalid type for the “type” definition it will parse the attribute. But the thing is the problem you encountered isn’t this one. You can solve it like this; i can read the value of the flowable:value with the following structure;

    {
      "name": "flowable:value",
      "superClass": [ "Element" ],
      "isAbstract": true
    },
   {
      "name": "FormValue",
      "extends": ["flowable:value"],
      "properties": [
        {
          "name": "id",
          "type": "String",
          "isAttr": true
        },
        {
          "name": "name",
          "type": "String",
          "isAttr": true
        },
        {
          "name": "text",
          "isBody": true,
          "type": "String"
        }
      ]
    },
{
      "name": "FormProperty",
      "superClass": [ "Element" ],
      "properties": [
        {
          "name": "value",
          "type": "flowable:value",
          "isAttr": false,
          "isMany": true
        },
        {
          "name": "variable",
          "type": "String",
          "isAttr": true,
          "isMany": false
        },
        {
          "name": "id",
          "type": "String",
          "isAttr": true
        },
        {
          "name": "name",
          "type": "String",
          "isAttr": true
        },
        {
          "name": "type",
          "type": "String",
          "isAttr": true
        }
      ]
    },

Try this one you will be able to parse the value field.

I have resolved my problem. “flowable:formProperty” has no “value” field. The field’s name is “default”.

{
                    name: 'default',
                    type: 'String',
                    isAttr: true,
                },