I'm working on enhancing an excel spreadsheet consisting of information for business usage regarding applications.
We have a list of organisational units that go down 3-4 levels e.g.
A --
AA
--
AAA
--
AAAA
I have some code that gets the first level of the org unit (A) this is not a problem, though I'm new to Enterprise Architect and don't know the API all that well, but I am perservering the trouble is i'm trying to traverse from one connector to another to get to the next levels properties. I can't seem to find the name of the next connector within intellisense so i can't access the objects properties in subsequent levels, here is what I have came up with so far. Another note is that subsequent levels are also called OrganizationUnit. Some help will be appreciated.
function savePAGE(oWB, app, guid, store)
{
var entry = new Object();
var oSheet = oWB.Worksheets.Add;
oSheet.Name = app;
var elem as EA.Element;
elem = Repository.GetElementByGuid(guid);
var rng = oSheet.Range("A1");
var hyperlinkTargetAddress = "'INDEX'!A1";
var str = "";
r++;
r++;
oSheet.Cells(r, 1).Value = "THIS IS A TEST";
oSheet.Cells(r, 1).Font.Bold = 'TRUE';
for(var N = 0; N < elem.Connectors.Count; N++)
{
var flow as EA.Connector;
flow = elem.Connectors.GetAt(N);
var sElem as EA.Element;
sElem = Repository.GetElementByID(flow.SupplierID);
var cElem as EA.Element;
cElem = Repository.GetElementByID(flow.ClientID);
if(elem.ElementID != flow.SupplierID)
{
if( sElem.Stereotype == "OrganizationUnit" ) {
oSheet.Cells(r, 1).Value = sElem.Stereotype;
oSheet.Cells(r, 2).Value = sElem.Name;
entry.UNIT = sElem.Name;
r++;
}
}
if(elem.ElementID != flow.ClientID)
{
if( cElem.Stereotype == "OrganizationUnit" ) {
oSheet.Cells(r, 1).Value = cElem.Stereotype;
oSheet.Cells(r, 2).Value = cElem.Name;
entry.UNIT = cElem.Name;
r++;
}
}
}
store[app] = entry;
return store;
}