Model Extension from Custom Shapes Example

Hi,

I have followed the Custom Shapes Example and have been able to successfully create the custom:triangle shape. To now make the xml valid, I need to create a Model Extension, however, I am struggling to follow the Model Extension Example

My extension.json is as follows:

{ "name": "CustomElements", "uri": "http://custom", "prefix": "custom", "xml": { "tagAlias": "lowerCase" }, "types": [ { "name": "CustomShape", "extends": [ "bpmn:BPMNShape" ], "properties": [ { "bpmnElement": "Custom_1" } ], }, { "name": "Bounds", "extends": [ "dc:Bounds" ], "properties": [ { "height": "default", "width": "default", "x": "default", "y": "default" } } ], "emumerations": [], "associations": [] }

I then added the following to the modeler, where extension is the imported json file:

moddleExtensions: {
    custom: extension
}

I then added the following to the .bpmn initial file:

xmlns:custom="http://custom"

I can’t seem to get it working and I’m not sure if I’m even doing this correctly. Any help would be greatly appreciated.

As stated in the example:

This advanced example shows how to extend bpmn-js with new shapes and connections that are not part of the BPMN 2.0 diagram / incompatible with the BPMN 2.0 standard . Consult our :notebook: custom elements guide to learn how to extend the toolkit in a BPMN 2.0 compliant way.

Can you describe what your use case looks like? It’s very likely that adding custom shapes to the diagram is not the right approach.