public void handleJobDetails(JobDetails jobDetail, final Date when) {
JobDetails we = jobDetail;
__log.debug("handleJobDetails " + jobDetail + " " + when);
if (we.getType() == JobType.INVOKE_INTERNAL) {
final BpelProcess p = engine._activeProcesses.get(we.getProcessId());
final ProcessDAO processDAO = p.getProcessDAO();
final MyRoleMessageExchangeImpl mex = (MyRoleMessageExchangeImpl) engine.getMessageExchange(we.getMexId());
p.invokeProcess(mex,
// time,
new BpelProcess.InvokeHandler() {
public boolean invoke(PartnerLinkMyRoleImpl target, RoutingInfo routing, boolean createInstance) {
if (routing.messageRoute == null && createInstance) {
__log.debug("creating new instance via live communication mex:" + mex);
ProcessInstanceDAO newInstance = processDAO.createInstance(routing.correlator);
ReplayerContext context = new ReplayerContext(null);
context.bpelEngine = (BpelEngineImpl) engine;
contexts.add(context);
ReplayerBpelRuntimeContextImpl runtimeContext = new ReplayerBpelRuntimeContextImpl(p, newInstance, new PROCESS(p.getOProcess()), mex,
// time,
context);
context.runtimeContext = runtimeContext;
runtimeContext.setCurrentEventDateTime(when);
runtimeContext.updateMyRoleMex(mex);