use of io.zeebe.monitor.rest.dto.CalledProcessInstanceDto in project zeebe-simple-monitor by camunda-community-hub.
the class InstancesCalledProcessesListViewController method fillViewDetailsIntoDto.
@Override
protected void fillViewDetailsIntoDto(ProcessInstanceEntity instance, List<ElementInstanceEntity> events, List<IncidentEntity> incidents, Map<Long, String> elementIdsForKeys, Map<String, Object> model, Pageable pageable, ProcessInstanceDto dto) {
final var calledProcessInstances = processInstanceRepository.findByParentProcessInstanceKey(instance.getKey(), pageable).stream().map(childEntity -> {
final var childDto = new CalledProcessInstanceDto();
childDto.setChildProcessInstanceKey(childEntity.getKey());
childDto.setChildBpmnProcessId(childEntity.getBpmnProcessId());
childDto.setChildState(childEntity.getState());
childDto.setElementInstanceKey(childEntity.getParentElementInstanceKey());
final var callElementId = elementIdsForKeys.getOrDefault(childEntity.getParentElementInstanceKey(), "");
childDto.setElementId(callElementId);
return childDto;
}).collect(Collectors.toList());
dto.setCalledProcessInstances(calledProcessInstances);
final long count = processInstanceRepository.countByParentProcessInstanceKey(instance.getKey());
addPaginationToModel(model, pageable, count);
}
Aggregations