for (Iterator j = cset.properties.iterator(); j.hasNext(); ++jIdx) { OProcess.OProperty property = (OProcess.OProperty) j.next(); OProcess.OPropertyAlias alias = property.getAlias(messagetype);
/** * 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; }
/** * 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()); } } } } }
public OProcess.OPropertyAlias resolvePropertyAlias(OScope.Variable variable, QName propertyName) { if (!(variable.type instanceof OMessageVarType)) throw new CompilationException(__cmsgs.errMessageVariableRequired(variable.name)); OProcess.OProperty property = resolveProperty(propertyName); OProcess.OPropertyAlias alias = property.getAlias(variable.type); if (alias == null) throw new CompilationException(__cmsgs.errUndeclaredPropertyAlias(variable.type.toString(), propertyName)); return alias; }