void btnConveyedItem_Click(object sender, EventArgs e)
{
EA.ObjectType type = Model.Repository.GetContextItemType();
string sql;
switch (type)
{
case EA.ObjectType.otElement:
sql = @"
select s.ea_guid AS CLASSGUID, s.object_type AS CLASSTYPE,
s.name As [Source], s.Object_Type As [SourceType],
d.name As [Destination], d.object_Type As [DestinationType]
from t_xref x, // a lot of things like properties,..
t_connector c,
t_object s, // Source element
t_object d // destination element
where x.description like '#WC##CurrentItemGUID##WC#' AND
x.Behavior = 'conveyed' AND
c.ea_guid = x.client
and c.ea_guid = x.client
and c.start_object_id = s.object_id
and c.end_object_id = d.object_id
ORDER BY 3,4
";
// Run SQL with macro replacement
Model.SqlRun(sql, "");
break;
case EA.ObjectType.otConnector:
sql = @"
select o.ea_guid AS CLASSGUID, o.object_type AS CLASSTYPE, o.name As [Element], o.object_type As [Type]
from t_object o
where o.object_id in ( #ConveyedItemIDS# )
ORDER BY 3
";
// Run SQL with macro replacement
Model.SqlRun(sql, "");
break;
default:
MessageBox.Show(@"Select Connector or Element", @"No Element or Connector Selected!!!");
break;
}
}