on ‎2019 Jul 16 8:49 AM
Hi All,
IN oob when last result is success or error but current status is finished then mail is triggering but I want to implement when current status is aborted and last result is in error then I want email in this situation any idea?
I tried like this but getting error null pointer exception and not going in aborted condition after applying refresh also.
if (Config.getParameter("parasearch.tree.cronjob.template").equalsIgnoreCase("test"))
{
modelService.refresh(cronJobModel);
}
// Set last sync date to current date
if (cronJobStatus)
{
cronJobModel.setLastSyncDate(currentSyncDate);
modelService.save(cronJobModel);
}
LOG.log(cronJobStatus ? Level.INFO : Level.ERROR,
"Completed execution of Job with " + (cronJobStatus ? "success." : " errors."));
if (cronJobModel.getStatus().equals("FINISHED"))
{
return new PerformResult(cronJobStatus ? CronJobResult.SUCCESS : CronJobResult.ERROR, CronJobStatus.FINISHED);
}
else if (cronJobModel.getStatus().equals("ABORTED"))
{
return new PerformResult(CronJobResult.ERROR, CronJobStatus.FINISHED);
}
return null;
}
Request clarification before answering.
In Job.class in OOB I got this code where cronjob.finish then it will trigger mail I tried to add condition for aborted but this class methods are final so not able to extend and tried with another way but not working so please help me on this if get any idea?
if (cronJob.isFinished() && cronJob.getResult().equals(cronJob.getSuccessResult()) &&
cronJob.isRemoveOnExitAsPrimitive()) {
try {
if (LOGGER.isInfoEnabled())
{
LOGGER.info("Removing cronjob: " + cronJob.getCode());
}
cronJob.remove();
}
catch (ConsistencyCheckException e) {
LOGGER.error(e.getMessage(), e);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.