Hello everyone, I am trying to get the object that is connected by generalization to the object I am reading at the moment. I tried all ways to read that connection I know and everything I get to trying to read the target object is a "generalization". As if it could read the connection but not the object to which it links it. Can someone help me please?
var uml2class=omf.toOmfObject(obj.ObjDef());
var classname=uml2class.omfGetName(null);
objDef = obj.ObjDef()
var lista = [];
var objConectados = new Array();
var cnxDefs = objDef.CxnList();
var conList = obj.CxnOccList();
for(var j=0; j<cnxDefs.length; j++) {
if(cnxDefs[j].SourceObjDef().equals(objDef)){
objConectados.push(cnxDefs[j].TargetObjDef());
}else{
objConectados.push(cnxDefs[j].SourceObjDef());
}
lista = obj.getConnectedObjOccs(null, Constants.EDGES_OUT);
var tipo = cnxDefs[j].ActiveType();
var aorigen = cnxDefs[j].SourceObjDef().Name(-1);
var adestino = cnxDefs[j].TargetObjDef().Name(-1);
}
for(var j=0; j<objConectados.length; j++) {
lista[j] = objConectados[j];
}
Kay Fischbach on
Hi,
could you clarify what you want your code to say?
Do you want it to say
"Interconnection generalizes Interconnection Circuit.
Interconnection generalizes Interconnection Aggregation Circuit."
or do you want it to say
"Interconnection Aggregation Circuit specializes Interconnection.
Interconnection Circuit specializes Interconnection."
or both?
General pointers, no matter what you want your code to say (advice related to your problem):
Anyways, I recommend you try to stick to the occurrence layer, and only punctually dip into the definition layer when you really have to.