Skip to content

Commit

Permalink
fixed deploy mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciaM1 committed Nov 24, 2023
1 parent 24a7afb commit 43d0379
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,11 @@ public Uni<WorkflowResource> setDeployInfo(UUID uuid, DeployResponseDto response
DeployedBPMNProcessDefinitionDto deployedProcessInfo = optionalDeployedProcessDefinition.get();
workflowResource.setDefinitionVersionCamunda(deployedProcessInfo.getVersion());
workflowResource.setDeploymentId(deployedProcessInfo.getDeploymentId());
workflowResource.setCamundaDefinitionId(deployedProcessInfo.getId());
workflowResource.setDeployedFileName(deployedProcessInfo.getName());
workflowResource.setDescription(deployedProcessInfo.getDescription());
workflowResource.setResource(deployedProcessInfo.getResource());
workflowResource.setStatus(StatusEnum.DEPLOYED);
}
if (response.getDeployedDecisionDefinitions() != null) {
} else if (response.getDeployedDecisionDefinitions() != null) {
Map<String, DeployedDMNDecisionDefinitionDto> deployedDecisionDefinitions = response.getDeployedDecisionDefinitions();
Optional<DeployedDMNDecisionDefinitionDto> optionalDeployedDecisionDefinition = deployedDecisionDefinitions.values()
.stream().findFirst();
Expand All @@ -222,15 +220,14 @@ public Uni<WorkflowResource> setDeployInfo(UUID uuid, DeployResponseDto response
DeployedDMNDecisionDefinitionDto deployedDecisionDefinition = optionalDeployedDecisionDefinition.get();
workflowResource.setDefinitionVersionCamunda(deployedDecisionDefinition.getVersion());
workflowResource.setDeploymentId(deployedDecisionDefinition.getDeploymentId());
workflowResource.setCamundaDefinitionId(deployedDecisionDefinition.getId());
workflowResource.setDeployedFileName(deployedDecisionDefinition.getName());
workflowResource.setResource(deployedDecisionDefinition.getResource());
workflowResource.setStatus(StatusEnum.DEPLOYED);
} else {
workflowResource.setCamundaDefinitionId(response.getId());
workflowResource.setDeployedFileName(response.getName());
workflowResource.setStatus(StatusEnum.DEPLOYED);
}
workflowResource.setCamundaDefinitionId(response.getId());
return this.workflowResourceRepository.persist(workflowResource);
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,8 @@ void setDeployInfoEmptyProcessDefinitions() {
void setDeployInfoEmptyDecisionDefinitions() {
UUID expectedId = UUID.randomUUID();
WorkflowResource expectedWorkflowResource = new WorkflowResource();
Map<String, DeployedBPMNProcessDefinitionDto> deployedProcessDefinitions = new HashMap<>();
deployedProcessDefinitions.put("key", new DeployedBPMNProcessDefinitionDto());
Map<String, DeployedDMNDecisionDefinitionDto> deployedDecisionDefinitions = new HashMap<>();
DeployResponseDto deployResponseDto = new DeployResponseDto();
deployResponseDto.setDeployedProcessDefinitions(deployedProcessDefinitions);
deployResponseDto.setDeployedDecisionDefinitions(deployedDecisionDefinitions);
when(workflowResourceRepository.findById(any(UUID.class))).thenReturn(Uni.createFrom().item(expectedWorkflowResource));
workflowResourceService.setDeployInfo(expectedId, deployResponseDto)
Expand Down

0 comments on commit 43d0379

Please sign in to comment.