Package org.activiti.rest.service.api.engine.variable.RestVariable

Examples of org.activiti.rest.service.api.engine.variable.RestVariable.RestVariableScope


  protected List<RestVariable> processVariables(Execution execution, String scope, int variableType, String serverRootUrl) {
    List<RestVariable> result = new ArrayList<RestVariable>();
    Map<String, RestVariable> variableMap = new HashMap<String, RestVariable>();
   
    // Check if it's a valid execution to get the variables for
    RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
   
    if (variableScope == null) {
      // Use both local and global variables
      addLocalVariables(execution, variableType, variableMap, serverRootUrl);
      addGlobalVariables(execution, variableType, variableMap, serverRootUrl);
View Full Code Here


     
      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();
View Full Code Here

        }
      } else {
        variableType = RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE;
      }
     
      RestVariableScope scope = RestVariableScope.LOCAL;
      if (variableScope != null) {
        scope = RestVariable.getScopeFromString(variableScope);
      }
     
      if (variableType.equals(RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE)) {
View Full Code Here

    if (restVariable.getName() == null) {
      throw new ActivitiIllegalArgumentException("Variable name is required");
    }

    // Figure out scope, revert to local is omitted
    RestVariableScope scope = restVariable.getVariableScope();
    if (scope == null) {
      scope = RestVariableScope.LOCAL;
    }
   
    Object actualVariableValue = restResponseFactory.getVariableValue(restVariable);
View Full Code Here

   
    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;
View Full Code Here

    Task task = getTaskFromRequest(taskId);
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
    RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
    if (variableScope == null) {
      // Use both local and global variables
      addLocalVariables(task, variableMap, serverRootUrl);
      addGlobalVariables(task, variableMap, serverRootUrl);
     
View Full Code Here

     
      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();
View Full Code Here

      @PathVariable("variableName") String variableName, @RequestParam(value="scope", required=false) String scope,
      HttpServletResponse response) {
   
    Execution execution = getExecutionFromRequest(executionId);
    // Determine scope
    RestVariableScope variableScope = RestVariableScope.LOCAL;
    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);
    } else {
View Full Code Here

      throw new ActivitiException("Unexpected exception getting variable data", ioe);
    }
  }
 
  public RestVariable getVariableFromRequest(boolean includeBinary, String taskId, String variableName, String scope, HttpServletRequest request) {
    RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
    HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery().taskId(taskId);
   
    if (variableScope != null) {
      if (variableScope == RestVariableScope.GLOBAL) {
        taskQuery.includeProcessVariables();
View Full Code Here

      @PathVariable("variableName") String variableName, @RequestParam(value="scope", required=false) String scope,
      HttpServletResponse response) {
   
    Execution execution = getProcessInstanceFromRequest(processInstanceId);
    // Determine scope
    RestVariableScope variableScope = RestVariableScope.LOCAL;
    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);
    } else {
View Full Code Here

TOP

Related Classes of org.activiti.rest.service.api.engine.variable.RestVariable.RestVariableScope

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.