How to define linkTemplate which has default extra data

When linking from two nodes in flochart diagram, I want to the link generated having default data for example:
{ from: ,to:, …, extra_data:{filed1:“XX2”,iled2:“XX1”} }

Well, you can either set LinkingTool.archetypeLinkData to have all of the properties that you want each link data object to have by default, or you can implement a “LinkDrawn” DiagramEvent listener to modify the link data object however you want right after the user draws a new link.

The first choice will by default cause the extra_data property value, a JavaScript Object, to be shared by all instances of the link data. But note that you can implement a GraphLinksModel.copyLinkDataFunction to copy those default property values however you like.

The second choice will give you the opportunity to copy or add whatever data structures and values that you like.