Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciaM1 committed Nov 24, 2023
1 parent 6b91981 commit ff98603
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ public Uni<WorkflowResource> rollback(UUID id) {
.onItem()
.transformToUni(Unchecked.function(workflow -> {
if (workflow.isEmpty()) {
throw new AtmLayerException("The referenced workflow resource does not exist",Response.Status.NOT_FOUND, WORKFLOW_FILE_DOES_NOT_EXIST);
throw new AtmLayerException("The referenced workflow resource does not exist", Response.Status.NOT_FOUND, WORKFLOW_FILE_DOES_NOT_EXIST);
}
WorkflowResource workflowResourceToRollBack = workflow.get();
if (workflowResourceToRollBack.getStatus().getValue().equals(StatusEnum.DEPLOYED.getValue())){
throw new AtmLayerException("Cannot rollback: the referenced resource is the latest version deployed", Response.Status.BAD_REQUEST,WORKFLOW_RESOURCE_CANNOT_BE_ROLLED_BACK);
if (workflowResourceToRollBack.getStatus().getValue().equals(StatusEnum.DEPLOYED.getValue())) {
throw new AtmLayerException("Cannot rollback: the referenced resource is the latest version deployed", Response.Status.BAD_REQUEST, WORKFLOW_RESOURCE_CANNOT_BE_ROLLED_BACK);
}
String camundaId = workflowResourceToRollBack.getCamundaDefinitionId();
if (camundaId == null) {
Expand All @@ -353,7 +353,7 @@ public Uni<WorkflowResource> rollback(UUID id) {
return processClient.getDeployedResource(camundaId)
.onFailure()
.recoverWithUni(exception ->
Uni.createFrom().failure(new AtmLayerException("Error retrieving workflow resource from Process", Response.Status.INTERNAL_SERVER_ERROR, DEPLOYED_FILE_WAS_NOT_RETRIEVED)))
Uni.createFrom().failure(new AtmLayerException("Error retrieving workflow resource from Process", Response.Status.INTERNAL_SERVER_ERROR, DEPLOYED_FILE_WAS_NOT_RETRIEVED)))
.onItem()
.transformToUni(Unchecked.function(file -> update(id, file, true)));
}));
Expand Down

0 comments on commit ff98603

Please sign in to comment.