How Can I get portId for a newly drawn link?

Hi, I really need some help.

Thanks

Tool.doDeactivate will be called under all circumstances that the tool is no longer running, not only when the user has successfully drawn a new link.

So, instead of overriding any LinkingTool methods, implement a DiagramEvent listener:

myDiagram.addDiagramListener("LinkDrawn", function(e) {
        var link = e.subject;
        alert(link.toPort.portId);
});

WOW! Awesome! Thank you! Thank you! Thank you!