Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - max

Pages: [1]
1
Hi, I am facing the same problem. Could you find a solution?

2
Thank you very much for your quick answers and the suggestions, which I will try.

3
I am trying to get the entire backward path from an arbitrary lifeline to the starting lifeline in the sequence diagram.
As seen in the image, I want to get the path from the Element bc: Boom Controller to the Driver backward using the connectors: 1.0 readCard <-- 1.1 checkAccessRight <--1.4 openBoom() .



The following SQL query is the one I have written so far:

Code: [Select]
SELECT con.Start_Object_ID AS StartObject_ID, o.Name AS StartObj_Name, con.End_Object_ID AS EndObject_ID, ob.Name AS EndObj_Name, con.Name AS ConnectionName, con.PtStartX AS Pt_StartX, con.PtStartY AS Pt_StartY
FROM t_Object o, t_Object ob, t_connector con
WHERE con.Start_Object_ID = o.Object_ID
AND con.End_Object_ID = ob.Object_ID
AND con.End_Object_ID = 17430
AND con.Connector_Type = 'Sequence'
ORDER By con.PtStartX, con.PtStartY

With this query I can unfortunately not get the exact backward path, but only all connectors that lead to a certain element with the entered Object_ID.

Could someone please give me an idea how this can be solved with SQL?
Many thanks in advance for the suggestions.

4
Try "Heading 1", that should do the trick.

5
Yes, you're right. I think this is the solution I was looking for. Thanks!

6
Great, will look into that. Thanks!

7
Hi,

is it possible to generate a report via script? I would like to be able to initiate a report through a project browser group script.


Regards,

Max

8
Hi all,

I am currently working on generating reports for some packages.

Initial situation: I have a diagram containing one change element, which links to several functional requirements. Some of those requirements contain verfication use cases and/or quality requirements. I want to create a document report which contains the diagram as image and all of its elements. I do this by selecting under the document generation options to add each contained element in documentation.

Problem: I want it to be clearly recognizable which verfication use case/quality requirement is contained by the requirement. I achieved this by enabling the child elements in my document template, all the elements were sorted hierarchical in chapters and subchapters. The only issue is, that the child elements are listed twice in the document. One time as the child element and then additionally as an element of the diagram. Is there a possibility to surpress this?

E.g.

2.1.1 A - «Functional»
      2.1.1.1 B - «Quality»
      2.1.1.2 C - «Verification»
2.1.2 B - «Quality»
2.1.3 C - «Verification»

Regards,

Max



9
Hi,

In a tool like SQL Server management Studio, open a connection to your Sparx DB with an account that has permission to create views. Then wrap your CTE in a view, ie:

CREATE VIEW ChildrenAndTheirParents AS
WITH ChildrenAndTheirParents (child_ID, parent_ID, depth) AS
(SELECT t_connector.Start_Object_ID, t_connector.End_Object_ID, 0
FROM t_connector INNER JOIN t_Object
ON t_connector.Start_Object_ID = t_Object.Object_ID
AND t_Object.Object_ID = xxx
AND con.Connector_Type = 'Dependency'
UNION ALL
SELECT t_connector.Start_Object_ID, t_connector.End_Object_ID, ChildrenAndTheirParents.depth+1
FROM ChildrenAndTheirParents INNER JOIN t_connector
ON ChildrenAndTheirParents.child_ID = t_connector.End_Object_ID
INNER JOIN t_Object
ON ChildrenAndTheirParents.parent_ID = t_Object.Object_ID)
SELECT * FROM ChildrenAndTheirParents

Then in Sparx just SELECT * FROM ChildrenAndTheirParents

Regards,

Jon.

Hi Jon,

will look into that, thanks!

10
I don't know a solution, but from experience, there usually is a workaround for it.
The most common one is to find how deep your hierarchy goes, and then add a few to that. then do as many regular joins as that.

I've done that quite a few times. It's not pretty, but it works.

Geert

Yes, I already wrote a script which uses a similar method. Basically it's just a loop, which concatenates sql query phrases with a lot of joins as a string.  It's working, but I have to agree with you, it's really not a neat solution.

11
Thanks! I will give that a try.

12
I would like to get all the subelements of an selected element (i.e. all elements which are connected by the traceability status "needed-by"). In order to achieve this, I planned to use a vb script and the "Repository.SQLQuery()" function. As input for this function I wanted to use a recursive SQL query with CTE (see the snippet below) to get all of the subelements/children and their subelements in every "layer". The problem is, that EA does not support recursive queries with CTE (every query in EA must start with SELECT).

I found a post (https://www.sparxsystems.com/forums/smf/index.php?topic=38324.0) saying that a recursive SQL query is possible in EA by creating a database view. In this view one can use the WITH term and then call it from EA with an SELECT term. I could not reproduce this example, how would that work?

Is there another way to achieve a recursive SQL query in EA?


The recursive SQL query I planned on using:
Code: [Select]
WITH ChildrenAndTheirParents (child_ID, parent_ID, depth) AS
(SELECT t_connector.Start_Object_ID, t_connector.End_Object_ID, 0
FROM t_connector INNER JOIN t_Object
ON t_connector.Start_Object_ID = t_Object.Object_ID
AND t_Object.Object_ID = xxx
AND con.Connector_Type = 'Dependency'
UNION ALL
SELECT t_connector.Start_Object_ID, t_connector.End_Object_ID, ChildrenAndTheirParents.depth+1
FROM ChildrenAndTheirParents INNER JOIN t_connector
ON ChildrenAndTheirParents.child_ID = t_connector.End_Object_ID
INNER JOIN t_Object
ON ChildrenAndTheirParents.parent_ID = t_Object.Object_ID)
SELECT * FROM ChildrenAndTheirParents
ORDER BY depth

13
Hi,

yes I already wrote my own add-in and used your example on PreventDuplicates as an template. It is all working great, I only have the issue about sharing the add-in with all my collegues. When using your toolpack EA-Matic, every user would have to install it on their own (without needing admin privileges), right?

14
Automation Interface, Add-Ins and Tools / Best way of catching events
« on: April 01, 2021, 08:39:20 pm »
I want to create several scripts that get triggered by certain events (EA_OnPostNewElement, EA_OnContextItemChanged etc.). Is it only possible to achieve this by using add-ins? I would prefer to use the scripts, because these I can share them directly with all my collegues. With the add-ins it is really laborious to do that, due to the needed admin privileges and that each user would have to integrate it on its own seperately (as far as I understood the process). I also looked into the workflow scripts and with these it is possible to catch some events (AllowStatusUpdate, PreAllowPhaseUpdate, AllowPhaseUpdate, CanEditStatus...). Is there a documentation on these workflow events?

To summarize it, I basically wanted to create a way to do some background checks which are triggered by events i.e. :
- that the name of a new element is not used already
- that when a status of a requirement is changed all it dependend (needed by) "child" requirements statuses are also changed accordingly

Pages: [1]