How to validate link drawn from one node to other node

Hi,

I have requirement where a i need to validate the link after the link drawn if condition is satisfied keep link else delete the link

You could check in a “LinkDrawn” DiagramEvent listener and remove the Link if it is invalid.

However if you can it is better to prevent the invalid link from being drawn in the first place:
https://gojs.net/latest/intro/validation.html