Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


        outputStream.close();
        result = buffer.toByteArray();
        response.setContentType("application/x-java-serialized-object");
       
      } else {
        throw new ActivitiObjectNotFoundException("The variable does not have a binary data stream.", null);
      }
      return result;
     
    } catch(IOException ioe) {
      // Re-throw IOException
View Full Code Here


     
      if (rightIdentity && link.getType().equals(type)) {
        return link;
      }
    }
    throw new ActivitiObjectNotFoundException("Could not find the requested identity link.", IdentityLink.class);
  }
View Full Code Here

   
    ProcessInstance processInstance = null;
    if (processInstanceId != null) {
      processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
      if (processInstance == null) {
        throw new ActivitiObjectNotFoundException("Process instance could not be found");
      }
      processDefinitionId = processInstance.getProcessDefinitionId();

      List<ProcessInstance> subProcessInstances = runtimeService
          .createProcessInstanceQuery()
          .superProcessInstanceId(processInstanceId).list();
     
      for (ProcessInstance subProcessInstance : subProcessInstances) {
        String subDefId = subProcessInstance.getProcessDefinitionId();

        String superExecutionId = ((ExecutionEntity) subProcessInstance)
            .getSuperExecutionId();
        ProcessDefinitionEntity subDef = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(subDefId);

        ObjectNode processInstanceJSON = new ObjectMapper().createObjectNode();
        processInstanceJSON.put("processInstanceId", subProcessInstance.getId());
        processInstanceJSON.put("superExecutionId", superExecutionId);
        processInstanceJSON.put("processDefinitionId", subDef.getId());
        processInstanceJSON.put("processDefinitionKey", subDef.getKey());
        processInstanceJSON.put("processDefinitionName", subDef.getName());

        subProcessInstanceMap.put(superExecutionId, processInstanceJSON);
      }
    }

    if (processDefinitionId == null) {
      throw new ActivitiObjectNotFoundException("No process definition id provided");
    }

    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processDefinitionId);

    if (processDefinition == null) {
View Full Code Here

      HttpServletRequest request) {
   
    // Check if deployment exists
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    if (deployment == null) {
      throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.");
    }
   
    String pathInfo = request.getPathInfo();
    String resourceName = pathInfo.replace("/repository/deployments/" + deploymentId + "/resources/", "");
   
    List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/repository/deployments/"));

    if (resourceList.contains(resourceName)) {
      // Build resource representation
      DeploymentResourceResponse response = restResponseFactory.createDeploymentResourceResponse(deploymentId, resourceName,
          contentTypeResolver.resolveContentType(resourceName), serverRootUrl);
      return response;
     
    } else {
      // Resource not found in deployment
      throw new ActivitiObjectNotFoundException("Could not find a resource with id '" + resourceName
              + "' in deployment '" + deploymentId + "'.");
    }
  }
View Full Code Here

   */
  protected Model getModelFromRequest(String modelId) {
    Model model = repositoryService.createModelQuery().modelId(modelId).singleResult();
  
    if (model == null) {
      throw new ActivitiObjectNotFoundException("Could not find a model with id '" + modelId + "'.", ProcessDefinition.class);
    }
    return model;
  }
View Full Code Here

  @RequestMapping(value="/repository/deployments/{deploymentId}/resources", method = RequestMethod.GET, produces = "application/json")
  public List<DeploymentResourceResponse> getDeploymentResources(@PathVariable String deploymentId, HttpServletRequest request) {
    // Check if deployment exists
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    if (deployment == null) {
      throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
    }
   
    List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);
   
    String serverRootUrl = request.getRequestURL().toString();
View Full Code Here

 
  protected HistoricTaskInstance getHistoricTaskInstanceFromRequest(String taskId) {
    HistoricTaskInstance taskInstance = historyService.createHistoricTaskInstanceQuery()
           .taskId(taskId).singleResult();
    if (taskInstance == null) {
      throw new ActivitiObjectNotFoundException("Could not find a task instance with id '" + taskId + "'.", HistoricTaskInstance.class);
    }
    return taskInstance;
  }
View Full Code Here

    
    HistoricProcessInstance instance = getHistoricProcessInstanceFromRequest(processInstanceId);
    
    Comment comment = taskService.getComment(commentId);
    if (comment == null || comment.getProcessInstanceId() == null || !comment.getProcessInstanceId().equals(instance.getId())) {
      throw new ActivitiObjectNotFoundException("Process instance '" + instance.getId() + "' doesn't have a comment with id '" + commentId + "'.", Comment.class);
    }
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/history/historic-process-instances/"));
    return restResponseFactory.createRestComment(comment, serverRootUrl);
View Full Code Here

   
    HistoricProcessInstance instance = getHistoricProcessInstanceFromRequest(processInstanceId);
   
    Comment comment = taskService.getComment(commentId);
    if (comment == null || comment.getProcessInstanceId() == null || !comment.getProcessInstanceId().equals(instance.getId())) {
      throw new ActivitiObjectNotFoundException("Process instance '" + instance.getId() + "' doesn't have a comment with id '" + commentId + "'.", Comment.class);
    }
   
    taskService.deleteComment(commentId);
    response.setStatus(HttpStatus.NO_CONTENT.value());
  }
View Full Code Here

 
protected HistoricProcessInstance getHistoricProcessInstanceFromRequest(String processInstanceId) {
    HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery()
           .processInstanceId(processInstanceId).singleResult();
    if (processInstance == null) {
      throw new ActivitiObjectNotFoundException("Could not find a process instance with id '" + processInstanceId + "'.", HistoricProcessInstance.class);
    }
    return processInstance;
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.ActivitiObjectNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.