Book a Demo

Author Topic: Query all requirements from component  (Read 14618 times)

RonnyPutz

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Query all requirements from component
« on: July 29, 2019, 07:47:44 pm »
Hi

I am trying to figure out a way how I can extract requirements from all components in a component diagram into some kind of legend.
Means in the dedicated component I want to configure their requirements/responsibilities.

At the bottom of the diagram i want to have some kind of legend which gets the requirements automatically from the components.
I a format like:

Component_1: Requirement_1
                      Requirement_2
Component_2: Requirement_3
                      Requirement_4





qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Query all requirements from component
« Reply #1 on: July 29, 2019, 08:25:57 pm »
You would need to script that. Not too difficult, but also nothing done in 5 minutes. Take a look at the traceability window. That works dynamically, but can't be used for your legend.

q.

RonnyPutz

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Query all requirements from component
« Reply #2 on: July 29, 2019, 08:52:41 pm »
Thanks for the answer @qwerty.
Do you have any tutorial etc.. you could share with me regarding this topic?
I am completely new to scripting in EA.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Query all requirements from component
« Reply #3 on: July 29, 2019, 08:57:23 pm »
Usually I don't make explicit ads for my Scripting book (except for the logos below my posts). But except from that there are a couple of example scripts coming with EA. I'd guess going that way would be a bit more tough (since I went this path a long time ago). Anyhow, there are a lot of nice guys here that can give a tip when you're stuck with anything. Sometimes you even get complete scripts posted here...

q.

RonnyPutz

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Query all requirements from component
« Reply #4 on: July 29, 2019, 09:39:59 pm »
Figured something out like:

select t_object.Name, t_objectrequires.Requirement
from  t_diagram,
      t_diagramobjects,
     t_object,
     t_objectrequires
where t_diagram.Name = 'Building BLock View'
and t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID
and t_diagramobjects.Object_ID = t_object.Object_ID
and t_object.Object_Type = 'Component'
and t_object.Object_ID = t_objectrequires.Object_ID

But whats the best way to represent this in the diagram? I used now a Model View - is there a better way?



qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Query all requirements from component
« Reply #5 on: July 29, 2019, 10:09:24 pm »
You need to join t_object and t_connector where you have t_object.object_type = "Requirement" as one and = "Component" on the other hand. Now t_connector.Start_Object_ID and .End_Object_ID connecting both via their Object_ID. Depending on the direction of your connectors you might need to either swap start/end or respect both (if you did not care).

The diagram objects from the diagram can be retrieved via the t_diagramobjects.object_id where Diagram_Id is that of the diagram in question.

Anyhow, I would not use the DB directly here but rather the API since you need to create diagram elements for your legend. And without API you should already be an absolute pro user. I wouldn't do that usually.

q.
« Last Edit: July 29, 2019, 10:13:22 pm by qwerty »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Query all requirements from component
« Reply #6 on: July 29, 2019, 10:54:45 pm »
Anyhow, I would not use the DB directly here but rather the API since you need to create diagram elements for your legend. And without API you should already be an absolute pro user. I wouldn't do that usually.
He could put that SQL, with your changes, in a Model View and add it to the diagram.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Query all requirements from component
« Reply #7 on: July 29, 2019, 10:57:05 pm »
Yes, there are so many gimmicks in EA that you get into trouble finding the useful ones ;-)

q.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Query all requirements from component
« Reply #8 on: July 29, 2019, 10:58:26 pm »
Yes, there are so many gimmicks in EA that you get into trouble finding the useful ones ;-)

q.
Indeed ;-)