Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


   * Get valid execution from request. Throws exception if execution doen't exist or if execution id is not provided.
   */
  protected Execution getExecutionFromRequest(String executionId) {
    Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
    if (execution == null) {
      throw new ActivitiObjectNotFoundException("Could not find an execution with id '" + executionId + "'.", Execution.class);
    }
    return execution;
  }
View Full Code Here


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

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

   * Get valid task from request. Throws exception if task doen't exist or if task id is not provided.
   */
  protected Task getTaskFromRequest(String taskId) {
    Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
    if (task == null) {
      throw new ActivitiObjectNotFoundException("Could not find a task with id '" + taskId + "'.", Task.class);
    }
    return task;
  }
View Full Code Here

   * Get valid history task from request. Throws exception if task doen't exist or if task id is not provided.
   */
  protected HistoricTaskInstance getHistoricTaskFromRequest(String taskId) {
    HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
    if (task == null) {
      throw new ActivitiObjectNotFoundException("Could not find a task with id '" + taskId + "'.", Task.class);
    }
    return task;
  }
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

        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

      variableUpdate = (HistoricVariableUpdate) detailObject;
      value = variableUpdate.getValue();
    }
   
    if (value == null) {
      throw new ActivitiObjectNotFoundException("Historic detail '" + detailId + "' doesn't have a variable value.", VariableInstanceEntity.class);
    } else {
      String serverRootUrl = request.getRequestURL().toString();
      return restResponseFactory.createRestVariable(variableUpdate.getVariableName(), value, null, detailId,
          RestResponseFactory.VARIABLE_HISTORY_DETAIL, includeBinary, serverRootUrl.substring(0, serverRootUrl.indexOf("/history/historic-detail/")));
    }
View Full Code Here

  @RequestMapping(value="/repository/models/{modelId}/source-extra", method = RequestMethod.GET)
  protected @ResponseBody byte[] getModelBytes(@PathVariable String modelId, HttpServletResponse response) {
    byte[] editorSource = repositoryService.getModelEditorSourceExtra(modelId);
    if (editorSource == null) {
      throw new ActivitiObjectNotFoundException("Model with id '" + modelId + "' does not have extra source available.", String.class);
    }
    response.setContentType("application/octet-stream");
    return editorSource;
  }
View Full Code Here

   */
  protected ProcessDefinition getProcessDefinitionFromRequest(String processDefinitionId) {
    ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processDefinitionId);
  
    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("Could not find a process definition with id '" + processDefinitionId + "'.", ProcessDefinition.class);
    }
    return processDefinition;
  }
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.