public Node fetchVariableData(VariableInstance variable, ScopeFrame scopeFrame, boolean forWriting) throws FaultException {
if (variable.declaration.extVar != null) {
// Note, that when using external variables, the database will not contain the value of the
// variable, instead we need to go the external variable subsystems.
VariableInstance referenceVariable = scopeFrame.resolve(variable.declaration.extVar.related);
Element reference = (Element) readVariable(referenceVariable.getScopeId(), referenceVariable.getName(), false);
try {
Node ret = readExtVar(variable.declaration, reference);
if (ret == null) {
throw new FaultException(_bpelProcess.getOProcess().constants.qnUninitializedVariable,
"The external variable \"" + variable.declaration.name + "\" has not been initialized.");