Hello community!
I´m very new in Aris an i´m trying to create a script that generates a ARIS model, having as asource an XML file.
I create all structures "softly" but i´m having problems due to create connections between objects into a model. This is my function to create these conections:
function conectar()
{
var ml = oGroup.ModelList(true,null) // obtain the models within the database
var model=ml[0]; // I only have one model, so I obtain it
var childGroup=oGroup.Childs( ); // obtain the child group within the database (only one)
var objects=objects[0].ObjDefList(); // obtain all the objects in the databas (2 in this case)
var objectA=c[0];
var objectB=c[1];
model.CreateCxnOcc(true,objectA,objectB,Constants.CT_USES,null); // creation of connection
}
These two objects have an occurrence in the model .
The code executes but it does not create any relationship.
What i´m doing wrong?
Please, could any of you help me?
Thanks a lot in advance!
Ignacio
Hello again!
I´ve just tried on this way to obtain the objects:
var objectA=getObjectInModel(model,"objectA");
var objectB=getObjectInModel(model,"objectB");
instead of:
var objects=objects[0].ObjDefList();
var objectA=c[0];
var objectB=c[1];
But it does not work
Regards
Ignacio
Hello Community.
I´ve solved my problem.
I was taking an invalid value to the connection type
model.CreateCxnOcc(true,objectA,objectB,Constants.CT_USES,null)
I´m creating a Quick Model and that connection code is invalid because quick Model only has available two connection types. (codes 504 and 11).
Best regards
Ignacio