use of eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrEnableContractProcess in project CzechIdMng by bcvsolutions.
the class ContractSliceSynchronizationExecutor method syncCorrectlyEnded.
@Override
protected SysSyncLogDto syncCorrectlyEnded(SysSyncLogDto log, SynchronizationContext context) {
log = super.syncCorrectlyEnded(log, context);
log = synchronizationLogService.save(log);
SysSyncContractConfigDto config = getConfig(context);
if (config.isStartOfHrProcesses()) {
// Together with HR process is also executed cleared dirty contract slice
log = executeClearDirtyStateForContractSlice(log);
// start all HR process with skip automatic role recalculation
// Enable contracts task
log = executeHrProcess(log, new HrEnableContractProcess(true));
// End contracts task
log = executeHrProcess(log, new HrEndContractProcess(true));
// Exclude contracts task
log = executeHrProcess(log, new HrContractExclusionProcess(true));
} else {
log.addToLog(MessageFormat.format("Start HR processes contracts (after sync) isn't allowed [{0}]", ZonedDateTime.now()));
}
if (config.isStartAutoRoleRec()) {
log = executeAutomaticRoleRecalculation(log);
} else {
log.addToLog(MessageFormat.format("Start automatic role recalculation (after sync) isn't allowed [{0}]", ZonedDateTime.now()));
}
return log;
}
Aggregations