Links Based Questions

  1. How to restrict cyclic link between two nodes?
    ex: a->b, should not a <- b

2.How to restrict links between different groups?
ex:
Lane 1: a
| should not allow
Lane 2 : a
3. digram.addLinkData method getting error

Have you read about linking validation, GoJS Validation -- Northwoods Software ?

For your other question, how am I supposed to help you unless you tell me what the error is and exactly what the circumstances are when the error happens? Are there any times when the error does not happen, and if so, when?

yes i go-through that but in my case it doesn’t work
example
a->b->c can be linked but c -> b or b -> a or c -> a should be avoided

sample my code:
{ key: “oneA”, group: “one”, from: true },
{ key: “oneB”, group: “one”, from: true },
{ key: “oneC”, group: “one”, from: true }

linkTemplate:
myDiagram.linkTemplate =
$(go.Link, { routing: go.Link.AvoidsNodes, curve: go.Link.JumpOver, corner: 5 }, { relinkableFrom: false, relinkableTo: false },
$(go.Shape),
$(go.Shape, { toArrow: “Standard” })
);

Can you set Diagram.validCycle to get what you want?

can you please say some example?

http://gojs.net/latest/intro/validation.html

And there are several samples that set Diagram.validCycle.

You can search all samples and extensions on Github:

thank you so much @walter @simon for your wonderful support
but still couldn’t find to restricts links between groups

Did you try setting Diagram.validCycle? If so, to what value, and how did that not meet your needs?
If it was not satisfactory, what did you implement as a linkValidation predicate, and where did you set it?