public void destroy(VariableScope innerScopeInstance, VariableScope outerScopeInstance) { if (destinationVariableName!=null) { if (innerScopeInstance.hasVariable(sourceVariableName)) { Object value = innerScopeInstance.getVariable(sourceVariableName); outerScopeInstance.setVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't destroy variable " + sourceVariableName + ", since it does not exist"); } } if (destinationExpression!=null) { Object value = destinationExpression.getValue(innerScopeInstance); outerScopeInstance.setVariable(destinationVariableName, value); } if (link!=null) { if (innerScopeInstance.hasVariable(sourceVariableName)) { Object value = innerScopeInstance.getVariable(sourceVariableName); outerScopeInstance.setVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't destroy variable " + sourceVariableName + ", since it does not exist"); } } if (linkExpression!=null) { Object value = sourceExpression.getValue(innerScopeInstance); outerScopeInstance.setVariable(destinationVariableName, value); } }
public Map<String, Object> getVariablesLocal() { return wrappedScope.getVariablesLocal(); }
public VariableMap getVariablesLocalTyped() { return wrappedScope.getVariablesLocalTyped(); }
public Object put(String name, Object value) { if(autoStoreScriptVariables) { if (!UNSTORED_KEYS.contains(name)) { Object oldValue = variableScope.getVariable(name); variableScope.setVariable(name, value); return oldValue; } } return wrappedBindings.put(name, value); }
public void setValue(ELContext context, Object base, Object property, Object value) { if (base == null) { String variable = (String) property; Object object = context.getContext(VariableScope.class); if (object != null) { VariableScope variableScope = (VariableScope) object; if (variableScope.hasVariable(variable)) { variableScope.setVariable(variable, value); } } } }
@Before public void setUp() { this.variableScope = new TestVariableScope(); variableScope.setVariable(VAR_NAME, VAR_VALUE_STRING); }
public Object getValue(ELContext context, Object base, Object property) { Object object = context.getContext(VariableScope.class); if(object != null) { VariableScope variableScope = (VariableScope) object; if (base == null) { String variable = (String) property; // according to javadoc, can only be a String if( (EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity) || (TASK_KEY.equals(property) && variableScope instanceof TaskEntity) || (variableScope instanceof CaseExecutionEntity && (CASE_EXECUTION_KEY.equals(property) || EXECUTION_KEY.equals(property))) ) { context.setPropertyResolved(true); return variableScope; } else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) { context.setPropertyResolved(true); return ((TaskEntity) variableScope).getExecution(); } else if(LOGGED_IN_USER_KEY.equals(property)){ context.setPropertyResolved(true); return Context.getCommandContext().getAuthenticatedUserId(); } else { if (variableScope.hasVariable(variable)) { context.setPropertyResolved(true); // if not set, the next elResolver in the CompositeElResolver will be called return variableScope.getVariable(variable); } } } } // property resolution (eg. bean.value) will be done by the BeanElResolver (part of the CompositeElResolver) // It will use the bean resolved in this resolver as base. return null; }
protected DmnDecisionTableResult evaluateDecision(DecisionService decisionService, VariableScope variableScope) { return decisionService.evaluateDecisionTableByKey("testDecision", variableScope.getVariables()); }
public Object get(Object key) { if (variableScopeKey.equals(key)) { return variableScope; } return variableScope.getVariable((String) key); }
public String getVariableScopeKey() { return wrappedScope.getVariableScopeKey(); }
public Set<String> keySet() { return variableScope.getVariableNames(); }
public <T extends TypedValue> T getVariableLocalTyped(String variableName, boolean deserializeValue) { return wrappedScope.getVariableLocalTyped(variableName, deserializeValue); }
public Set<String> getVariableNamesLocal() { return wrappedScope.getVariableNamesLocal(); }
public Object getVariableLocal(String variableName) { return wrappedScope.getVariableLocal(variableName); }
variableScope.setVariable(variableName, modelValue); } else if (variableExpression != null) { variableExpression.setValue(modelValue, variableScope); } else { variableScope.setVariable(id, modelValue);
public Object put(String name, Object value) { if(autoStoreScriptVariables) { if (!UNSTORED_KEYS.contains(name)) { Object oldValue = variableScope.getVariable(name); variableScope.setVariable(name, value); return oldValue; } } return wrappedBindings.put(name, value); }
public void setValue(ELContext context, Object base, Object property, Object value) { if (base == null) { String variable = (String) property; Object object = context.getContext(VariableScope.class); if (object != null) { VariableScope variableScope = (VariableScope) object; if (variableScope.hasVariable(variable)) { variableScope.setVariable(variable, value); } } } }
public Object getValue(ELContext context, Object base, Object property) { Object object = context.getContext(VariableScope.class); if(object != null) { VariableScope variableScope = (VariableScope) object; if (base == null) { String variable = (String) property; // according to javadoc, can only be a String if( (EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity) || (TASK_KEY.equals(property) && variableScope instanceof TaskEntity) || (variableScope instanceof CaseExecutionEntity && (CASE_EXECUTION_KEY.equals(property) || EXECUTION_KEY.equals(property))) ) { context.setPropertyResolved(true); return variableScope; } else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) { context.setPropertyResolved(true); return ((TaskEntity) variableScope).getExecution(); } else if(LOGGED_IN_USER_KEY.equals(property)){ context.setPropertyResolved(true); return Context.getCommandContext().getAuthenticatedUserId(); } else { if (variableScope.hasVariable(variable)) { context.setPropertyResolved(true); // if not set, the next elResolver in the CompositeElResolver will be called return variableScope.getVariable(variable); } } } } // property resolution (eg. bean.value) will be done by the BeanElResolver (part of the CompositeElResolver) // It will use the bean resolved in this resolver as base. return null; }
public void applyTo(VariableScope variableScope, VariableMap variables) { if (readLocal) { variableScope = new VariableScopeLocalAdapter(variableScope); } if (allVariables) { Map<String, Object> allVariables = variableScope.getVariables(); variables.putAll(allVariables); } else { Object value = getSource(variableScope); variables.put(target, value); } }
public Object get(Object key) { if (variableScopeKey.equals(key)) { return variableScope; } return variableScope.getVariable((String) key); }