From my Inside book (once provided by Helmut Ortmann):
SELECT DISTINCT o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE,
o.name As Item, o.Object_Type As ItemType,
o.stereotype As 'ItemStereotype', "Connector" As ConnectorType,
c.Name, c.Stereotype
FROM t_object o, t_xref xCon, t_xref xFlow, t_connector c, t_connector flow
WHERE
c.connector_ID = <Search Term> AND c.ea_guid = xCon.Client AND
flow.ea_guid = xFlow.client AND xCon.Behavior = 'abstraction' AND
flow.ea_guid IN (
#DB=SQLSVR#s
substring(x.description,0,39),
substring(xCon.description,39,39),
substring(xCon.description,78,39),
substring(xCon.description,117,39),
substring(xCon.description,156,39),
substring(xCon.description,195,39),
substring(xCon.description,234,39),
substring(xCon.description,273,39),
substring(xCon.description,312,39),
substring(xCon.description,351,39)
#DB=SQLSVR#
#DB=Other#
left(xCon.description,38),
mid(xCon.description,40,38),
mid(xCon.description,79,38),
mid(xCon.description,118,38),
mid(xCon.description,157,38),
mid(xCon.description,196,38),
mid(xCon.description,235,38),
mid(xCon.description,274,38),
mid(xCon.description,313,38),
mid(xCon.description,352,38)
#DB=Other#
) AND o.ea_guid IN (
#DB=SQLSVR#s
substring(x.description,0,39),
substring(xCon.description,39,39),
substring(xCon.description,78,39),
substring(xCon.description,117,39),
substring(xCon.description,156,39),
substring(xCon.description,195,39),
substring(xCon.description,234,39),
substring(xCon.description,273,39),
substring(xCon.description,312,39),
substring(xCon.description,351,39)
#DB=SQLSVR#
#DB=Other#
left(xCon.description,38),
mid(xCon.description,40,38),
mid(xCon.description,79,38),
mid(xCon.description,118,38),
mid(xCon.description,157,38),
mid(xCon.description,196,38),
mid(xCon.description,235,38),
mid(xCon.description,274,38),
mid(xCon.description,313,38),
mid(xCon.description,352,38)
#DB=Other#
)
UNION
SELECT DISTINCT o.ea_guid , o.Object_Type ,
o.name, o.Object_Type, o.stereotype, "Information Flow",
c.Name, c.Stereotype
FROM t_object o, t_xref x, t_connector c
WHERE
x.client = c.ea_guid AND
x.Behavior = 'conveyed' .and
c.connector_ID = <Search Term> .and
o.ea_guid IN (
#DB=SQLSVR#s
substring(x.description,0,39),
substring(xCon.description,39,39),
substring(xCon.description,78,39),
substring(xCon.description,117,39),
substring(xCon.description,156,39),
substring(xCon.description,195,39),
substring(xCon.description,234,39),
substring(xCon.description,273,39),
substring(xCon.description,312,39),
substring(xCon.description,351,39)
#DB=SQLSVR#
#DB=Other#
left(xCon.description,38),
mid(xCon.description,40,38),
mid(xCon.description,79,38),
mid(xCon.description,118,38),
mid(xCon.description,157,38),
mid(xCon.description,196,38),
mid(xCon.description,235,38),
mid(xCon.description,274,38),
mid(xCon.description,313,38),
mid(xCon.description,352,38)
#DB=Other#
)
order by 3,4,5
To create the script follow these steps:
• Open the scripting window via View/Scripting.
• Create a new normal group (left icon) and name it e.g. ‘Searches’.
• Add a new VB script (2nd icon) and name it e.g. ‘Information Flow’.
• Double click the new entry to open the editor.
• Copy/Paste the following script into the editor and save the result (the famous diskette5
symbol).
Now when you select the appropriate connector in a diagram just click the run button (4th icon) to execute the script. This will open the search window with the listed resulting conveyed classes.
option explicit
!INC Local Scripts.EAConstants-VBScript
sub main()
dim selectedConnector as EA.Connector
set selectedConnector = Repository.GetContextObject()
if selectedConnector is nothing OR
selectedConnector.ObjectType <> otConnector then
Session.Prompt "You must select an Information Flow", promptOK
exit sub
end if
dim id
id = CStr(selectedConnector.ConnectorID)
Repository.RunModelSearch "Elements on Flow", id, "", ""
end sub
main()
q.