private Operation getMyRoleOperation(String operationName) {
return _plinkDef.getMyRoleOperation(operationName);
}
private CorrelationKeySet computeCorrelationKeys(MyRoleMessageExchangeImpl mex) {
CorrelationKeySet keySet = new CorrelationKeySet();
Operation operation = mex.getOperation();
Element msg = mex.getRequest().getMessage();
Map<String, Node> headerParts = mex.getRequest().getHeaderParts();
javax.wsdl.Message msgDescription = operation.getInput().getMessage();
//TODO get filter from the system
QName correlationFilter = _process.getCorrelationFilter(_plinkDef.getName());
if (correlationFilter != null) {
ExtensionCorrelationFilter extCorFilter =
createExtensionCorrelationFilterImplementation(correlationFilter);
if (extCorFilter != null) {
CorrelationKey extensionKey = new CorrelationKey("-1",
extCorFilter.computeCorrelationValues(mex.getRequest().getMessage(),
mex.getRequest().getHeader()));
keySet.add(extensionKey);
}
}
Set<OScope.CorrelationSet> csets = _plinkDef.getNonInitiatingCorrelationSetsForOperation(operation);
for (OScope.CorrelationSet cset : csets) {
CorrelationKey key = computeCorrelationKey(cset,
_process.getOProcess().messageTypes.get(msgDescription.getQName()), msg, headerParts);
keySet.add(key);
}
csets = _plinkDef.getJoinningCorrelationSetsForOperation(operation);
for (OScope.CorrelationSet cset : csets) {
CorrelationKey key = computeCorrelationKey(cset,
_process.getOProcess().messageTypes.get(msgDescription.getQName()), msg, headerParts);
keySet.add(key);
}
// Let's creata a key based on the sessionId
String mySessionId = mex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID);
if (mySessionId != null)
keySet.add(new CorrelationKey("-1", new String[] { mySessionId }));
return keySet;
}