Skip to content

Commit

Permalink
WorkflowResource Delete
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanueleValentini1 committed Nov 8, 2023
1 parent 3a135ab commit 83719da
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
import io.smallrye.common.annotation.NonBlocking;
import io.smallrye.mutiny.Uni;
import it.gov.pagopa.atmlayer.service.model.dto.WorkflowResourceCreationDto;
import it.gov.pagopa.atmlayer.service.model.entity.BpmnVersionPK;
import it.gov.pagopa.atmlayer.service.model.entity.WorkflowResource;
import it.gov.pagopa.atmlayer.service.model.mapper.WorkflowResourceMapper;
import it.gov.pagopa.atmlayer.service.model.model.BpmnDTO;
import it.gov.pagopa.atmlayer.service.model.model.WorkflowResourceDTO;
import it.gov.pagopa.atmlayer.service.model.service.WorkflowResourceService;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.validation.Valid;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
Expand Down Expand Up @@ -56,4 +55,14 @@ public Uni<WorkflowResourceDTO> deployBPMN(@PathParam("uuid") UUID uuid) {
return this.workflowResourceService.deploy(uuid)
.onItem().transformToUni(workflow -> Uni.createFrom().item(this.workflowResourceMapper.toDTO(workflow)));
}

@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{uuid}")
public Uni<Void> deleteBpmn(@PathParam("uuid") UUID uuid) {

return this.workflowResourceService.delete(uuid)
.onItem().ignore().andSwitchTo(Uni.createFrom().voidItem());
}
}

0 comments on commit 83719da

Please sign in to comment.