Book a Demo

Author Topic: Document Template with Specific Requirements using SQL query  (Read 3207 times)

skranenburg

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Document Template with Specific Requirements using SQL query
« on: November 20, 2020, 08:18:02 am »
Hi,

I know that there is a way to have only specific requirements populate a generated document with an SQL query, but since I am new to Sparx and SQL, I have having trouble finding the correct way to do it. I have a bunch of blocks with requirements tied to them using the "satifies" connector and need to have sections of a document allocated to specific block's requirements. What would a document template that accomplishes this look like?

Thank you for your help!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document Template with Specific Requirements using SQL query
« Reply #1 on: November 20, 2020, 04:07:59 pm »
You need to create an SQL fragment template and add that tot he element> section of your main template.

In the SQL fragment add code similar to

Code: [Select]
select req.PDATA5 AS RequirementID, req.Name AS Description
from (( t_object req
inner join t_connector uta on uta.End_Object_ID = req.Object_ID)
inner join t_object uc on uc.Object_ID = uta.Start_Object_ID)
where uc.Object_ID = #OBJECTID#
and req.Object_Type = 'Requirement']select req.PDATA5 AS RequirementID, req.Name AS Description
from (( t_object req
inner join t_connector uta on uta.End_Object_ID = req.Object_ID)
inner join t_object uc on uc.Object_ID = uta.Start_Object_ID)
where uc.Object_ID = #OBJECTID#
and req.Object_Type = 'Requirement'

Geert
« Last Edit: December 19, 2020, 09:14:28 am by Geert Bellekens »

skranenburg

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Document Template with Specific Requirements using SQL query
« Reply #2 on: December 19, 2020, 06:44:47 am »
Hi Geert.

Thank you for the quick reply and apologies for the extended delay. I have been thinking of how to readdress this problem and how to organize our model around it. What I need in my report now is a few specific diagrams from different packages, and the details of one block including all the requirements that are connected to it with the satisfies connector. This may be a trivial question, but I have not been able to find the answer to it. How do I make the report only include those specific diagrams and block without including everything else in the packages?

Thanks,
Stefan