Adding custom extension to User Task Actvity

Hi

I created the moddle and now I want to create XML like below.

<bpmn:extension>
<qa:form>
<qa:field></qa:field>
</qa:form>
<bpmn:extension>

so i used the function like this to create moddle .as below.
**v.extensionElements.get(‘values’).push(bpmnFactory._model.create(‘qa:form’));

but got the below error. How to register the element to create like above code.

index.js:522 Uncaught Error: unknown type qa:form
** at Registry.mapTypes (index.js:522)**
** at Registry.getEffectiveDescriptor (index.js:547)**
** at BpmnModdle.Moddle.getType (index.js:772)**
at BpmnModdle.Moddle.create (index.js:740)
at Object.get (SpellProps.js:38)
at PropertiesPanel.js:1000
at arrayEach (_arrayEach.js:15)
at forEach (forEach.js:38)
at PropertiesPanel.js:990

For further assistance, please share a CodeSandbox that reproduces your issue in a way that we can inspect it.

Solved. I was doing it wrong . Issue got resolved. Thanks

Good to hear! Mind you sharing your solution so others can benefit from it as well? :slight_smile:

{
“name”: “Ext”,
“uri”: “http://some-company/schema/bpmn/qa”,
“prefix”: “qa”,
“xml”: {
“tagAlias”: “lowerCase”
},
“types”: [
{
“name”: “Event”,
“extends”: [
“bpmn:StartEvent”
],

  "properties": [

    {

      "name": "form",

      "isAttr": true,

      "type": "String"

    },{

      "name": "forms",

      "isMany": false,

      "type": "Forms"

   },

{

  "name":"Forms",

  "superClass": [ "Element" ],

  "properties": [

      {

        "name": "dataField",

        "isMany": true,

        "type": "Element"

      }

    ]

}
}

above is my moddle, so i was trying to create element from forms attribute which reference Forms type.

So my wrong approach was “bpmnFactory.create(‘qa:forms’);” which was giving above error . Now i corrected it and using like this .
" bpmnFactory.create(‘qa:Forms’);."

Thanks.

The reason is that you model extension contains:

“xml”: {
  “tagAlias”: “lowerCase”
},

which results in lowercase tag names. When using moddle#create you have to use the name that you defined in the model extension, which is uppercase.