That was what I was afraid of.
First I used this:
linkFromPortIdProperty: (linkData) => { return this.CalculateFromPort(linkData); },
Where CalculateFromPort is my own function where I checked the connected nodes and returned a portID.This worked, however not when anything changes as linkFromPortIDProperty is not called when underlying nodes changes. So I guess I have to set the portID properties in all affected links every time a node is changed.
Thank you for the reply