Author Topic: Query to get Assoc Realizing an InfoFlow?  (Read 4895 times)

Mr.Scott

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Query to get Assoc Realizing an InfoFlow?
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Query to get Assoc Realizing an InfoFlow?
« Reply #1 on: September 11, 2014, 06:07:32 am »
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.

Mr.Scott

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Query to get Assoc Realizing an InfoFlow?
« Reply #2 on: October 10, 2014, 05:46:45 am »
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 -
Code: [Select]
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
Code: [Select]
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
« Last Edit: October 10, 2014, 05:47:34 am by slochmann »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Query to get Assoc Realizing an InfoFlow?
« Reply #3 on: October 10, 2014, 05:51:37 am »
Just to be sure: you're on track and not really asking here how to stitch that SQL, are you?

q.