Search in sources :

Example 1 with WorkflowTaskDefinitionDto

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

the class DefaultWorkflowTaskDefinitionService method searchTaskDefinitions.

@Override
public List<WorkflowTaskDefinitionDto> searchTaskDefinitions(String processDefinitionId) {
    List<WorkflowTaskDefinitionDto> taskDefinitions = new ArrayList<>();
    BpmnModel model = repositoryService.getBpmnModel(processDefinitionId);
    for (FlowElement element : model.getMainProcess().getFlowElements()) {
        if (element instanceof UserTask) {
            taskDefinitions.add(toResorce((UserTask) element));
        }
    }
    return taskDefinitions;
}
Also used : FlowElement(org.activiti.bpmn.model.FlowElement) ArrayList(java.util.ArrayList) UserTask(org.activiti.bpmn.model.UserTask) WorkflowTaskDefinitionDto(eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowTaskDefinitionDto) BpmnModel(org.activiti.bpmn.model.BpmnModel)

Example 2 with WorkflowTaskDefinitionDto

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

the class DefaultWorkflowTaskDefinitionService method toResorce.

private WorkflowTaskDefinitionDto toResorce(UserTask task) {
    WorkflowTaskDefinitionDto taskDefinitionDto = new WorkflowTaskDefinitionDto();
    taskDefinitionDto.setId(task.getId());
    taskDefinitionDto.setName(task.getName());
    taskDefinitionDto.setAssignee(task.getAssignee());
    taskDefinitionDto.setCandicateGroups(task.getCandidateGroups());
    taskDefinitionDto.setCandicateUsers(task.getCandidateUsers());
    return taskDefinitionDto;
}
Also used : WorkflowTaskDefinitionDto(eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowTaskDefinitionDto)

Aggregations

WorkflowTaskDefinitionDto (eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowTaskDefinitionDto)2 ArrayList (java.util.ArrayList)1 BpmnModel (org.activiti.bpmn.model.BpmnModel)1 FlowElement (org.activiti.bpmn.model.FlowElement)1 UserTask (org.activiti.bpmn.model.UserTask)1