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 =
createPartnerRoleMessageExchangeImpl(mexDao, partnerLink,
operation, partnerEpr, myRoleEndpoint);
mex.setProperty("activityId", ""+aid);
List<BpelProcess> p2pProcesses = null;
Endpoint partnerEndpoint = _bpelProcess.getInitialPartnerRoleEndpoint(partnerLink.partnerLink);
if (partnerEndpoint != null)
p2pProcesses = _bpelProcess.getEngine().route(partnerEndpoint.serviceName, mex.getRequest());
if (p2pProcesses != null && !p2pProcesses.isEmpty()) {
// 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 (myRoleMex instanceof BrokeredMyRoleMessageExchangeImpl) {
mex.setSubscriberCount(((BrokeredMyRoleMessageExchangeImpl) myRoleMex).getSubscriberCount());
}
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);
}