Search in sources :

Example 1 with ProcessAutomaticRoleByAttributeTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByAttributeTaskExecutor in project CzechIdMng by bcvsolutions.

the class DefaultIdmAutomaticRoleAttributeService method recalculate.

@Override
@Transactional
public IdmAutomaticRoleAttributeDto recalculate(UUID automaticRoleId) {
    Assert.notNull(automaticRoleId);
    // 
    // set concept to false before recalculation
    IdmAutomaticRoleAttributeDto automaticRolAttributeDto = this.get(automaticRoleId);
    automaticRolAttributeDto.setConcept(false);
    automaticRolAttributeDto = this.save(automaticRolAttributeDto);
    // 
    ProcessAutomaticRoleByAttributeTaskExecutor automaticRoleTask = AutowireHelper.createBean(ProcessAutomaticRoleByAttributeTaskExecutor.class);
    automaticRoleTask.setAutomaticRoleId(automaticRoleId);
    longRunningTaskManager.execute(automaticRoleTask);
    // 
    return automaticRolAttributeDto;
}
Also used : ProcessAutomaticRoleByAttributeTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByAttributeTaskExecutor) IdmAutomaticRoleAttributeDto(eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with ProcessAutomaticRoleByAttributeTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByAttributeTaskExecutor in project CzechIdMng by bcvsolutions.

the class DefaultIdmAutomaticRoleRequestServiceIntegrationTest method recalculateSync.

/**
 * Method correspond method
 * {@link IdmAutomaticRoleAttributeRuleService#recalculate()} but in
 * synchronized mode
 */
private Boolean recalculateSync(UUID automaticRoleId) {
    ProcessAutomaticRoleByAttributeTaskExecutor automaticRoleTask = AutowireHelper.createBean(ProcessAutomaticRoleByAttributeTaskExecutor.class);
    automaticRoleTask.setAutomaticRoleId(automaticRoleId);
    return longRunningTaskManager.executeSync(automaticRoleTask);
}
Also used : ProcessAutomaticRoleByAttributeTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByAttributeTaskExecutor)

Aggregations

ProcessAutomaticRoleByAttributeTaskExecutor (eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByAttributeTaskExecutor)2 IdmAutomaticRoleAttributeDto (eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto)1 Transactional (org.springframework.transaction.annotation.Transactional)1