if (process == null) {
String errmsg = __msgs.msgProcessNotActive(pdao.getProcessId());
__log.error(errmsg);
// TODO: Perhaps we should define a checked exception for this
// condition.
throw new BpelEngineException(errmsg);
}
InvocationStyle istyle = mexdao.getInvocationStyle();
if (istyle == InvocationStyle.RELIABLE || istyle == InvocationStyle.TRANSACTED)
assertTransaction();
switch (mexdao.getDirection()) {
case MessageExchangeDAO.DIR_BPEL_INVOKES_PARTNERROLE:
return process.createPartnerRoleMex(mexdao);
case MessageExchangeDAO.DIR_PARTNER_INVOKES_MYROLE:
return process.lookupMyRoleMex(mexdao);
default:
String errmsg = "BpelEngineImpl: internal error, invalid MexDAO direction: " + mexId;
__log.fatal(errmsg);
throw new BpelEngineException(errmsg);
}
}
};
try {
if (inmemdao != null || _contexts.isTransacted())
return loadMex.call();
else
return enqueueTransaction(loadMex).get();
} catch (ContextException e) {
throw new BpelEngineException(e);
} catch (Exception e) {
throw new BpelEngineException(e);
}
} finally {
_mngmtLock.readLock().unlock();
}