public virtual object get(object key) { if (variableScopeKey.Equals(key)) { return(variableScope); } return(variableScope.getVariable((string)key)); }
public virtual void initialize(VariableScope innerScopeInstance, VariableScope outerScopeInstance) { if (!string.ReferenceEquals(sourceVariableName, null)) { if (outerScopeInstance.hasVariable(sourceVariableName)) { object value = outerScopeInstance.getVariable(sourceVariableName); innerScopeInstance.setVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't create variable '" + destinationVariableName + "', since the source variable '" + sourceVariableName + "does not exist"); } } if (sourceExpression != null) { object value = sourceExpression.getValue(outerScopeInstance); innerScopeInstance.setVariable(destinationVariableName, value); } if (!string.ReferenceEquals(link, null)) { if (outerScopeInstance.hasVariable(sourceVariableName)) { object value = outerScopeInstance.getVariable(sourceVariableName); innerScopeInstance.setVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't create variable '" + destinationVariableName + "', since the source variable '" + sourceVariableName + "does not exist"); } } if (linkExpression != null) { object value = sourceExpression.getValue(outerScopeInstance); innerScopeInstance.setVariable(destinationVariableName, value); } }
public virtual void destroy(VariableScope innerScopeInstance, VariableScope outerScopeInstance) { if (!string.ReferenceEquals(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 (!string.ReferenceEquals(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 virtual 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 override object getValue(ELContext context, object @base, object property) { object @object = context.getContext(typeof(VariableScope)); 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 is ExecutionEntity) || (TASK_KEY.Equals(property) && variableScope is TaskEntity) || (variableScope is CaseExecutionEntity && (CASE_EXECUTION_KEY.Equals(property) || EXECUTION_KEY.Equals(property)))) { context.PropertyResolved = true; return(variableScope); } else if (EXECUTION_KEY.Equals(property) && variableScope is TaskEntity) { context.PropertyResolved = true; return(((TaskEntity)variableScope).getExecution()); } else if (LOGGED_IN_USER_KEY.Equals(property)) { context.PropertyResolved = true; return(Context.CommandContext.AuthenticatedUserId); } else { if (variableScope.hasVariable(variable)) { context.PropertyResolved = 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); }