Search in sources :

Example 1 with DeploymentResponse

use of org.wso2.carbon.bpmn.rest.model.repository.DeploymentResponse in project carbon-business-process by wso2.

the class DeploymentService method getDeployment.

@GET
@Path("/{deploymentId}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getDeployment(@PathParam("deploymentId") String deploymentId) {
    RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    if (deployment == null) {
        throw new ActivitiObjectNotFoundException("Could not find a deployment with deploymentId '" + deploymentId + "'.", Deployment.class);
    }
    DeploymentResponse deploymentResponse = new RestResponseFactory().createDeploymentResponse(deployment, uriInfo.getBaseUri().toString());
    return Response.ok().entity(deploymentResponse).build();
}
Also used : RestResponseFactory(org.wso2.carbon.bpmn.rest.common.RestResponseFactory) Deployment(org.activiti.engine.repository.Deployment) DeploymentResponse(org.wso2.carbon.bpmn.rest.model.repository.DeploymentResponse) ActivitiObjectNotFoundException(org.activiti.engine.ActivitiObjectNotFoundException) RepositoryService(org.activiti.engine.RepositoryService) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 ActivitiObjectNotFoundException (org.activiti.engine.ActivitiObjectNotFoundException)1 RepositoryService (org.activiti.engine.RepositoryService)1 Deployment (org.activiti.engine.repository.Deployment)1 RestResponseFactory (org.wso2.carbon.bpmn.rest.common.RestResponseFactory)1 DeploymentResponse (org.wso2.carbon.bpmn.rest.model.repository.DeploymentResponse)1