Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Mr.Scott on September 11, 2014, 04:08:45 am
-
I am creating a custom report and need help identifying the 'association' that realizes (i.e. 'summarizes') the 'information flow'. Does anyone know what table to look in?
Here is what we are doing:
- Create diagram with information flows (ex. CompA:port1 has 'information flow' 1..n to CompB:port2)
- Create diagram using associations (ex. CompA:port1 has an 'association' to CompB:port2; The association realizes 1..N 'information flows'.
- Then creating a custom report to present details out.
Here is the custom query I have thus far:
SELECT c.connector_id
, c.name as informationFlowName
--, (select name from t_object where object_id = c.start_object_id) as source
, (select CONCAT((select name from t_object where Object_ID = o.ParentID),'::',o.name) as FullName from t_object o where o.object_id = c.start_object_id and o.ParentID >0 UNION select o.name as FullName from t_object o where o.object_id = c.start_object_id and o.ParentID = 0 ) as source
, (select CONCAT((select name from t_object where Object_ID = o.ParentID),'::',o.name) as FullName from t_object o where o.object_id = c.end_object_id and o.ParentID >0 UNION select o.name as FullName from t_object o where o.object_id = c.end_object_id and o.ParentID = 0 ) as target
, c.StereoType
, '???' as 'RealizedByAssoc'
FROM t_connector c
WHERE c.connector_id IN (
select connectorId
from t_diagramlinks
where diagramid in (select diagram_id from t_diagram where name = '<Search Term>'))
and len(name) > 0
and connector_type = 'InformationFlow'
order by informationFlowName, source, target
-
Look into t_xref. Apparently there are 2 entries created to describe the flow. Create an empty model with just 2 classes and one information flow realized connection. Then look into t_xref.
q.
-
q - thank you for the tip. that got me pass the Sparxs data model, next step is parsing a sql string.
Here's what I have now - SELECT tx.description
FROM t_xref tx
WHERE tx.Name = 'MOFProps'
AND tx.client IN (##Connectors EA_GUID##)
-- {you can replace ##Connectors EA_GUID##' with the guid of an association}
To generate a meaninful name, the query above needs to be placed in the where clause of something like select cIF.name as 'InfoFlowsRealized'
FROM t_connector cIF
WHERE cIF.ea_guid IN [QUERY_ABOVE]
As the first query returns a comma separated string '{GUID1},{GUID2},{GUID3}' the values need to be split so the second query can match properly. it looks like a function is needed as outlined here - http://sqlperformance.com/2012/07/t-sql-queries/split-strings
-
Just to be sure: you're on track and not really asking here how to stitch that SQL, are you?
q.