private OProcess.OPropertyAlias compile(PropertyAlias src) {
OProcess.OProperty property = resolveProperty(src.getPropertyName());
OProcess.OPropertyAlias alias = new OProcess.OPropertyAlias(_oprocess);
alias.debugInfo = createDebugInfo(_processDef, "PropertyAlias " + src.getPropertyName() + " for "
+ src.getMessageType());
if (src.getMessageType() == null){
throw new CompilationException(__cmsgs.errAliasUndeclaredMessage(src.getPropertyName(),
src.getQuery().getPath()));
}
OMessageVarType messageType = resolveMessageType(src.getMessageType());
OVarType rootNodeType = messageType;
alias.varType = messageType;
if (src.getPart() != null) {
alias.part = messageType.parts.get(src.getPart());
if (alias.part == null)
throw new CompilationException(__cmsgs.errUnknownPartInAlias(src.getPart(),
messageType.messageType.toString()));
rootNodeType = alias.part.type;
}
if (src.getQuery() != null)
alias.location = compileExpr(src.getQuery(), rootNodeType, null, new Object[1]);
property.aliases.add(alias);
alias.debugInfo = createDebugInfo(_processDef, src.getMessageType() + " --> " + src.getPropertyName());
return alias;
}