My custom element have to behave like “bpmn:Task” and should be inside the diagram layer.
Does I always need a customRules?
Should I copy all rules from “BpmnRules.js”?
Or is there any better solution?
thank you very much for your fast reply.
Unfortunately, it does not work.
My custom shape has a different size {width: 120, height: 60} than “bpmn:Task”.
So the selection path around the shape has the size of default task and the connection path starts at the middle of the shape.
I also tried to use a custom ElementFactory like
But with this customElementFactory there is an issue during creating the customShape.
At the palette you find a black star as my custom task. Just create a new element with the star icon.
You can see that the selection border does not fit to the shape.
Afterwards you can go in the code to “custom/index.js” and remove comment for customElementFactory. If you now try to create a new task with star icon an error occur.
Thanks for sharing the codesandbox! I had a quick look.
The custom element you create does not have any di properties. These are needed to render it properly, e.g. to retrieve the correct fill color. Since the di is missing only if the custom element factory is loaded, it might be removed along these lines. You’d try to debug why this is happening.