Package org.activiti.engine

Examples of org.activiti.engine.ActivitiObjectNotFoundException


        break;
      }
    }
  
    if (response == null) {
      throw new ActivitiObjectNotFoundException("Could not find a table with name '" + tableName + "'.", String.class);
    }
    return response;
  }
View Full Code Here


      .getIdentityService()
      .createUserQuery()
      .userId(propertyValue).count();
     
      if(count == 0) {
        throw new ActivitiObjectNotFoundException("User " + propertyValue + " does not exist", User.class);
      }
      return propertyValue;
    }
    return null;
  }
View Full Code Here

      .getIdentityService()
      .createUserQuery()
      .userId(propertyValue).count();
     
      if(count == 0) {
        throw new ActivitiObjectNotFoundException("User " + propertyValue + " does not exist", User.class);
      }
      return propertyValue;
    }
    return null;
  }
View Full Code Here

              .createProcessDefinitionQuery()
              .processDefinitionId(propertyValue)
              .singleResult();
     
      if(processDefinition == null) {
        throw new ActivitiObjectNotFoundException("Process definition with id " + propertyValue + " does not exist", ProcessDefinitionEntity.class);
      }
     
      return processDefinition;
    }
    return null;
View Full Code Here

              .createProcessDefinitionQuery()
              .processDefinitionId(propertyValue)
              .singleResult();
     
      if(processDefinition == null) {
        throw new ActivitiObjectNotFoundException("Process definition with id " + propertyValue + " does not exist", ProcessDefinitionEntity.class);
      }
     
      return processDefinition;
    }
    return null;
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) {
      throw new ActivitiException("Error getting variable " + variableName, ioe);
View Full Code Here

  }

  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

        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) {
      throw new ActivitiException("Error getting variable " + variableName, ioe);
View Full Code Here

    if (isNew && hasVariable) {
      throw new ActivitiException("Variable '" + name + "' is already present on execution '" + execution.getId() + "'.");
    }
   
    if (!isNew && !hasVariable) {
      throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() + "' doesn't have a variable with name: '"+ name + "'.", null);
    }
   
    if (scope == RestVariableScope.LOCAL) {
      runtimeService.setVariableLocal(execution.getId(), name, value);
    } else {
View Full Code Here

   
    boolean variableFound = false;
    Object value = null;
   
    if (execution == null) {
      throw new ActivitiObjectNotFoundException("Could not find an execution", Execution.class);
    }
   
    RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
    if (variableScope == null) {
      // First, check local variables (which have precedence when no scope is supplied)
      if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {
        value = runtimeService.getVariableLocal(execution.getId(), variableName);
        variableScope = RestVariableScope.LOCAL;
        variableFound = true;
      } else {
        if (execution.getParentId() != null) {
          value = runtimeService.getVariable(execution.getParentId(), variableName);
          variableScope = RestVariableScope.GLOBAL;
          variableFound = true;
        }
      }
    } else if (variableScope == RestVariableScope.GLOBAL) {
      // Use parent to get variables
      if (execution.getParentId() != null) {
        value = runtimeService.getVariable(execution.getParentId(), variableName);
        variableScope = RestVariableScope.GLOBAL;
        variableFound = true;
      }
    } else if (variableScope == RestVariableScope.LOCAL) {
     
      value = runtimeService.getVariableLocal(execution.getId(), variableName);
      variableScope = RestVariableScope.LOCAL;
      variableFound = true;
    }
   
    if (!variableFound) {
      throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() +
          "' doesn't have a variable with name: '" + variableName + "'.", VariableInstanceEntity.class);
    } else {
      return constructRestVariable(variableName, value, variableScope, execution.getId(), includeBinary, serverRootUrl);
    }
  }
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.