Error while calling saveXML with isMany property

Hello

I want to add a custom attribute to a gateway.

I want something with this type

Array<{color:string; text: string}>

So I created an extension with the following:

extension definition
"types": [
    {
      "name": "Options",
      "extends": ["bpmn:ExclusiveGateway"],
      "properties": [
        { "name": "Options", "type": "Option", "isMany": true, "isAttr": false }
      ]
    },
    {
      "name": "Option",
      "properties": [
        { "name": "text", "type": "String", "isAttr": true },
        { "name": "color", "type": "String", "isAttr": true }
      ]
    }
  ]

However when I call modeler.saveXML I have the following error:

error stack trace
Uncaught (in promise) TypeError: can't access property "isGeneric", elementDescriptor is undefined
    build index.esm.js:734
    parseContainments index.esm.js:895
    forEach index.esm.js:344
    parseContainments index.esm.js:886
    forEach index.esm.js:344
    parseContainments index.esm.js:869
    build index.esm.js:749
    parseContainments index.esm.js:895
    forEach index.esm.js:344
    parseContainments index.esm.js:886
    forEach index.esm.js:344
    parseContainments index.esm.js:869
    build index.esm.js:749
    parseContainments index.esm.js:895
    forEach index.esm.js:344
    parseContainments index.esm.js:886
    forEach index.esm.js:344
    parseContainments index.esm.js:869
    build index.esm.js:749
    toXML index.esm.js:1076
    toXML index.esm.js:28
    toXML index.esm.js:26
    saveXML BaseViewer.js:148
    saveXML BaseViewer.js:139

I made a small CodeSandbox that reproduces the issue

Name of the type cannot be the same as the name of its property.

As far as I know, the usual patter is to lower case properties names, and you should be fine. :slight_smile:

{
  "name": "Options",
  "extends": ["bpmn:ExclusiveGateway"],
  "properties": [
    { "name": "options", "type": "Option", "isMany": true, "isAttr": false }
  ]
}
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.