Package org.activiti.engine

Examples of org.activiti.engine.ActivitiIllegalArgumentException


        List<String> expressions = Arrays.asList(text.split("/"));
        this.datatypeFactory = DatatypeFactory.newInstance();

        if ((expressions.size() > 3) || expressions.isEmpty()) {
            throw new ActivitiIllegalArgumentException("Cannot parse duration");
        }

        // 获得重复次数
        if (expressions.get(0).startsWith("R")) {
            this.isRepeat = true;
View Full Code Here


  }


  public TaskEntity findTaskById(String id) {
    if (id == null) {
      throw new ActivitiIllegalArgumentException("Invalid task id : null");
    }
    return (TaskEntity) getDbSqlSession().selectById(TaskEntity.class, id);
  }
View Full Code Here

  protected RuntimeService runtimeService;

  @RequestMapping(value="/runtime/signals", method = RequestMethod.POST)
  public void signalEventReceived(@RequestBody SignalEventReceivedRequest signalRequest, HttpServletResponse response) {
    if (signalRequest.getSignalName() == null) {
      throw new ActivitiIllegalArgumentException("signalName is required");
    }
   
    Map<String, Object> signalVariables = null;
    if (signalRequest.getVariables() != null) {
      signalVariables = new HashMap<String, Object>();
      for (RestVariable variable : signalRequest.getVariables()) {
        if (variable.getName() == null) {
          throw new ActivitiIllegalArgumentException("Variable name is required.");
        }
        signalVariables.put(variable.getName(), restResponseFactory.getVariableValue(variable));
      }
    }
   
    if (signalRequest.isAsync()) {
      if(signalVariables != null) {
        throw new ActivitiIllegalArgumentException("Async signals cannot take variables as payload");
      }
     
      if (signalRequest.isCustomTenantSet()) {
        runtimeService.signalEventReceivedAsyncWithTenantId(signalRequest.getSignalName(), signalRequest.getTenantId());
      } else {
View Full Code Here

        for (Object restObject : variableObjects) {
          RestVariable restVariable = objectMapper.convertValue(restObject, RestVariable.class);
          inputVariables.add(restVariable);
        }
      } catch (Exception e) {
        throw new ActivitiIllegalArgumentException("Failed to serialize to a RestVariable instance", e);
      }
     
      if (inputVariables == null || inputVariables.size() == 0) {
        throw new ActivitiIllegalArgumentException("Request didn't contain a list of variables to create.");
      }
     
      RestVariableScope sharedScope = null;
      RestVariableScope varScope = null;
      Map<String, Object> variablesToSet = new HashMap<String, Object>();
     
      for (RestVariable var : inputVariables) {
        // Validate if scopes match
        varScope = var.getVariableScope();
        if (var.getName() == null) {
          throw new ActivitiIllegalArgumentException("Variable name is required");
        }
       
        if (varScope == null) {
          varScope = RestVariableScope.LOCAL;
        }
        if (sharedScope == null) {
          sharedScope = varScope;
        }
        if (varScope != sharedScope) {
          throw new ActivitiIllegalArgumentException("Only allowed to update multiple variables in the same scope.");
        }
       
        if (!override && hasVariableOnScope(execution, var.getName(), varScope)) {
          throw new ActivitiConflictException("Variable '" + var.getName() + "' is already present on execution '" + execution.getId() + "'.");
        }
       
        Object actualVariableValue = restResponseFactory.getVariableValue(var);
        variablesToSet.put(var.getName(), actualVariableValue);
        resultVariables.add(restResponseFactory.createRestVariable(var.getName(), actualVariableValue, varScope,
            execution.getId(), variableType, false, serverRootUrl));
      }
     
      if (!variablesToSet.isEmpty()) {
        if (sharedScope == RestVariableScope.LOCAL) {
          runtimeService.setVariablesLocal(execution.getId(), variablesToSet);
        } else {
          if (execution.getParentId() != null) {
            // Explicitly set on parent, setting non-local variables on execution itself will override local-variables if exists
            runtimeService.setVariables(execution.getParentId(), variablesToSet);
          } else {
            // Standalone task, no global variables possible
            throw new ActivitiIllegalArgumentException("Cannot set global variables on execution '" + execution.getId() +"', task is not part of process.");
          }
        }
      }
    }
    response.setStatus(HttpStatus.CREATED.value());
View Full Code Here

  }
 
  @RequestMapping(value="/runtime/executions", method = RequestMethod.PUT)
  public void executeExecutionAction(@RequestBody ExecutionActionRequest actionRequest, HttpServletResponse response) {
    if (!ExecutionActionRequest.ACTION_SIGNAL_EVENT_RECEIVED.equals(actionRequest.getAction())) {
      throw new ActivitiIllegalArgumentException("Illegal action: '" + actionRequest.getAction() +"'.");
    }
   
    if (actionRequest.getSignalName() == null) {
      throw new ActivitiIllegalArgumentException("Signal name is required.");
    }
   
    if (actionRequest.getVariables() != null) {
      runtimeService.signalEventReceived(actionRequest.getSignalName(), getVariablesToSet(actionRequest));
    } else {
View Full Code Here

     this.isLocal = isLocal;
    }

    public List<String> execute(CommandContext commandContext) {
      if(executionId == null) {
        throw new ActivitiIllegalArgumentException("executionId is null");
      }
     
      ExecutionEntity execution = commandContext
        .getExecutionEntityManager()
        .findExecutionById(executionId);
View Full Code Here

        response.setContentType("image/png");
        return responseBytes;
       
      } catch(Exception e) {
        response.setContentType("application/json");
        throw new ActivitiIllegalArgumentException("Error exporting diagram", e);
      }
     
    } else {
      response.setContentType("application/json");
      throw new ActivitiIllegalArgumentException("Process instance with id '" + processInstance.getId() + "' has no graphical notation defined.");
    }
  }
View Full Code Here

        query.executable();
      }
    }
    if (allRequestParams.containsKey("timersOnly")) {
      if (allRequestParams.containsKey("messagesOnly")) {
        throw new ActivitiIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided.");
      }
      if (Boolean.valueOf(allRequestParams.get("timersOnly"))) {
        query.timers();
      }
    }
View Full Code Here

          converter = conv;
          break;
        }
      }
      if(converter == null) {
        throw new ActivitiIllegalArgumentException("Variable '" + restVariable.getName() + "' has unsupported type: '" + restVariable.getType() + "'.");
      }
      value = converter.getVariableValue(restVariable);
     
    } else {
      // Revert to type determined by REST-to-Java mapping when no explicit type has been provided
View Full Code Here

          converter = conv;
          break;
        }
      }
      if(converter == null) {
        throw new ActivitiIllegalArgumentException("Variable '" + restVariable.getName() + "' has unsupported type: '" + restVariable.getType() + "'.");
      }
     
      RestVariable temp = new RestVariable();
      temp.setValue(restVariable.getValue());
      temp.setType(restVariable.getType());
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.