Extending existing types breaks model extension

Hi! I want to extend existing types using the “extends” property in my model extension. This seems to break the extension.

I set up a sandbox to reproduce this behavior with the .json from the model extension example. You may remove the first type in the .json to see the extension working with types that use super class only. Could you take a look at this? Many thanks!

Best regards, Valentin

Any insights on this? Extensions work great on the bpmn-js Modeler:

        this.modeler = new Modeler({
            ...
            moddleExtensions: {
                sustainability: SustainabilityExtension
            },
            ...
        });

Now I want to build a node package that performs some logic on the model xml and I would like to use bpmn-moddle to instatiate a model tree to do this:

        this.#moddle = new BpmnModdle([extension]);

I could workaround this by using explicit types but it does not fit our use case so finding a solution would be great. Any ideas what might cause the error on the instantiation?

You can set up your extension like this:

import BpmnModdle from "bpmn-moddle";

const extension = require("./extension.json");

const moddle = new BpmnModdle({
  qa: extension
});

CodeSandbox: moddle-extension (forked) - CodeSandbox

1 Like

Looks good, thank you! Interesting that the constructor works with an array just without using the extends property :slight_smile: