Try using feature sequence initializers for corresponding link mapping in
.gmfmap model. This should help you to initialize from/to references (it's
possible to properly configure link mapping to sed fromContext/toContext).
Then you can try solving a problems with link rerouting.
In case you canot implement corresponding functionality using ocl in feature
sequence initializer then you can modify generated code.