Hello guys, I’ve successfully revived an old topic BPMN-Connection for custom-elements and I’m sorry.
But since then I’ve think a bit, so here is the new one!
What I want to achieve is next:
I want to be able to model a signal path through the devices.
To do so, I suppose, I need to customise BPMN elements, for instance I want to create a device representation, it could look like this
Such element should be available as a whole custom element - just get it from palette, place it and you are good.
So here is my first question - how to create such composite element and do not allow user to change it internals.
Next, to be able to model a whole path I need to create some custom elements, like “internet”. I was playing with custom elements repo but I’ve found any custom element can’t be connected with regular connection.
Here is my second question - as I was planing to ad “internet” elements as such custom I need to understand how to implement such behaviour.
This sounds like a cool project, I’ll try to give you some hints
So here is my first question - how to create such composite element
Have a look at how we create expanded Subprocesses:
It is a composite of 2 elements, you can easily expand on it to include more elements. Here is a link to github:
and do not allow user to change it internals.
You can add custom rules that restrict movement. For example, check out the MoveRules or, for a more complex example, BpmnRules. These rules also define which elements can be connected to each other.
First question: How is this related to BPMN? If it’s not then I’d argue bpmn-js isn’t the right tool. Maybe a custom editor based on diagram-js would be a better choice.
Given these requirements, I’d definitely build it with diagram-js. You can still look at how certain features were built in bpmn-js as inspiration. I’d argue that something like start and end semantics isn’t enough to justify using bpmn-js. All the basics of snapping, grid snapping, etc. are part of diagram-js.