How to insertLink custom data for link while drawing link

The simplest solution is to just set LinkingTool.archetypeLinkData to be a JavaScript Object with whatever properties you like.

Each call to LinkingTool.insertLink will make a copy of that object as the model data for the new Link.

If you want to customize the data depending on the circumstances of the new link-drawing, implement a “LinkDrawn” DiagramEvent listener that sets whatever properties you like on the e.subject.data.

Remember that if the Link has data Bindings whose sources are data properties that you want to set, you’ll need to call Model.setDataProperty.