Can there be only one magic namespace?

I have set up a property panel example from this url:
properties panel

It will add a new namespace magic in the magic descriptor file, when I want to add another property group simliar as the magic group, it still need to be added a new namespace, I only want to use one namespce actually, and I try to make it multiple descriptor files, it seemed that not working. How can I add new property group always using one namespace. Thanks

{
  "name": "Magic",
  "prefix": "magic",
  "uri": "http://magic",
  "xml": {
    "tagAlias": "lowerCase"
  },
  "associations": [],
  "types": [
    {
      "name": "BewitchedStartEvent",
      "extends": [
        "bpmn:StartEvent",
        "bpmn:EndEvent",
        "bpmn:Task"
      ],
      "properties": [
        {
          "name": "pen",
          "isAttr": true,
          "type": "String"
        },
        {
          "name": "spell",
          "isAttr": true,
          "type": "String"
        }
      ]
    }
  ]
}

Hi,

It is hard for me to follow what excactly you are trying to do, what you already tried and where you are currently stuck.
If you are stuck with a specific problem, could you please share a CodeSandbox that reproduces your issue in a way that we can inspect it? This will help us understand better what you are trying to achieve.

Thanks :heart:

If I have another descriptor file such as below, I want to be a same magic namespace, but there will throw an error when the program is loading.

{
  "name": "Transition",
  "prefix": "magic",
  "uri": "http://magic",
  "xml": {
    "tagAlias": "lowerCase"
  },
  "associations": [],
  "types": [
    {
      "name": "Activity Type",
      "extends": [
        "bpmn:InclusiveGateway"
      ]
    },
    {
      "name": "GroupBehaviours",
      "superClass": [ "Element" ],
      "properties": [
        {
          "name": "priority",
          "isMany": true,
          "isAttr": true,
          "type": "String"
        }
      ]
    }
  ]
}

Error detail:

Uncaught Error: package with prefix <magic> already defined

How can I always use the unique namespace in all every group? Hope someone can make any suggestions. Thanks

Oh, you are talking about the moddle extension.

Those need separate prefixes for different extensions. However, you can still split your code into multiple files when you combine them before supplying them to as one extension to moddleExtensions.

Eg., split your types into multiple Files and then add them to one Moddle descriptor like so:

magicModdleDescriptor.types.push(...magicTypes, ...otherMagicTypes)

@Martin Thanks your answer, that’s great, I can split multiple descriptor files only one namespace now. It will make the program more readable.

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