コード例 #1
0
 private static String getResult(OperationReport report) {
   if (report.isError()) {
     return DataProcessConstants.TRT_WARNING;
   } else {
     return DataProcessConstants.TRT_OK;
   }
 }
コード例 #2
0
  public void proceed(
      Connection con,
      JobProtocolParticipant jobProtocolParticipant,
      DataProcessJobRequest request,
      TreatmentLauncher treatmentLauncher)
      throws TreatmentException, SQLException {
    Log.debug(getClass(), ">>> Début exécution du job data-process (mode liste de traitements)");

    DataProcessContext context = DataProcessContextCodec.decode(request.getContext());
    ExecutionListModel executionListModel =
        new ExecutionListModelCodec().decode(request.getExecutionListModel());
    OperationReport report =
        treatmentLauncher.proceedTreatmentList(
            con,
            Integer.parseInt(request.getRepositoryId()),
            executionListModel,
            context,
            jobProtocolParticipant);

    JobAudit audit = new JobAudit(JobAudit.Type.MID);
    Arguments arguments = new Arguments();
    arguments.put(DataProcessConstants.OPERATION_REPORT, getResult(report));
    arguments.put(OPERATION_REPORT_XML, OperationReport.encode(report));
    audit.setArguments(arguments);
    jobProtocolParticipant.sendAudit(audit);

    Log.debug(getClass(), ">>> Fin d'exécution du job data-process (mode liste de traitements)");
  }