Add custom attributes into second tier element

Hello,

For my master thesis I extend the modeler with location-specific elements.
To this end I want to introduce a new EventDefinition among others.
Unfortunately, the new attributes are not stored at the expected place in the exported xml file:
Expected:

    <bpmn2:startEvent id="StartEvent_1">
      <loc:locationEventDefinition id="LocationEventDefinition_01388jx" loc:eventType="entersGeofence" loc:distanceThreshold="123" loc:distanceType="linearDistance" />
    </bpmn2:startEvent>

As is:

    <bpmn2:startEvent id="StartEvent_1" eventType="entersGeofence" distanceThreshold="123" distanceType="linearDistance">
      <loc:locationEventDefinition id="LocationEventDefinition_01388jx" />
    </bpmn2:startEvent>

Furthermore the values of the attributes get lost when selecting another element and then select the StartEvent again.

I already adjusted the Moddle (following bpmn-js-examples/properties-panel-extension at master · bpmn-io/bpmn-js-examples · GitHub)

            "name": "LocationEventDefinition",
            "superClass": [
                "bpmn:EventDefinition"
            ],
            "properties": [
              {
                "name": "eventType",
                "type": "String",
                "isAttr": true
              },
              {
                "name": "distanceThreshold",
                "type": "Integer",
                "isAttr": true
              },
              {
                "name": "distanceType",
                "type": "String",
                "isAttr": true
              },
              {
                "name": "implementation",
                "type": "String",
                "isAttr": true
              },
              {
                "name": "location1",
                "type": "String",
                "isAttr": true
              },
              {
                "name": "location2",
                "type": "String",
                "isAttr": true
              },
              {
                "name": "polygonPoints",
                "type": "String",
                "isAttr": true
              }
            ]
        }

and included the new Event into a ReplaceMenuProvider:
grafik
I also added a Location-specific Group to the Properties Panel (following bpmn-js-examples/properties-panel-extension at master · bpmn-io/bpmn-js-examples · GitHub)
grafik

I don’t know how I can store the attributes in the locationEventDefinition instead of the startEvent.
I want to avoid to store them in the extensionElements, because this would not reflect the moddle extension.

Thank you all in advance! :slight_smile: