is just a JavaScript expression that evaluates those two variables. There is no way for GoJS to know that the value of some variable has changed, since GoJS never sees those variable names.
When you want to change the appearance of a Link, you could:
a) find the Link, find the Shape inside it, and then set the Shape.stroke and Shape.strokeDashArray properties. This is demonstrated at Process Flow.
b) establish a Binding of those two Shape properties on properties in your link data, which you set by calling Model.setDataProperty. This is demonstrated at GoJS Data Binding -- Northwoods Software (“Changing data values”).
c) establish a Binding of those two Shape properties on properties in your
link data, which you set directly and then you call Model.updateTargetBindings on that link data object in the model.
d) establish a Binding of those two Shape properties on properties in your
link data, which you set directly and then you call Link.updateTargetBindings on the Link in the Diagram.