How to get new link data that created on drop of node on link?

we have a optionwhere user can drag and drop a node on link existing like below

i can get the oldlink detail that is from call service to if else but how get the link details from if else to call service async?

I assume you are doing something like the mouseDrop event handler on Links such as defined in the Flowgrammer sample’s dropOntoLink function.

Certainly in your code that adds the new link between the new node and the old destination node you have access to the new link data, both before and after calling GraphLinksModel.addLInkData.

Within the dropOntoLink function will have access to diagram element like this,
var diagram = e.diagram;
var newnode = diagram.selection.first(); when i do to get newnode link data it’s giving as null. so where else we can access the data for link from newnode

Templates are only meant to be copied into a Diagram, at which time they are bound to some model data. Templates must have no of their own – only instances in Diagrams. This way templates can be shared by multiple Diagrams and Models.

Generally one will have no need to refer to any templates after they have been initialized when setting up the diagram.

In your case, you can get to the data via, such as:

when we do will get node data but not the link data from the newnode to old destination node. i want to know the link data from newnode to old destination nde

If you have a reference to a Link, then will refer to the model data for that Link.

Your code that created a new link will have created that link data object already, assuming that you are using a GraphLinksModel.

i am getting link data. we want to set the label the for the new link that is from link if-else to call mapping async. now i am using
 var label = oldlink.findObject("LABEL");
                                                if (label !== null)
                                                    label.visible = true; to do this . but it's not working.

I realy cannot tell what situation that you have. Nor can I tell how that is different from what you want.

You can either depend on model data and data binding and call Model.setDataProperty, or you can manipulate the GraphObjects in the Diagram directly.