Runtime tools : Service engine : How to use Service Engine? : Multi-flow management
  
Multi-flow management
ServiceEngine se = ServiceEngine.getInstance();
RemoteSession rs = se.createRemoteSession("zh_CN", null, null);
System.out.println(rs.sessionID);
 
HashMap<String, RemoteFlow> rfc = rs.getRemoteFlowContainer();
 
KeyedCollection data = (KeyedCollection)KeyedCollection.readObject("input");
 
RemoteFlow rf = rs.createRemoteFlow("sampleFlow", null, data);
rfc.put("flow-1", rf);
 
rf = rs.createRemoteFlow("sampleFlow", null, data);
rfc.put("flow-2", rf);
// RemoteSession
System.out.println(rs);
 
rf = rfc.get("flow-1");
rf.changeEvent("nextEvent", data, data);
System.out.println(rf.getStateName());
System.out.println(data);
 
rf = rfc.get("flow-2");
rf.changeEvent("nextEvent", data, data);
System.out.println(rf.getStateName());
System.out.println(data);
rf.close();
rf = rfc.get("flow-1");
rf.close();
// RemoteSession
System.out.println(rs);
 
rs.close();
Go up to
How to use Service Engine?