I am completely new to Graphiti and I have to add a feature to an existing project.
Assuming I have three elements A -> B -> C in my diagram. I would like to be able to drag the element C, drop it in between A & B and update their connections in the same time in order to have A -> C -> B

A ---> B ---> C would become A ---> C ---> B

I found an existing question in the forum, but the provided code doesn't work completely in my case. When I drag an existing element onto another connection, the connection turns orange and nothing happens on drop. I modified the code with my knowledge and understanding of Graphiti, but I haven't reached any better result (see attached image).

the coding you have appenrently copied from our Sktech example (the link I provided in the other forum posting) is intended as a small example what needs to be done for achieving such a split-connection functionality. It works in the very simple setup of our Sketch test tool and uses some assumptions that are true in this tool but apparently not in yours.

Also the examlpe code will not care about removing the moved shape from the original location and will not merge the 2 open connections of the original location. You might try if it works with a shape that is placed within the same flow (parent shape has to stay the same, that is another of the assumptions) but has no connections attached so far. In not sure but that may work at least partly.

One more thing that will be missing are the decorators on the new connection. You will need to create them as well.

Basically you would need to do these steps:
1) Check any precoditions in your diagram
2) Remove the shape from the original location, e.g. detach the connections and unify the 2 dangling connections into 1 (not sure how you would deal with different properties of the connection)
3) Take the new connection (drop target, the one onto you drop the shape) and split it, e.g. take the connection and attach it to a suitable anchor in your shape (Input), then create a new connection (best reusing your create connection feature) to create a second connection from the dragged shape to the target of the original connection. Not sure if all properties of the connection should be the same as the original connection your dropped the shape onto.

I'm afraid, this is a rather tricky task to start with on Graphiti. The concrete coding will pretty much depend on the structure and additional tool related boundary conditions. The best advice I can give here is to split this into the above steps and try to reuse as much existing functionality (e.g. create feature, attach connection functionality) as possible.