What is metamodel?

I want to create one custom element which its base XML is like this:

        <flowable:eventType xmlns:flowable="http://flowable.org/bpmn"><![CDATA[lll]]></flowable:eventType>
        <flowable:eventOutParameter xmlns:flowable="http://flowable.org/bpmn" source="aa" sourceType="string" target="aa"></flowable:eventOutParameter>
        <flowable:channelKey xmlns:flowable="http://flowable.org/bpmn"><![CDATA[ppp]]></flowable:channelKey>
        <flowable:channelType xmlns:flowable="http://flowable.org/bpmn"><![CDATA[kafka]]></flowable:channelType>

Is this one metamodel or one event type? what is the difference between them?

What exactly do you want to accomplish? Create a flowable BPMN diagram? Why not use the flowable on board facilities for it?

If you want to support a custom vendor extensions you can use any elements to create them:

moddle.createAny('eventType', 'http://flowable.org/bpmn', {
   $body: '<![CDATA[lll]]>'

Alternatively you create a custom moddle schema for it.

I want to create one custom element which has startEvent, extensionElements and flowable:eventType like image shown above.
Now I have one custom element using palette like below. But when I drag it into diagram, its icons will become startEvent default icon.

function createRSE(event) {
      const shape = elementFactory.create('shape', { type: 'bpmn:StartEvent' });
      if ( document.$modeler) {
        const modeler = document.$modeler
        const moddle = modeler.get("moddle");
        const flowableEventType = moddle.create('flowable:EventType', {
          'xmlns:flowable': "http://flowable.org/bpmn"
        flowableEventType.body = '8888'
        let extensionElements = moddle.create('bpmn:ExtensionElements', {
          values: [flowableEventType]
        extensionElements.$parent = shape
        shape.businessObject.extensionElements = extensionElements
      create.start(event, shape);

'create.registry-start-event': {
        type: 'bpmn:MessageEventDefinition',
        group: 'events',
        className: 'bpmn-icon-start-event-message',
        title: translate('Create RSE'),
        action: {
          dragstart: createRSE,
          click: createRSE


Where should I fix?

A metamodel is a higher-level model that defines the structure, rules, and constraints of other models within a certain domain. In other words, it’s a model that describes the characteristics and relationships that other models should have. Metamodels are often used in software engineering, system design, and various modeling disciplines to provide a framework for creating and understanding different types of models.