Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


  
   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


 
  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

        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

 
  public RestVariable getVariableFromRequest(boolean includeBinary, String varInstanceId, HttpServletRequest request) {
    HistoricVariableInstance varObject = historyService.createHistoricVariableInstanceQuery().id(varInstanceId).singleResult();
   
    if (varObject == null) {
      throw new ActivitiObjectNotFoundException("Historic variable instance '" + varInstanceId + "' couldn't be found.", VariableInstanceEntity.class);
    } else {
      String serverRootUrl = request.getRequestURL().toString();
      return restResponseFactory.createRestVariable(varObject.getVariableName(), varObject.getValue(), null, varInstanceId,
          RestResponseFactory.VARIABLE_HISTORY_VARINSTANCE, includeBinary, serverRootUrl.substring(0, serverRootUrl.indexOf("/history/historic-variable-instances/")));
    }
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

   
    HistoricProcessInstance processObject = historyService.createHistoricProcessInstanceQuery()
        .processInstanceId(processInstanceId).includeProcessVariables().singleResult();
   
    if (processObject == null) {
      throw new ActivitiObjectNotFoundException("Historic process instance '" + processInstanceId + "' couldn't be found.", HistoricProcessInstanceEntity.class);
    }
   
    Object value = processObject.getProcessVariables().get(variableName);
   
    if (value == null) {
        throw new ActivitiObjectNotFoundException("Historic process instance '" + processInstanceId + "' variable value for " + variableName + " couldn't be found.", VariableInstanceEntity.class);
    } else {
      String serverRootUrl = request.getRequestURL().toString();
      return restResponseFactory.createRestVariable(variableName, value, null, processInstanceId,
          RestResponseFactory.VARIABLE_HISTORY_PROCESS, includeBinary, serverRootUrl.substring(0, serverRootUrl.indexOf("/history/historic-process-instances/")));
    }
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

    }
   
    HistoricTaskInstance taskObject = taskQuery.singleResult();
   
    if (taskObject == null) {
      throw new ActivitiObjectNotFoundException("Historic task instance '" + taskId + "' couldn't be found.", HistoricTaskInstanceEntity.class);
    }
   
    Object value = null;
    if (variableScope != null) {
      if (variableScope == RestVariableScope.GLOBAL) {
        value = taskObject.getProcessVariables().get(variableName);
      } else {
        value = taskObject.getTaskLocalVariables().get(variableName);
      }
    } else {
      // look for local task variables first
      if (taskObject.getTaskLocalVariables().containsKey(variableName)) {
        value = taskObject.getTaskLocalVariables().get(variableName);
      } else {
        value = taskObject.getProcessVariables().get(variableName);
      }
    }
   
    if (value == null) {
      throw new ActivitiObjectNotFoundException("Historic task instance '" + taskId + "' variable value for " + variableName + " couldn't be found.", VariableInstanceEntity.class);
    } else {
      String serverRootUrl = request.getRequestURL().toString();
      return restResponseFactory.createRestVariable(variableName, value, null, taskId,
          RestResponseFactory.VARIABLE_HISTORY_TASK, includeBinary, serverRootUrl.substring(0, serverRootUrl.indexOf("/history/historic-task-instances/")));
    }
View Full Code Here

        variableFound = true;
      }
    }
   
    if (!variableFound) {
        throw new ActivitiObjectNotFoundException("Task '" + taskId + "' doesn't have a variable with name: '" + variableName + "'.", VariableInstanceEntity.class);
    } else {
      return restResponseFactory.createRestVariable(variableName, value, variableScope,
          taskId, RestResponseFactory.VARIABLE_TASK, includeBinary, serverRootUrl);
    }
  }
View Full Code Here

    if (isNew && hasVariable) {
      throw new ActivitiException("Variable '" + name + "' is already present on task '" + task.getId() + "'.");
    }
   
    if (!isNew && !hasVariable) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() + "' doesn't have a variable with name: '"+ name + "'.", null);
    }
   
    if (scope == RestVariableScope.LOCAL) {
      taskService.setVariableLocal(task.getId(), name, value);
    } else {
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.