Skip to content

Commit

Permalink
fixed deploy (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciaM1 authored Nov 27, 2023
1 parent e768d70 commit 1f7bb0b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
public class BpmnBankConfigService {
@Inject
protected BpmnBankConfigRepository bankConfigRepository;

@Inject
BpmnConfigMapper bpmnConfigMapper;

Expand All @@ -45,7 +44,6 @@ public Uni<Optional<BpmnBankConfig>> findByConfigurationsAndFunction(String acqu
if (x.size() > 1) {
throw new AtmLayerException("Multiple BPMN found for a single configuration.", Response.Status.INTERNAL_SERVER_ERROR, AppErrorCodeEnum.ATMLM_500);
}

return Uni.createFrom().item(x.isEmpty() ? Optional.empty() : Optional.ofNullable(x.get(0)));
}));
}
Expand Down
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 1f7bb0b

Please sign in to comment.