Exemplo n.º 1
0
 /** @see org.apache.ode.jacob.JacobRunnable#run() */
 public void run() {
   Selector selector;
   try {
     PickResponseChannel pickResponseChannel = newChannel(PickResponseChannel.class);
     if (_oevent.isRestful()) {
       getBpelRuntime()
           .checkResourceRoute(
               _scopeFrame.resolve(_oevent.resource),
               _oevent.messageExchangeId + _counter,
               pickResponseChannel,
               0);
     } else {
       PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink);
       selector =
           new Selector(
               0,
               pLinkInstance,
               _oevent.operation.getName(),
               _oevent.operation.getOutput() == null,
               _oevent.messageExchangeId,
               getCorrelationKey(pLinkInstance));
       getBpelRuntime().select(pickResponseChannel, null, false, new Selector[] {selector});
     }
     instance(new WAITING(pickResponseChannel, _scopeFrame, _counter));
   } catch (FaultException e) {
     __log.error(e);
     if (_fault == null) {
       _fault = createFault(e.getQName(), _oevent);
     }
     terminateActive();
     instance(new WAITING(null, _scopeFrame, _counter));
   }
 }
Exemplo n.º 2
0
    /** @see org.apache.ode.jacob.JacobRunnable#run() */
    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));
      } catch (FaultException e) {
        __log.error(e);
        if (_fault == null) {
          _fault = createFault(e.getQName(), _oevent);
        }
        terminateActive();
        instance(new WAITING(null));
      }
    }