mexDao.setStatus(MessageExchange.Status.REQ);
mexDao.setOperation(operation.getName());
mexDao.setPortType(partnerLink.getModel().getPartnerRolePortType().getQName());
mexDao.setPartnerLinkModelId(partnerLink.getModel().getId());
PartnerRoleChannel partnerRoleChannel = _bpelProcess.getPartnerRoleChannel(partnerLink.getModel());
PartnerLinkDAO plinkDAO = fetchPartnerLinkDAO(partnerLink);
Element partnerEPR = plinkDAO.getPartnerEPR();
EndpointReference partnerEpr;
if (partnerEPR == null) {
partnerEpr = partnerRoleChannel.getInitialEndpointReference();
// In this case, the partner link has not been initialized.
if (partnerEpr == null) throw new UninitializedPartnerEPR();
} else {
partnerEpr = _contexts.eprContext.resolveEndpointReference(partnerEPR);
}