Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


    Deployment deployment = repositoryService.createDeploymentQuery()
            .deploymentId(deploymentId)
            .singleResult();
   
    if (deployment == null) {
      throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
    }
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/repository/deployments/"));
    return restResponseFactory.createDeploymentResponse(deployment, serverRootUrl);
View Full Code Here


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

  protected ProcessDefinition getProcessDefinitionFromRequest(String processDefinitionId) {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
            .processDefinitionId(processDefinitionId).singleResult();
  
    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("Could not find a process definition with id '" + processDefinitionId + "'.", ProcessDefinition.class);
    }
    return processDefinition;
  }
View Full Code Here

 
  protected ProcessInstance getProcessInstanceFromRequest(String processInstanceId) {
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
           .processInstanceId(processInstanceId).singleResult();
    if (processInstance == null) {
      throw new ActivitiObjectNotFoundException("Could not find a process instance with id '" + processInstanceId + "'.");
    }
    return processInstance;
  }
View Full Code Here

   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    Event event = taskService.getEvent(eventId);
    if (event == null || !task.getId().equals(event.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an event with id '" + eventId + "'.", Event.class);
    }
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
View Full Code Here

    // Check if task exists
    Task task = getTaskFromRequest(taskId);
   
    Event event = taskService.getEvent(eventId);
    if (event == null || event.getTaskId() == null || !event.getTaskId().equals(task.getId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an event with id '" + event + "'.", Event.class);
    }
   
    taskService.deleteComment(eventId);
    response.setStatus(HttpStatus.NO_CONTENT.value());
  }
View Full Code Here

    if (scope != null) {
      variableScope = RestVariable.getScopeFromString(scope);
    }

    if (!hasVariableOnScope(execution, variableName, variableScope)) {
      throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() + "' doesn't have a variable '" +
          variableName + "' in scope " + variableScope.name().toLowerCase(), VariableInstanceEntity.class);
    }
   
    if (variableScope == RestVariableScope.LOCAL) {
      runtimeService.removeVariableLocal(execution.getId(), variableName);
View Full Code Here

   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    Attachment attachment = taskService.getAttachment(attachmentId);
    if (attachment == null || !task.getId().equals(attachment.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an attachment with id '" + attachmentId + "'.", Comment.class);
    }
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
View Full Code Here

   
    Task task = getTaskFromRequest(taskId);
   
    Attachment attachment = taskService.getAttachment(attachmentId);
    if (attachment == null || !task.getId().equals(attachment.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an attachment with id '" + attachmentId + "'.", Comment.class);
    }
   
    taskService.deleteAttachment(attachmentId);
    response.setStatus(HttpStatus.NO_CONTENT.value());
  }
View Full Code Here

   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
    Attachment attachment = taskService.getAttachment(attachmentId);
   
    if (attachment == null || !task.getId().equals(attachment.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an attachment with id '" + attachmentId + "'.", Attachment.class);
    }
   
    InputStream attachmentStream = taskService.getAttachmentContent(attachmentId);
    if (attachmentStream == null) {
      throw new ActivitiObjectNotFoundException("Attachment with id '" + attachmentId +
          "' doesn't have content associated with it.", Attachment.class);
    }
   
    MediaType mediaType = null;
    if (attachment.getType() != null) {
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.