1.deploy  process definition      —–Deployment deployment = repositoryService.createDeployment().addBytes(fileName, bytes).deploy();
2.implement your own ProcessParseCmd   
     —–public class ProcessParseCmd implements Command(List(ProcessDefinition)) ;
3. parse  usertask FlowElement(also you can parse startevent/ endevent node ),  insert  necessary information into your own  taskdef table;
    at the same time, when your parse every usertask node,  pasre  its  every  OutgoingFlows into your own nexttaskdef table; —- in step 2
4.your can also add informations(varibale , listener,transit……..) what you wanted  into those two tables;
5.then you will find  it is very easy to realize your mind.  even you can dynamicly change flow directions configed in your process definition.