Book a Demo

Author Topic: ModelView memo  (Read 3443 times)

dambsst_gmail

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
    • dcgblimited
ModelView memo
« on: August 24, 2017, 06:48:34 pm »
Hello,

Is there a way to reuse a custom search inside a modelview? This way it would be possible to reuse the <Search Term> parameter instead of hardcoding the name or guid inside the sql query.

I was thinking it may already be possible using the tagvalue "memo" of the modelview, but I can't figure it out.

By example, instead of:
Code: [Select]
<modelview>
<source customSQL="SELECT t_object.ea_guid, t_object.Name&#xA;     FROM t_object, t_connector&#xA;     WHERE (t_connector.Start_Object_ID = (SELECT Object_ID FROM t_object WHERE t_object.Name='Owner' AND t_object.Stereotype='ArchiMate_Stakeholder')  &#xA;     AND t_object.Object_ID = t_connector.End_Object_ID) OR (t_connector.End_Object_ID = (SELECT Object_ID FROM t_object WHERE t_object.Name='Developer' AND t_object.Stereotype='ArchiMate_Stakeholder')  &#xA;     AND t_object.Object_ID = t_connector.Start_Object_ID)&#xA; AND t_object.Stereotype='ArchiMate_Driver'&#xA;     AND t_connector.Connector_Type = 'Association'"/>
</modelview>

We could use:
Code: [Select]
<modelview>
<source customSearch="Stakeholder_Drivers_Associations" SearchTerm = 'Owner' />
</modelview>

where "Stakeholder_Drivers_Associations" is a custom search like:
Code: [Select]
SELECT t_object.ea_guid, t_object.Name
     FROM t_object, t_connector
     WHERE (t_connector.Start_Object_ID = (SELECT Object_ID FROM t_object WHERE t_object.Name='<Search Term>' AND t_object.Stereotype='ArchiMate_Stakeholder') 
     AND t_object.Object_ID = t_connector.End_Object_ID) OR (t_connector.End_Object_ID = (SELECT Object_ID FROM t_object WHERE t_object.Name='Developer' AND t_object.Stereotype='ArchiMate_Stakeholder') 
     AND t_object.Object_ID = t_connector.Start_Object_ID)
AND t_object.Stereotype='ArchiMate_Driver'
     AND t_connector.Connector_Type = 'Association'

It would make it faster and there is no need to create a modelview with customSQL for every element of interest (every Stakeholder in this case).

Many Thanks

Damien