private void scheduleInvokeCheck(PartnerRoleMessageExchangeImpl mex, OPartnerLink partnerLink, boolean p2p) {
boolean isTwoWay = mex.getMessageExchangePattern() ==
org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern.REQUEST_RESPONSE;
if (!_bpelProcess.isInMemory() && isTwoWay) {
JobDetails event = new JobDetails();
event.setMexId(mex.getMessageExchangeId());
event.setProcessId(_bpelProcess.getPID());
event.setInMem(false);
event.setType(JobType.INVOKE_CHECK);
// use a greater timeout to make sure the check job does not get executed while the service invocation is still waiting for a response
long timeout = getBpelProcess().getTimeout(partnerLink, p2p);
if (__log.isDebugEnabled()) __log.debug("Creating invocation check event in "+timeout+"ms for mexid " + mex.getMessageExchangeId());
Date future = new Date(System.currentTimeMillis() + timeout);
String jobId = _bpelProcess._engine._contexts.scheduler.schedulePersistedJob(event, future);