Ejemplo n.º 1
0
  public void recoverActivity(
      final String channel, final long activityId, final String action, FaultInfo fault) {
    // TODO: better translation here?
    final FaultData fdata =
        (fault != null) ? new FaultData(fault.getFaultName(), null, fault.getExplanation()) : null;

    _vpu.inject(
        new JacobRunnable() {
          private static final long serialVersionUID = 3168964409165899533L;

          public void run() {
            ActivityRecoveryChannel recovery =
                importChannel(channel, ActivityRecoveryChannel.class);
            __log.info(
                "ActivityRecovery: Recovering activity "
                    + activityId
                    + " with action "
                    + action
                    + " on channel "
                    + recovery);
            if (recovery != null) {
              if ("cancel".equals(action)) recovery.cancel();
              else if ("retry".equals(action)) recovery.retry();
              else if ("fault".equals(action)) recovery.fault(fdata);
            }
          }
        });
  }
Ejemplo n.º 2
0
  /*
   * (non-Javadoc)
   *
   * @see org.apache.ode.bpel.engine.rapi.OdeInternalInstance#onInvokeResponse(java.lang.String, java.lang.String)
   */
  public void onInvokeResponse(final String invokeId, InvokeResponseType irt, final String mexid) {
    // NOTE: do the switch outside the inject, since we don't want to end up serializing
    // InvokeResponseType objects!
    switch (irt) {
      case REPLY:
        _vpu.inject(
            new BpelJacobRunnable() {
              private static final long serialVersionUID = -1095444335740879981L;

              public void run() {
                importChannel(invokeId, InvokeResponseChannel.class).onResponse();
              }
            });
        break;
      case FAULT:
        _vpu.inject(
            new BpelJacobRunnable() {
              private static final long serialVersionUID = -1095444335740879981L;

              public void run() {
                importChannel(invokeId, InvokeResponseChannel.class).onFault();
              }
            });
        break;
      case FAILURE:
        _vpu.inject(
            new BpelJacobRunnable() {
              private static final long serialVersionUID = -1095444335740879981L;

              public void run() {
                importChannel(invokeId, InvokeResponseChannel.class).onFailure();
              }
            });
        break;
    }
  }
Ejemplo n.º 3
0
  /*
   * (non-Javadoc)
   *
   * @see org.apache.ode.bpel.engine.rapi.OdeInternalInstance#onTimerEvent(java.lang.String)
   */
  public void onTimerEvent(final String timerId) {
    getORM().cancel(timerId);

    _vpu.inject(
        new JacobRunnable() {
          private static final long serialVersionUID = -7767141033611036745L;

          public void run() {
            // NOTE: note short cut, we chose timer id to be the same as the exported channel
            // representation.
            TimerResponseChannel responseChannel =
                importChannel(timerId, TimerResponseChannel.class);
            responseChannel.onTimeout();
          }
        });
  }
Ejemplo n.º 4
0
  /** Proxy to {@link BpelRuntimeContext# }. */
  public void cancel(PickResponseChannel responseChannel) {
    final String id = responseChannel.export();
    _brc.cancelSelect(id);

    getORM().cancel(id);

    _vpu.inject(
        new JacobRunnable() {
          private static final long serialVersionUID = 6157913683737696396L;

          public void run() {
            TimerResponseChannel responseChannel = importChannel(id, TimerResponseChannel.class);
            responseChannel.onCancel();
          }
        });
  }
Ejemplo n.º 5
0
  /*
   * (non-Javadoc)
   *
   * @see org.apache.ode.bpel.engine.rapi.OdeInternalInstance#onMyRoleMessageExchange(java.lang.String, java.lang.String)
   */
  public void onSelectEvent(
      final String selectId, final String messageExchangeId, final int selectorIdx) {
    getORM().associate(selectId, messageExchangeId);

    _vpu.inject(
        new JacobRunnable() {
          private static final long serialVersionUID = 3168964409165899533L;

          public void run() {
            // NOTE: we chose the selectId to be the exported representation of the pick response
            // channel!
            PickResponseChannel responseChannel =
                importChannel(selectId, PickResponseChannel.class);
            responseChannel.onRequestRcvd(selectorIdx, messageExchangeId);
          }
        });
  }
Ejemplo n.º 6
0
 /* (non-Javadoc)
  * @see org.apache.ode.bpel.engine.rapi.OdeInternalInstance#createInstance(java.lang.String)
  */
 public void onCreateInstance(String messageExchangeId) {
   _vpu.inject(new PROCESS(_runtime._oprocess));
 }