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