@Override public java.lang.Object get(java.lang.Object o) { Assert.isInstanceOf(String.class, o, "the 'key' must be a String"); String varName = (String) o; ProcessInstance processInstance = Context.getExecutionContext().getProcessInstance(); ExecutionEntity executionEntity = (ExecutionEntity) processInstance; if (executionEntity.getVariableNames().contains(varName)) { return executionEntity.getVariable(varName); } throw new RuntimeException("no processVariable by the name of '" + varName + "' is available!"); } };
public Object execute(CommandContext commandContext) { ensureNotNull("executionId", executionId); ensureNotNull("variableName", variableName); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(executionId); ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution); checkGetExecutionVariable(execution, commandContext); Object value; if (isLocal) { value = execution.getVariableLocal(variableName, true); } else { value = execution.getVariable(variableName, true); } return value; }
@Override public void setVariable(String variableName, Object value) { ExecutionEntity execution = getExecutionFromContext(); if(execution != null) { execution.setVariable(variableName, value); execution.getVariable(variableName); } else { getScopedAssociation().setVariable(variableName, value); } }
public Object execute(CommandContext commandContext) { ensureNotNull("executionId", executionId); ensureNotNull("variableName", variableName); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(executionId); ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution); checkGetExecutionVariable(execution, commandContext); Object value; if (isLocal) { value = execution.getVariableLocal(variableName, true); } else { value = execution.getVariable(variableName, true); } return value; }
public Object get(String name, ObjectFactory<?> objectFactory) { ExecutionEntity executionEntity = null; try { logger.fine("returning scoped object having beanName '" + name + "' for conversation ID '" + this.getConversationId() + "'. "); ProcessInstance processInstance = Context.getExecutionContext().getProcessInstance(); executionEntity = (ExecutionEntity) processInstance; Object scopedObject = executionEntity.getVariable(name); if (scopedObject == null) { scopedObject = objectFactory.getObject(); if (scopedObject instanceof ScopedObject) { ScopedObject sc = (ScopedObject) scopedObject; scopedObject = sc.getTargetObject(); logger.fine("de-referencing " + ScopedObject.class.getName() + "#targetObject before persisting variable"); } persistVariable(name, scopedObject); } return createDirtyCheckingProxy(name, scopedObject); } catch (Throwable th) { logger.warning("couldn't return value from process scope! " + StringUtil.getStackTrace(th)); } finally { if (executionEntity != null) { logger.fine("set variable '" + name + "' on executionEntity# " + executionEntity.getId()); } } return null; }
public Object execute(CommandContext commandContext) { ensureNotNull("executionId", executionId); ensureNotNull("variableName", variableName); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(executionId); ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution); checkGetExecutionVariable(execution, commandContext); Object value; if (isLocal) { value = execution.getVariableLocal(variableName, true); } else { value = execution.getVariable(variableName, true); } return value; }
final String varName = variableName != null ? variableName : id; if (execution.hasVariable(varName)) { modelValue = execution.getVariable(varName); } else if (defaultExpression != null) { modelValue = defaultExpression.getValue(execution);
final String varName = variableName != null ? variableName : id; if (execution.hasVariable(varName)) { modelValue = execution.getVariable(varName); } else if (defaultExpression != null) { modelValue = defaultExpression.getValue(execution);
@Override public void setVariable(String variableName, Object value) { ExecutionEntity execution = getExecutionFromContext(); if(execution != null) { execution.setVariable(variableName, value); execution.getVariable(variableName); } else { getScopedAssociation().setVariable(variableName, value); } }
ExecutionEntity entity = it.next(); QueryOperator operator = queryValue.getOperator(); Object value = entity.getVariable(queryValue.getName()); Object refValue = queryValue.getValue(); Comparable<Object> comparable = (value instanceof Comparable && refValue instanceof Comparable)?(Comparable<Object>)value:null;
final String varName = variableName != null ? variableName : id; if (execution.hasVariable(varName)) { modelValue = execution.getVariable(varName); } else if (defaultExpression != null) { modelValue = defaultExpression.getValue(execution);