camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.5k stars 481 forks source link

Diagram with `isDefault` element template cannot be created #3687

Closed nikku closed 1 year ago

nikku commented 1 year ago

Describe the bug

Camunda Modeler 5 does not create a new diagram if a default template for a process is defined. The same behavior works in Camunda Modeler v4.x.

Steps to reproduce

  1. Configure a C7 default template for bpmn:Process

    {
    "name": "ProcessDefaults",
    "id": "processFefaults",
    "description": "Default-Template for Process",
    "version": 1,
    "isDefault": true,
    "appliesTo": [
      "bpmn:Process"
    ],
    "properties": [
      {
        "label": "Demo Property Version-Tag",
        "type": "String",
        "value": "1",
        "editable": false,
        "description": "Demo Property",
        "binding": {
          "type": "property",
          "name": "camunda:versionTag"
        }
      }
    ]
    }
  2. Create a new C7 diagram
  3. See that diagram fails to create; the log reports an (uncaught) exception:

    Error: command required
      at CommandStack.execute (CommandStack.js:178:1)
      at index.esm.js:1851:1
      at forEach (index.esm.js:246:1)
      at MultiCommandHandler.preExecute (index.esm.js:1850:1)
      at CommandStack._internalExecute (CommandStack.js:438:1)
      at CommandStack.execute (CommandStack.js:186:1)
      at applyDefaultTemplates (applyDefaultTemplates.js:30:1)
      at PlatformBpmnModeler.invoke (index.esm.js:226:1)
      at BpmnEditor.handleImport (BpmnEditor.js:382:1)
      at BpmnEditor.importXML (BpmnEditor.js:577:1)

Expected behavior

Environment

Additional context

Reported via SUPPORT-17420.

nikku commented 1 year ago

Addressed via https://github.com/camunda/camunda-modeler/pull/3690.

nikku commented 1 year ago

Additional fix for error handling: https://github.com/camunda/camunda-modeler/pull/3691.

nikku commented 1 year ago

Closed via https://github.com/camunda/camunda-modeler/commit/b9c4514db693178f29cd4c07976145bea9282510.