code: private void postProcess(ProcessMethodCallback callback, TransactionContext txContext,
                             InputDatum input, ProcessMethod.ProcessResult result) {
      InputContext inputContext = input.getInputContext();
      Throwable failureCause = null;
      FailureReason.Type failureType = FailureReason.Type.IO_ERROR;
      try {
        if (result.isSuccess()) {
          // If it is a retry input, force the dequeued entries into current transaction.
          if (input.getRetry() > 0) {
            input.reclaim();
          }
          txContext.finish();
        } else {
          failureCause = result.getCause();
          failureType = FailureReason.Type.USER;
          txContext.abort();
        }
      } catch (Throwable e) {
        LOG.error("Transaction operation failed: {}", e.getMessage(), e);
        failureType = FailureReason.Type.IO_ERROR;
        if (failureCause == null) {
          failureCause = e;
        }
        try {
          if (result.isSuccess()) {
            txContext.abort();
          }
        } catch (Throwable ex) {
          LOG.error("Fail to abort transaction: {}", inputContext, ex);
        }
      }
  
      try {
        if (failureCause == null) {
          callback.onSuccess(result.getEvent(), inputContext);
        } else {
          callback.onFailure(result.getEvent(), inputContext,
                             new FailureReason(failureType, failureCause.getMessage(), failureCause),
                             createInputAcknowledger(input));
        }
      } catch (Throwable t) {
        LOG.error("Failed to invoke callback.", t);
      }
    }
docs: Process the process result. This method never throws.