Sequence flow not getting removed

Hi Team, I am trying to insert a new script task between a user task and a service task using fluent API builder. For this i have to remove the existing sequence flow from the user task to the service task.

user task ---------> service task (break this flow)
user task ---------> script task --------> service task (add this flow)

userTask.getOutgoing().remove(outgoingSequenceFlow);
I am using the above function to remove the flow. However the modeller still shows this flow.

After checking XML i found that the sequence flow tag doesn’t get removed. Also while the outgoing tag from the user task is removed, the sourceref in the sequenceflow tag still reamins which shows the flow.

hi, this question is fixed now?can you show the code, thanks!