}
return variableScope.getVariable(variableName);
}
public void setVariable(String variableName, Object value) {
VariableScopeInstance variableScope = null;
if (nodeInstance != null) {
variableScope = (VariableScopeInstance) ((org.drools.workflow.instance.NodeInstance)
nodeInstance).resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName);
}
if (variableScope == null) {
variableScope = (VariableScopeInstance) getProcessInstance().getContextInstance(VariableScope.VARIABLE_SCOPE);
if (variableScope.getVariableScope().findVariable(variableName) == null) {
variableScope = null;
}
}
if (variableScope == null) {
System.err.println("Could not find variable " + variableName);
System.err.println("Using process-level scope");
variableScope = (VariableScopeInstance) ((ProcessInstance)
getProcessInstance()).getContextInstance(VariableScope.VARIABLE_SCOPE);
}
variableScope.setVariable(variableName, value);
}