Search in sources :

Example 1 with HrEnableContractProcess

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;
}
Also used : SysSyncContractConfigDto(eu.bcvsolutions.idm.acc.dto.SysSyncContractConfigDto) HrEnableContractProcess(eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrEnableContractProcess) HrContractExclusionProcess(eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrContractExclusionProcess) HrEndContractProcess(eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrEndContractProcess)

Aggregations

SysSyncContractConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncContractConfigDto)1 HrContractExclusionProcess (eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrContractExclusionProcess)1 HrEnableContractProcess (eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrEnableContractProcess)1 HrEndContractProcess (eu.bcvsolutions.idm.core.scheduler.task.impl.hr.HrEndContractProcess)1