*/
public void run() {
Selector selector;
try {
PickResponseChannel pickResponseChannel = newChannel(PickResponseChannel.class);
CorrelationKeySet keySet = new CorrelationKeySet();
PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink);
for( OScope.CorrelationSet cset : _oevent.joinCorrelations ) {
if(getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset)));
}
}
for( OScope.CorrelationSet cset : _oevent.matchCorrelations ) {
if (!getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
throw new FaultException(_oevent.getOwner().constants.qnCorrelationViolation,"Correlation not initialized.");
}
keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset)));
}
if( keySet.isEmpty() ) {
// Adding a route for opaque correlation. In this case correlation is done on "out-of-band" session id.
String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
keySet.add(new CorrelationKey("-1", new String[] {sessionId}));
}
selector = new Selector(0,pLinkInstance,_oevent.operation.getName(), _oevent.operation.getOutput() == null, _oevent.messageExchangeId, keySet, _oevent.route);
getBpelRuntimeContext().select(pickResponseChannel, null, false, new Selector[] { selector} );
instance(new WAITING(pickResponseChannel));