コード例 #1
0
  public Batch run(String batchCode) throws AxelorException {

    Batch batch;
    MailBatch mailBatch = mailBatchRepo.findByCode(batchCode);

    if (batchCode != null) {
      switch (mailBatch.getActionSelect()) {
        case MailBatchRepository.ACTION_REMIN_TIMESHEET:
          batch = null;
          break;
        default:
          throw new AxelorException(
              String.format(
                  I18n.get(IExceptionMessage.BASE_BATCH_1), mailBatch.getActionSelect(), batchCode),
              IException.INCONSISTENCY);
      }
    } else {
      throw new AxelorException(
          String.format(I18n.get(IExceptionMessage.BASE_BATCH_2), batchCode),
          IException.INCONSISTENCY);
    }

    return batch;
  }
コード例 #2
0
 public Batch remindMail(MailBatch mailBatch) throws AxelorException {
   return this.run(mailBatch.getCode());
 }