public Node readVariable(OScope.Variable variable, OMessageVarType.Part part) throws FaultException { if (__log.isTraceEnabled()) __log.trace("readVariable(" + variable + "," + part + ")"); // TODO: check for null _scopeInstance Node ret; if (variable.type instanceof OConstantVarType) { ret = ((OConstantVarType) variable.type).getValue(); } else { VariableInstance varInstance = _scopeInstance.resolve(variable); if (varInstance == null) return null; VariableReadEvent vre = new VariableReadEvent(); vre.setVarName(varInstance.declaration.name); sendEvent(vre); ret = _scopeInstance.fetchVariableData(_native,varInstance, part, false); } return ret; }
public void run() { if (process.getRootActivity() == null) { throw new CompilationException(__cmsgs.errNoRootActivity()); } // Process custom properties are created as variables associated // with the top scope if (_customProcessProperties != null) { for (Map.Entry<QName, Node> customVar : _customProcessProperties.entrySet()) { final OScope oscope = _structureStack.topScope(); OVarType varType = new OConstantVarType(_oprocess, customVar.getValue()); OScope.Variable ovar = new OScope.Variable(_oprocess, varType); ovar.name = customVar.getKey().getLocalPart(); ovar.declaringScope = oscope; ovar.debugInfo = createDebugInfo(null, "Process custom property variable"); oscope.addLocalVariable(ovar); if (__log.isDebugEnabled()) __log.debug("Compiled custom property variable " + ovar); } } _structureStack.topScope().activity = compile(process.getRootActivity()); } });