Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


  private void verifyParameters(CommandContext commandContext) {
    if (taskId != null) {
      TaskEntity task = commandContext.getTaskEntityManager().findTaskById(taskId);

      if (task == null) {
        throw new ActivitiObjectNotFoundException("Cannot find task with id " + taskId, Task.class);
      }

      if (task.isSuspended()) {
        throw new ActivitiException("It is not allowed to add an attachment to a suspended task");
      }
    }
   
    if (processInstanceId != null) {
      ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);

      if (execution == null) {
        throw new ActivitiObjectNotFoundException("Process instance " + processInstanceId + " doesn't exist", ProcessInstance.class);
      }

      if (execution.isSuspended()) {
        throw new ActivitiException("It is not allowed to add an attachment to a suspended process instance");
      }
View Full Code Here


      log.debug("Deleting job {}", jobId);
    }

    JobEntity job = commandContext.getJobEntityManager().findJobById(jobId);
    if (job == null) {
      throw new ActivitiObjectNotFoundException("No job found with id '" + jobId + "'", Job.class);
    }

    // We need to check if the job was locked, ie acquired by the job acquisition thread
    // This happens if the the job was already acquired, but not yet executed.
    // In that case, we can't allow to delete the job.
View Full Code Here

   
    if(processDefinitionId != null) {
     
      ProcessDefinitionEntity processDefinitionEntity = processDefinitionManager.findProcessDefinitionById(processDefinitionId);
      if(processDefinitionEntity == null) {
        throw new ActivitiObjectNotFoundException("Cannot find process definition for id '"+processDefinitionId+"'", ProcessDefinition.class);
      }
      processDefinitionEntities.add(processDefinitionEntity);
     
    } else {
     
View Full Code Here

    ProcessDefinitionEntity processDefinition = commandContext
            .getProcessDefinitionEntityManager()
            .findProcessDefinitionById(processDefinitionId);

    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("No process definition found for id = '" + processDefinitionId + "'", ProcessDefinition.class);
    }
   
    // Update category
    processDefinition.setCategory(category);
   
View Full Code Here

            .getProcessEngineConfiguration()
            .getDeploymentManager()
            .findDeployedProcessDefinitionById(processDefinitionId);

    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("No process definition found for id = '" + processDefinitionId + "'", ProcessDefinition.class);
    }
   
    if (processDefinition.isSuspended()) {
      throw new ActivitiException("Cannot execute operation because process definition '"
              + processDefinition.getName() + "' (id=" + processDefinition.getId() + ") is supended");
View Full Code Here

    TaskEntity task = commandContext
      .getTaskEntityManager()
      .findTaskById(taskId);
   
    if (task==null) {
      throw new ActivitiObjectNotFoundException("task "+taskId+" doesn't exist", Task.class);
    }
   
    Object value;
   
    if (isLocal) {
View Full Code Here

    ProcessDefinitionEntity processDefinition = commandContext
        .getProcessDefinitionEntityManager()
        .findProcessDefinitionById(processDefinitionId);
     
    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("Cannot find process definition with id " + processDefinitionId, ProcessDefinition.class);
    }
   
    processDefinition.deleteIdentityLink(userId, groupId);
   
    return null
View Full Code Here

    HistoricProcessInstance instance = commandContext
      .getHistoricProcessInstanceEntityManager()
      .findHistoricProcessInstance(processInstanceId);
   
    if(instance == null) {
      throw new ActivitiObjectNotFoundException("No historic process instance found with id: " + processInstanceId, HistoricProcessInstance.class);
    }
    if(instance.getEndTime() == null) {
      throw new ActivitiException("Process instance is still running, cannot delete historic process instance: " + processInstanceId);
    }
   
View Full Code Here

      if(commandContext.getEventDispatcher().isEnabled()) {
        commandContext.getEventDispatcher().dispatchEvent(
            ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_UPDATED, job));
      }
    } else {
      throw new ActivitiObjectNotFoundException("No job found with id '" + jobId + "'.", Job.class);
    }
    return null;
  }
View Full Code Here

    }
    User user = commandContext
      .getUserIdentityManager()
      .findUserById(userId);
    if(user == null) {
      throw new ActivitiObjectNotFoundException("user "+userId+" doesn't exist", User.class);
    }
    commandContext.getUserIdentityManager().setUserPicture(userId, picture);
    return 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.