Package org.activiti.engine

Examples of org.activiti.engine.ActivitiIllegalArgumentException


  }
 
  protected void validateIdentityLinkArguments(String family, String identityId, String type) {
    if (family == null || (!RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family)
            && !RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family))) {
      throw new ActivitiIllegalArgumentException("Identity link family should be 'users' or 'groups'.");
    }
    if (identityId == null) {
      throw new ActivitiIllegalArgumentException("IdentityId is required.");
    }
    if (type == null) {
      throw new ActivitiIllegalArgumentException("Type is required.");
    }
  }
View Full Code Here


  @RequestMapping(value="/repository/process-definitions/{processDefinitionId}", method = RequestMethod.PUT, produces = "application/json")
  public ProcessDefinitionResponse executeProcessDefinitionAction(@PathVariable String processDefinitionId,
      @RequestBody ProcessDefinitionActionRequest actionRequest, HttpServletRequest request) {
   
    if (actionRequest == null) {
      throw new ActivitiIllegalArgumentException("No action found in request body.");
    }
   
    ProcessDefinition processDefinition = getProcessDefinitionFromRequest(processDefinitionId);
    boolean isGraphicalNotationDefined = ((ProcessDefinitionEntity) processDefinition).isGraphicalNotationDefined();
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/repository/process-definitions/"));
   
    if (actionRequest.getCategory() != null) {
      // Update of category required
      repositoryService.setProcessDefinitionCategory(processDefinition.getId(), actionRequest.getCategory());
     
      // No need to re-fetch the ProcessDefinition entity, just update category in response
      ProcessDefinitionResponse response = restResponseFactory.createProcessDefinitionResponse(
          processDefinition, isGraphicalNotationDefined, serverRootUrl);
      response.setCategory(actionRequest.getCategory());
      return response;
     
    } else {
      // Actual action
      if (actionRequest.getAction() != null) {
        if (ProcessDefinitionActionRequest.ACTION_SUSPEND.equals(actionRequest.getAction())) {
          return suspendProcessDefinition(processDefinition, actionRequest.isIncludeProcessInstances(), actionRequest.getDate(),
              isGraphicalNotationDefined, serverRootUrl);
         
        } else if (ProcessDefinitionActionRequest.ACTION_ACTIVATE.equals(actionRequest.getAction())) {
          return activateProcessDefinition(processDefinition, actionRequest.isIncludeProcessInstances(), actionRequest.getDate(),
              isGraphicalNotationDefined, serverRootUrl);
        }
      }
     
      throw new ActivitiIllegalArgumentException("Invalid action: '" + actionRequest.getAction() + "'.");
    }
  }
View Full Code Here

  public List<Group> findGroupByQueryCriteria(GroupQueryImpl query, Page page) {
    // Only support for groupMember() at the moment
    if (query.getUserId() != null) {
      return findGroupsByUser(query.getUserId());
    } else {
      throw new ActivitiIllegalArgumentException("This query is not supported by the LDAPGroupManager");
    }
  }
View Full Code Here

              ldapConfigurator.getUserFirstNameAttribute(),
              searchText,
              ldapConfigurator.getUserLastNameAttribute(),
              searchText);
    } else {
      throw new ActivitiIllegalArgumentException("No 'queryUserByFullNameLike' configured");
    }
    return searchExpression;
  }
View Full Code Here

  }

  protected void addVariables(HistoricProcessInstanceQuery processInstanceQuery, List<QueryVariable> variables) {
    for (QueryVariable variable : variables) {
      if (variable.getVariableOperation() == null) {
        throw new ActivitiIllegalArgumentException("Variable operation is missing for variable: " + variable.getName());
      }
      if (variable.getValue() == null) {
        throw new ActivitiIllegalArgumentException("Variable value is missing for variable: " + variable.getName());
      }

      boolean nameLess = variable.getName() == null;

      Object actualValue = restResponseFactory.getVariableValue(variable);

      // A value-only query is only possible using equals-operator
      if (nameLess && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {
        throw new ActivitiIllegalArgumentException("Value-only query (without a variable-name) is only supported when using 'equals' operation.");
      }

      switch (variable.getVariableOperation()) {

      case EQUALS:
        if (nameLess) {
          processInstanceQuery.variableValueEquals(actualValue);
        } else {
          processInstanceQuery.variableValueEquals(variable.getName(), actualValue);
        }
        break;

      case EQUALS_IGNORE_CASE:
        if (actualValue instanceof String) {
          processInstanceQuery.variableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
        } else {
          throw new ActivitiIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: "
                  + actualValue.getClass().getName());
        }
        break;

      case NOT_EQUALS:
        processInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);
        break;
       
      case LIKE:
        if (actualValue instanceof String) {
          processInstanceQuery.variableValueLike(variable.getName(), (String) actualValue);
        } else {
          throw new ActivitiIllegalArgumentException("Only string variable values are supported for like, but was: "
                  + actualValue.getClass().getName());
        }
        break;
       
      case GREATER_THAN:
        processInstanceQuery.variableValueGreaterThan(variable.getName(), actualValue);
        break;
       
      case GREATER_THAN_OR_EQUALS:
        processInstanceQuery.variableValueGreaterThanOrEqual(variable.getName(), actualValue);
        break;

      case LESS_THAN:
        processInstanceQuery.variableValueLessThan(variable.getName(), actualValue);
        break;
       
      case LESS_THAN_OR_EQUALS:
        processInstanceQuery.variableValueLessThanOrEqual(variable.getName(), actualValue);
        break;

      default:
        throw new ActivitiIllegalArgumentException("Unsupported variable query operation: " + variable.getVariableOperation());
      }
    }
  }
View Full Code Here

      HttpServletRequest request, HttpServletResponse response) {
   
    HistoricProcessInstance instance = getHistoricProcessInstanceFromRequest(processInstanceId);
   
    if (comment.getMessage() == null) {
      throw new ActivitiIllegalArgumentException("Comment text is required.");
    }
   
    Comment createdComment = taskService.addComment(null, instance.getId(), comment.getMessage());
    response.setStatus(HttpStatus.CREATED.value());
   
View Full Code Here

  @Override
  public Object getVariableValue(RestVariable result) {
    if(result.getValue() != null) {
      if(!(result.getValue() instanceof String)) {
        throw new ActivitiIllegalArgumentException("Converter can only convert strings");
      }
      return (String) result.getValue();
    }
    return null;
  }
View Full Code Here

  @Override
  public void convertVariableValue(Object variableValue, RestVariable result) {
    if(variableValue != null) {
      if(!(variableValue instanceof String)) {
        throw new ActivitiIllegalArgumentException("Converter can only convert strings");
      }
      result.setValue(variableValue);
    } else {
      result.setValue(null);
    }
View Full Code Here

        }
       
      });
     
    } else {
      throw new ActivitiIllegalArgumentException("Query is currently not supported by LDAPUserManager.");
    }
   
  }
View Full Code Here

  @Override
  public Object getVariableValue(RestVariable result) {
    if(result.getValue() != null) {
      if(!(result.getValue() instanceof String)) {
        throw new ActivitiIllegalArgumentException("Converter can only convert string to date");
      }
      try {
        return isoFormatter.parse((String) result.getValue());
      } catch (ParseException e) {
        throw new ActivitiIllegalArgumentException("The given variable value is not a date: '" + result.getValue() + "'", e);
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.ActivitiIllegalArgumentException

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.