LinkingTool - insertLink -how to choose a category link template

Hello
I have trouble, I do not know how to change the link template ( from diagram.linkTemplateMap) to something other than the default when I insert a link via linkingTool.insertLink

Best Regards Tadeusz :)

Just change the category of the LinkingTool.archetypeLinkData object to be whatever template category name that you want it to use.

The http://gojs.net/latest/samples/grafcet.html sample demonstrates one way to set the category on the myDiagram.toolManager.linkingTool.archetypeLinkData.

The custom LinkingTool in http://gojs.net/latest/extensions/BPMNClasses.js demonstrates how one can determine the new link category dynamically. It also replaces the whole LinkingTool.archetypeLinkData object instead of just changing its category property value.