mexDao.setProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID, partnerSessionId);
if (__log.isDebugEnabled())
__log.debug("INVOKE PARTNER (SEP): sessionId=" + mySessionId + " partnerSessionId=" + partnerSessionId);
MessageDAO message = mexDao.createMessage(operation.getInput().getMessage().getQName());
mexDao.setRequest(message);
message.setType(operation.getInput().getMessage().getQName());
buildOutgoingMessage(message, outgoingMessage);
// Get he my-role EPR (if myrole exists) for optional use by partner
// (for callback mechanism).
EndpointReference myRoleEndpoint = partnerLink.partnerLink.hasMyRole() ? _bpelProcess
.getInitialMyRoleEPR(partnerLink.partnerLink) : null;
PartnerRoleMessageExchangeImpl mex = new PartnerRoleMessageExchangeImpl(_bpelProcess._engine, mexDao,
partnerLink.partnerLink.partnerRolePortType, operation, partnerEpr, myRoleEndpoint, _bpelProcess
.getPartnerRoleChannel(partnerLink.partnerLink));
BpelProcess p2pProcess = null;
Endpoint partnerEndpoint = _bpelProcess.getInitialPartnerRoleEndpoint(partnerLink.partnerLink);
if (partnerEndpoint != null)
p2pProcess = _bpelProcess.getEngine().route(partnerEndpoint.serviceName, mex.getRequest());
if (p2pProcess != null) {
// Creating a my mex using the same message id as partner mex to "pipe" them
MyRoleMessageExchange myRoleMex = _bpelProcess.getEngine().createMessageExchange(
mex.getMessageExchangeId(), partnerEndpoint.serviceName,
operation.getName(), mex.getMessageExchangeId());
if (BpelProcess.__log.isDebugEnabled()) {
__log.debug("Invoking in a p2p interaction, partnerrole " + mex + " - myrole " + myRoleMex);
}
Message odeRequest = myRoleMex.createMessage(operation.getInput().getMessage().getQName());
odeRequest.setMessage(outgoingMessage);
((MessageImpl)odeRequest)._dao.setHeader(message.getHeader());
if (BpelProcess.__log.isDebugEnabled()) {
__log.debug("Setting myRoleMex session ids for p2p interaction, mySession "
+ partnerSessionId + " - partnerSess " + mySessionId);
}