use of eu.bcvsolutions.idm.core.scheduler.jaxb.IdmScheduledTaskTriggerType in project CzechIdMng by bcvsolutions.
the class AbstractScheduledTaskInitializer method createAndSaveTriggers.
/**
* Create and save trigger from {@link IdmScheduledTaskType}.
*
* @param task
* @param type
*/
private void createAndSaveTriggers(Task task, IdmScheduledTaskType type) {
Assert.notNull(task);
Assert.notNull(task.getId());
// triggers
if (type.getTriggers() != null && type.getTriggers().getTriggers() != null) {
for (IdmScheduledTaskTriggerType trigger : type.getTriggers().getTriggers()) {
AbstractTaskTrigger newTrigger = null;
try {
newTrigger = getTrigger(trigger);
} catch (ClassNotFoundException e) {
LOG.error("Trigger type: [{}], not exist. Skip init this trigger for task id: [{}]. Error message: [{}]", trigger.getType(), task.getId(), e.getMessage());
continue;
}
if (newTrigger != null) {
LOG.info("Create new trigger for task id: [{}]. Trigger type: [{}].", task.getId(), trigger.getType());
schedulerService.createTrigger(task.getId(), newTrigger);
}
}
}
}
Aggregations