Sets a variable as high as possible (highest parent).

@param sourceExecution The execution where the variable was originally set, used for history data.
@param fetchAllVariables If true, all existing variables will be fetched when setting the variable.
429788
protected void setVariable(String variableName, Object value, ExecutionEntity sourceExecution, boolean fetchAllVariables) {

    if (fetchAllVariables == true) {

      // If it's in the cache, it's more recent
      if (usedVariablesCache.containsKey(variableName)) {
        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);
      }

      // If the variable exists on this scope, replace it
      if (hasVariableLocal(variableName)) {
        setVariableLocal(variableName, value, sourceExecution, true);
        return;
      }

      // Otherwise, go up the hierarchy (we're trying to put it as high as possible)
      VariableScopeImpl parentVariableScope = getParentVariableScope();
      if (parentVariableScope != null) {
        if (sourceExecution == null) {
          parentVariableScope.setVariable(variableName, value);
        } else {
          parentVariableScope.setVariable(variableName, value, sourceExecution, true);
        }
        return;
      }

      // We're as high as possible and the variable doesn't exist yet, so
      // we're creating it
      if (sourceExecution != null) {
        createVariableLocal(variableName, value, sourceExecution);
      } else {
        createVariableLocal(variableName, value);
      }

    } else {

      // Check local cache first
      if (usedVariablesCache.containsKey(variableName)) {

        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);

      } else if (variableInstances != null && variableInstances.containsKey(variableName)) {

        updateVariableInstance(variableInstances.get(variableName), value, sourceExecution);

      } else {

        // Not in local cache, check if defined on this scope
        // Create it if it doesn't exist yet
        VariableInstanceEntity variable = getSpecificVariable(variableName);
        if (variable != null) {
          updateVariableInstance(variable, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);
        } else {

          VariableScopeImpl parent = getParentVariableScope();
          if (parent != null) {
            if (sourceExecution == null) {
              parent.setVariable(variableName, value, fetchAllVariables);
            } else {
              parent.setVariable(variableName, value, sourceExecution, fetchAllVariables);
            }

            return;
          }

          variable = createVariableInstance(variableName, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);

        }

      }

    }

  }
1270862
public void setComponent(String component, Variable ... vars) {
		for (Variable var : vars) {
			if (var.getComponent() != null && !var.getComponent().equals(component)) {
				components.get(var.getComponent()).remove(var);
			}
		}
		if (!components.containsKey(component)) components.put(component, new ArrayList<Variable>());
		for (Variable var : vars) components.get(component).add(var);
	}

	/**
	 * Create a batch of new {@link Variable}s for this {@link ConstraintSolver}.
	 * @param num The number of variables to create.
	 * @return A batch of new {@link Variable}s.
	 */
	public final Variable[] createVariables(int num) {
		return this.createVariables(num, null);
	}

	/**
	 * Create a batch of new {@link Variable}s for this {@link ConstraintSolver}.
	 * @param num The number of variables to create.
	 * @param component The component tag to associate to these new variables.
	 * @return A batch of new {@link Variable}s.
	 */
	public final Variable[] createVariables(int num, String component) {
		Variable[] ret = createVariablesSub(num, component);
		if (ret == null) return null;
		//need to add all to network so if sth goes wrong I can delete all of them concurrently
		for (Variable v : ret) this.theNetwork.addVariable(v);
		if (!skipPropagation && autoprop && checkDomainsInstantiated() && !noPropOnVarCreation) this.propagate();
		logger.finest("Created variables " + Arrays.toString(ret));
		return ret;
	}
1180320
@Override
  public ExecutionEntity createExecution(boolean initializeExecutionStartContext) {
    // create the new child execution
    ExecutionEntity createdExecution = createNewExecution();

    // initialize sequence counter
    createdExecution.setSequenceCounter(getSequenceCounter());

    // manage the bidirectional parent-child relation
    createdExecution.setParent(this);

    // initialize the new execution
    createdExecution.setProcessDefinition(getProcessDefinition());
    createdExecution.setProcessInstance(getProcessInstance());
    createdExecution.setActivity(getActivity());
    createdExecution.setSuspensionState(getSuspensionState());

    // make created execution start in same activity instance
    createdExecution.activityInstanceId = activityInstanceId;

    // inherit the tenant id from parent execution
    if(tenantId != null) {
      createdExecution.setTenantId(tenantId);
    }

    // with the fix of CAM-9249 we presume that the parent and the child have the same startContext
    if (initializeExecutionStartContext) {
      createdExecution.setStartContext(new ExecutionStartContext());
    } else if (startContext != null) {
      createdExecution.setStartContext(startContext);
    }

    createdExecution.skipCustomListeners = this.skipCustomListeners;
    createdExecution.skipIoMapping = this.skipIoMapping;

    LOG.createChildExecution(createdExecution, this);

    return createdExecution;
  }
634378
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
            ELException
    {
        String nameStr = getName(ctx);
        ValueExpression valueVE = getValue(ctx);
        //ctx.getVariableMapper().setVariable(nameStr, valueVE);
        apply(ctx, parent, nameStr, valueVE);
    }
1269096
public void setPreparedExecuteProperties(Object[] parameterValues,
            int maxRows, int fetchSize) {

        mode = ResultConstants.EXECUTE;

        if (navigator.getSize() == 1) {
            ((RowSetNavigatorClient) navigator).setData(0, parameterValues);
        } else {
            navigator.clear();
            navigator.add(parameterValues);
        }

        updateCount    = maxRows;
        this.fetchSize = fetchSize;
    }
223517
public int forAll(final int r, final int var) {
    final int res;
    if (var < 2)
      return r;
    varset2vartable(var);
    initRef();
    res = quantRec(r, Operand.AND, (var << 3) | CACHEID_FORALL);
    return res;
  }
969990
public HistoryEvent createHistoricVariableCreateEvt(VariableInstanceEntity variableInstance, VariableScope sourceVariableScope) {
    return createHistoricVariableEvent(variableInstance, sourceVariableScope, HistoryEventTypes.VARIABLE_INSTANCE_CREATE);
  }
379917
public CallActivityMock onExecutionSetVariables(final VariableMap variables){
    return this.onExecutionDo("setVariablesServiceMock_"+ randomUUID(),
      (execution) -> execution.setVariables(variables)
    );
  }
1089430
public void setExecutionInfos(java.util.Collection<WorkflowExecutionInfo> executionInfos) {
        if (executionInfos == null) {
            this.executionInfos = null;
            return;
        }

        this.executionInfos = new java.util.ArrayList<WorkflowExecutionInfo>(executionInfos);
    }
975975
void setExecutionPipeline(final ExecutionPipeline executionPipeline) {

		final ExecutionPipeline oldPipeline = this.executionPipeline.getAndSet(executionPipeline);
		if (oldPipeline != null) {
			oldPipeline.removeFromPipeline(this);
		}

		executionPipeline.addToPipeline(this);
	}
963626
public void setExpression(Expression exp)
  {
  	if(null != m_mainExp)
    	exp.exprSetParent(m_mainExp.exprGetParent()); // a bit bogus
    m_mainExp = exp;
  }
855703
private boolean executeQuantifier(int index, Expr.Quantifier expr, CallStack frame) {
		Tuple<Decl.Variable> vars = expr.getParameters();
		if (index == vars.size()) {
			// This is the base case where we evaluate the condition itself.
			RValue.Bool r = executeExpression(BOOL_T, expr.getOperand(), frame);
			boolean q = (expr instanceof Expr.UniversalQuantifier);
			// If this evaluates to true, then we will continue executing the
			// quantifier.
			return r.boolValue() == q;
		} else {
			Decl.Variable var = vars.get(index);
			RValue.Array range = executeExpression(ARRAY_T, var.getInitialiser(), frame);
			RValue[] elements = range.getElements();
			for (int i = 0; i != elements.length; ++i) {
				frame.putLocal(var.getName(), elements[i]);
				boolean r = executeQuantifier(index + 1, expr, frame);
				if (!r) {
					// early termination
					return r;
				}
			}
			return true;
		}
	}
1008781
public void setSourceUrl(java.util.Collection<StringFilter> sourceUrl) {
        if (sourceUrl == null) {
            this.sourceUrl = null;
            return;
        }

        this.sourceUrl = new java.util.ArrayList<StringFilter>(sourceUrl);
    }
882581
public SubReportBuilder setDataSource(int origin, String expression) {
		return setDataSource(origin, DJConstants.DATA_SOURCE_TYPE_JRDATASOURCE, expression);
	}
1271184
@Override
    public void changeVariables(Object source, Map<String, Object> variables) {
        if (variables.containsKey("filter")) {
            final String text = variables.get("filter").toString();
            fireEvent(new TextChangeEvent(this) {
                @Override
                public String getText() {
                    return text;
                }
                @Override
                public int getCursorPosition() {
                    return text.length();
                }
            });
        }
        super.changeVariables(source, variables);
    }
550714
@Override
	public void caseASetCompSetExp(ASetCompSetExp node) throws AnalysisException
	{
		if (!proceed(node))
		{
			return;
		}

		handleMultipleBindConstruct(node, node.getBindings(), node.getFirst(), node.getPredicate());
	}
986132
private void setVariableRange(int start, int end) {
        if (start > end || start < 0 || end > 0xFFFF) {
            throw new IllegalIcuArgumentException("Invalid variable range " + start + ", " + end);
        }

        curData.variablesBase = (char) start; // first private use

        if (dataVector.size() == 0) {
            variableNext = (char) start;
            variableLimit = (char) (end + 1);
        }
    }