Migrate process instance : from user task to sub process

Hi all,
I have a use case to migrate process instance which are waiting on a user task, to a newer version of the process. The target activity is in a sub process after a gateway.
source
image
target
image
the sub process

How can I create the migration plan, using java code
the method map Activities takes only sourceActivityId and targetActivityId. If I provide the correct Ids
does camunda create the targed subprocess ? and how can I initialize needed variables for the target subprocess.

Regards,