OScope.Variable rootNode = new OScope.Variable(null, rootNodeType); rootNode.name = "__rootNode"; buf.append(genDeclarations(rootNode));
public boolean equals(Object obj) { VariableInstance other = (VariableInstance) obj; return other.declaration.equals(declaration) && other.scopeInstance.equals(scopeInstance); }
/** * We record all values of properties of a 'MessageType' variable for * efficient lookup. */ private void writeProperties(VariableInstance variable, Node value, XmlDataDAO dao) { if (variable.declaration.type instanceof OMessageVarType) { for (OProcess.OProperty property : variable.declaration.getOwner().properties) { OProcess.OPropertyAlias alias = property.getAlias(variable.declaration.type); if (alias != null) { try { String val = _bpelProcess.extractProperty((Element) value, alias, variable.declaration .getDescription()); if (val != null) { dao.setProperty(property.name.toString(), val); } } catch (FaultException e) { // This will fail as we're basically trying to extract properties on all // received messages for optimization purposes. if (__log.isDebugEnabled()) __log.debug("Couldn't extract property '" + property.toString() + "' in property pre-extraction: " + e.toString()); } } } } }
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;
.errUnrecognizedVariableDeclaration(onEvent.getVariable())); oevent.variable = new OScope.Variable(_oprocess, varType); oevent.variable.name = onEvent.getVariable(); oevent.variable.declaringScope = _structureStack.topScope();
.errUnrecognizedVariableDeclaration(catchSrc.getFaultVariable())); faultVar = new OScope.Variable(_oprocess, faultVarType); faultVar.name = catchSrc.getFaultVariable(); faultVar.declaringScope = _structureStack.topScope();
.errUnrecognizedVariableDeclaration(onEvent.getVariable())); oevent.variable = new OScope.Variable(_oprocess, varType); oevent.variable.name = onEvent.getVariable(); oevent.variable.declaringScope = _structureStack.topScope();
if (variableNode == null) throw new WrappedFaultException.JaxenUnresolvableException( new FaultException(variable.getOwner().constants.qnSelectionFailure, "Unknown variable " + localName)); OVarType type = variable.type; if (typePart == null) { throw new WrappedFaultException.JaxenUnresolvableException( new FaultException(variable.getOwner().constants.qnSelectionFailure, "Unknown part " + partName + " for variable " + localName));
.errUnrecognizedVariableDeclaration(catchSrc.getFaultVariable())); faultVar = new OScope.Variable(_oprocess, faultVarType); faultVar.name = catchSrc.getFaultVariable(); faultVar.declaringScope = _structureStack.topScope();
final Node variableNode = _ectx.readVariable(variable, part); if (variableNode == null) throw new FaultException(variable.getOwner().constants.qnSelectionFailure, "Unknown variable " + variableName.getLocalPart()); if (_ectx.narrowTypes()) { if (variable.type instanceof OXsdTypeVarType && ((OXsdTypeVarType) variable.type).simple)
OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
counterType.simple = true; counterType.xsdType = new QName(Namespaces.XML_SCHEMA, "int"); OScope.Variable counterVar = new OScope.Variable(oforEach.getOwner(), counterType); counterVar.name = forEach.getCounterName();
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()); } });
/** * Evaluate a property alias query expression against a variable, returning * the normalized {@link String} representation of the property value. * * @param variable * variable to read * @param property * property to read * @return value of property for variable, in String form * @throws org.apache.ode.bpel.common.FaultException * in case of selection or other fault */ public String readProperty(VariableInstance variable, OProcess.OProperty property) throws FaultException { Node varData = readVariable(variable.scopeInstance, variable.declaration.name, false); OProcess.OPropertyAlias alias = property.getAlias(variable.declaration.type); String val = _bpelProcess.extractProperty((Element) varData, alias, variable.declaration.getDescription()); if (BpelProcess.__log.isTraceEnabled()) { BpelProcess.__log.trace("readPropertyAlias(variable=" + variable + ", alias=" + alias + ") = " + val.toString()); } return val; }