Search in sources :

Example 16 with WorkflowHistoricTaskInstanceDto

use of eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowHistoricTaskInstanceDto in project CzechIdMng by bcvsolutions.

the class DefaultWorkflowTaskInstanceService method get.

@Override
public WorkflowTaskInstanceDto get(Serializable id, WorkflowFilterDto context, BasePermission... permission) {
    if (context == null) {
        context = new WorkflowFilterDto();
    }
    context.setId(UUID.fromString(String.valueOf(id)));
    List<WorkflowTaskInstanceDto> tasks = internalSearch(context, null, permission).getContent();
    if (!tasks.isEmpty()) {
        return tasks.get(0);
    }
    // Current task doesn't exists, we try to find historic task.
    WorkflowHistoricTaskInstanceDto historicTask = historicTaskInstanceService.get(String.valueOf(id), context);
    if (historicTask != null) {
        return historicTask;
    }
    return null;
}
Also used : WorkflowFilterDto(eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowFilterDto) WorkflowTaskInstanceDto(eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowTaskInstanceDto) WorkflowHistoricTaskInstanceDto(eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowHistoricTaskInstanceDto)

Aggregations

WorkflowHistoricTaskInstanceDto (eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowHistoricTaskInstanceDto)16 WorkflowFilterDto (eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowFilterDto)10 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)7 WorkflowTaskInstanceDto (eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowTaskInstanceDto)7 AbstractCoreWorkflowIntegrationTest (eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest)4 IdmConceptRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto)4 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)4 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)4 IdmRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)2 IdentityLinkDto (eu.bcvsolutions.idm.core.workflow.model.dto.IdentityLinkDto)2 WorkflowProcessDefinitionDto (eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowProcessDefinitionDto)2 List (java.util.List)2 PageImpl (org.springframework.data.domain.PageImpl)2 PageRequest (org.springframework.data.domain.PageRequest)2 Pageable (org.springframework.data.domain.Pageable)2 Sort (org.springframework.data.domain.Sort)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1