Removing node does not update related nodes

Hello! This is my first post here. I tried googling but can not see anyone else asking this same question so here we go. In a tree diagram with nodes and links, I removed a node and its link. The other nodes that lost dependency do not update/refresh. This is the issue I am trying to solve. Below is an example.

eg:
Original Diagram: A* -> B*
After removing node B and link: A*
Expected diagram after removing node B and link: A

A: is a node with no links
A* is a node that has a link

psuedo code:
startTransaction
removeNodeData
removeLinkDataCollection [removes link between A and B]
addLinkDataCollection [add a link with ‘from’ as node A and ‘to’ as undefined]
endTransaction

Do you have a sketch of what you want? Are you saying you want the diagram to still have a link coming from A, with the other side being unconnected?

If I understood the original post, I think the expectation is the remaining node A not have a connected link that is connected with nothing.

But the problem is that the code is explicitly adding a link that is connected with only one node:

addLinkDataCollection [add a link with ‘from’ as node A and ‘to’ as undefined]

So of course there has to be a Link connected with Node A.

If that is not what you (@arjun-now) wants, only add a link data object if both the “from” and the “to” nodes are present in the model.