* @param ident
* @return
*/
int identType(String ident,String entity){
RType type = (RType) types.get(RName.getRName(ident,true));
boolean defined = true;
if(entity != null && entity.length()!=0 && type!=null){
defined = false;
for(REntity rEntity : type.getEntities()){
if(entity.equalsIgnoreCase(rEntity.getName().stringValue())){
if(rEntity.containsAttribute(RName.getRName(ident))){
defined = true;
}
break;
}
}
}
if(type==null || defined==false){
RName rname = RName.getRName(
(entity==null||entity.length()==0?"":entity+".")+ident);
try {
IRObject o = session.getState().find(rname);
if(o==null)return -1;
return o.type();
} catch (RulesException e) {
return -1;
}
}
type.addRef(entity);
return type.getType();
}