Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    Comment comment = taskService.getComment(commentId);
    if (comment == null || !task.getId().equals(comment.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have a comment with id '" + commentId + "'.", Comment.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);
   
    Comment comment = taskService.getComment(commentId);
    if (comment == null || comment.getTaskId() == null || !comment.getTaskId().equals(task.getId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have a comment with id '" + commentId + "'.", Comment.class);
    }
   
    taskService.deleteComment(commentId);
    response.setStatus(HttpStatus.NO_CONTENT.value());
  }
View Full Code Here

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

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

      .getCommandContext()
      .getResourceEntityManager()
      .findResourceByDeploymentIdAndResourceName(deploymentId, formKey);
   
    if (resourceStream == null) {
      throw new ActivitiObjectNotFoundException("Form with formKey '"+formKey+"' does not exist", String.class);
    }
   
    byte[] resourceBytes = resourceStream.getBytes();
    String encoding = "UTF-8";
    String formTemplateString = "";
View Full Code Here

    ExecutionEntity execution = commandContext
      .getExecutionEntityManager()
      .findExecutionById(executionId);
   
    if (execution==null) {
      throw new ActivitiObjectNotFoundException("execution "+executionId+" doesn't exist", Execution.class);
    }
   
    if (execution.isSuspended()) {
      throw new ActivitiException(getSuspendedExceptionMessage());
    }
View Full Code Here

  public Void execute(CommandContext commandContext) {

    ExecutionEntity processInstance = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);

    if (processInstance == null) {
      throw new ActivitiObjectNotFoundException("Cannot find process instance with id " + processInstanceId, ExecutionEntity.class);
    }

    processInstance.addIdentityLink(userId, groupId, type);

    commandContext.getHistoryManager().createProcessInstanceIdentityLinkComment(processInstanceId, userId, groupId, type, true);
View Full Code Here

    ExecutionEntity execution = commandContext
      .getExecutionEntityManager()
      .findExecutionById(processInstanceId);
   
    if (execution==null) {
      throw new ActivitiObjectNotFoundException("process instance " + processInstanceId + " doesn't exist", ProcessInstance.class);
    }
   
    if(!execution.isProcessInstanceType()) {
      throw new ActivitiObjectNotFoundException("process instance " + processInstanceId +
          " doesn't exist, the given ID references an execution, though", ProcessInstance.class);
    }
   
    if (execution.isSuspended()) {
      throw new ActivitiException("process instance " + processInstanceId + " is suspended, cannot set name");
View Full Code Here

   
    if(commentId != null) {
      // Delete for an individual comment
      Comment comment = commentManager.findComment(commentId);
      if(comment == null) {
        throw new ActivitiObjectNotFoundException("Comment with id '" + commentId + "' doesn't exists.", Comment.class);
      }
      commentManager.delete((CommentEntity) comment);
     
    } else {
      // Delete all comments on a task of process
View Full Code Here

    ExecutionEntity processInstance = commandContext
        .getExecutionEntityManager()
        .findExecutionById(processInstanceId);
     
    if (processInstance == null) {
      throw new ActivitiObjectNotFoundException("Cannot find process definition with id " + processInstanceId, ExecutionEntity.class);
    }
   
    return (List) processInstance.getIdentityLinks();
  }
View Full Code Here

  public Object execute(CommandContext commandContext) {
    TaskEntity task = commandContext
      .getTaskEntityManager()
      .findTaskById(taskId);
    if (task == null) {
      throw new ActivitiObjectNotFoundException("Task '" + taskId +"' not found", Task.class);
    }
   
    if (task.getTaskDefinition() == null) {
      throw new ActivitiException("Task form definition for '" + taskId +"' not found");
    }
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.