Adding a new connector type


#1

Hi,

I’ve been trying to make some extension tests with the bpmn-js modeler.
I already succeeded in adding new elements to the bpmn moddle “metamodel”, and also to the main palette and the contextual palette.
It was quite easy to do, thanks to the various examples already available.

My point is that I want now to add a new type of connector that will allow to connect my new types.
Ex: I created two new types A and B, and I want now to connect them through a connector C.

I had a look of how you’ve done this with the “SequenceFlow” connector, but when I try to do the same I get an error in the BpmnRenderer : “TypeError: Cannot read property ‘0’ of undefined”.

This error occurs when the “C” connector is being rendered, in the “createPathFromConnection(connection)” method, because “connection.waypoints” is undefined.

Do you have an idea of what could have been missed (or a code snippet, doing this kind of extension).
Unfortunately, I’m not able to share my code for the moment.

Thanks


#2

Hi,

I finally find out what was going on.
The problem was in the “ContextPadProvider” : the connection tool action was not provided with the correct information (“click” & “dragstart”).

Hope this will help someone else and avoid him a couple of debugging hours :slight_smile:


closed #3