use of eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor in project CzechIdMng by bcvsolutions.
the class DefaultIdmIdentityContractServiceIntegrationTest method saveAutomaticRole.
/**
* Save automatic role with repository and manual create and wait for task
* @param automaticRole
* @return
*/
private IdmRoleTreeNodeDto saveAutomaticRole(IdmRoleTreeNodeDto automaticRole, boolean withLongRunningTask) {
// default name
automaticRole.setName("default");
IdmRoleTreeNodeDto roleTreeNode = roleTreeNodeService.saveInternal(automaticRole);
//
if (withLongRunningTask) {
AddNewAutomaticRoleTaskExecutor task = new AddNewAutomaticRoleTaskExecutor();
task.setAutomaticRoleId(roleTreeNode.getId());
taskManager.executeSync(task);
}
//
return roleTreeNodeService.get(roleTreeNode.getId());
}
use of eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor in project CzechIdMng by bcvsolutions.
the class RoleTreeNodeSaveProcessor method process.
@Override
public EventResult<IdmRoleTreeNodeDto> process(EntityEvent<IdmRoleTreeNodeDto> event) {
IdmRoleTreeNodeDto dto = event.getContent();
//
dto = service.saveInternal(dto);
event.setContent(dto);
//
// assign role by this added automatic role to all existing identity contracts with long running task
AddNewAutomaticRoleTaskExecutor automaticRoleTask = AutowireHelper.createBean(AddNewAutomaticRoleTaskExecutor.class);
automaticRoleTask.setAutomaticRoleId(dto.getId());
longRunningTaskManager.execute(automaticRoleTask);
return new DefaultEventResult<>(event, this);
}
Aggregations