I think you still need to set the two properties, just as the Draggable Link sample does, isUnconnectedLinkValid on the two linking tools.
But you also need to add a linkValidation predicate, either on those tools or in your case on the Node, to permit or to disallow such unconnected links.
function linkValidation(fromNode, fromPort, toNode, toPort){
var fromNodeData = fromNode.data;
var toNodeData = toNode.data;
if(fromNodeData.compId === 1)
return false;
return true;
}
in the above link validation function, i tried to restrict users to draw link from node if its component id is 1.
But, its not working
Still user can draw a link from that node as unconnected. it only restrict them to connect to other node. if its not possible using link validation. is it possible to allow few nodes to have unconnected links?.
I was wrong about linkValidation being called when isUnconnectedLinkValid is true and there is no other node. So forget about linkValidation (unless you need it for other reasons) and put the check in the LinkingTool.insertLink method. For example: