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 - Hurra

Pages: 1 2 [3] 4 5 ... 13
31
Uml Process / Can a requirement satisfy a requirement? (SysML)
« on: November 15, 2021, 11:12:41 pm »
Hello!

We have different requirement sources, some of the requirements overlap.

Any model element can satisfy a requirement. Can I therefore make the conclusion that also requirements can satisfy a requirement?

We want to indicate that, if we fulfill requirement A from one source, we also fulfill requirement B and C from other sources because of the overlap.

Or should this be modelled diffently? The copy-relationship? But it's not a copy.

Thank you!

32
Though I don't know SysML in detail I would think so. You always can have different impementation variants in a single system that both fulfil one requirement.

q.

Ok, thank you!

I will go with that  8)

33
Uml Process / Can a requirement be satisfied by several elements? (SysML)
« on: November 13, 2021, 01:42:03 am »
Hello!

We have Services linked to Service Instructions, and the latter contains requirements.

A Service Intruction is linked to 1..* Service(s).

Example:
The Service Instruction Audio and Video Communication is linked to the Service Audio Communication, but also to the Service Video Communication.

I wanted to map Service to requirement with the Satisfy relationship. But I realized that one requirement will then be satisfied by two different elements, i.e the two Services.

Is that ok according to SysML or can a requirement only be satisfied by one element?

My thought process is that when the requirement is to be verified, both services must be implemented correctly, otherwise the requirement is only partially verified? I don't know how that would work.
On the other hand the requirement will be verified through a test case, so in the end it depends on how the test case is specified/constructed. Perhaps one test case for each service, and the requirement is verified only if both test cases passes?

Testing isn't my headache but I wanted to make sure I don't model anything that might create issues in the future.

Thank you for your input!

34
Hello!

I find the Matrix Profile defined for Matrix Specifications to be a bit limiting. For instance, not to be able to use an SQL-search.

I thought, perhaps one can do more stuff to the matrix profile through the tagged value MatrixOptions and the MatrixData. I can't find documentation for this tagged value.

Code: [Select]
<MatrixData>
<Profile linktype="Nesting" source="Requirement" target="Requirement" direction="0" targetpackage="{4FAA179C-A42B-462d-AC5C-33111E7C81C5}" sourcepackage="{F2304CBA-91B1-481c-BF9A-9982BCE20276}" showsourcechildren="1" showtargetchildren="1"/>
</MatrixData>

Could someone link me to some documentation, or tell me how I can change this to my liking? These attributes are kind of self-explanitory, but what other attributes can be used?

Can I somehow change target/sourcepackage to an SQL-search here in the tagged value?

Thank you!

35
Bugs and Issues / Re: Relationship Matrix not showing relationships
« on: October 26, 2021, 05:22:38 pm »
It's almost certainly a bug specific to certain connector types/stereotypes and it has been fixed since EA 14.0.1421. I've tried it in EA 15.2.1559 and EA 16.0.beta1 and it works in both.

Ok, thank you!

36
Bugs and Issues / Relationship Matrix not showing relationships
« on: October 26, 2021, 01:40:07 am »
Hello!

I have a relationship matrix I used to create relationships.

I opened a diagram just to visualize some relationships between elements. The relationships were created.

I went back to the matrix, and was then empty. The relationships are there, both in the diagram and when looking in the traceability window.

I created the relationships again in the relationship matrix, now there were duplications of the relationships.

Then looked at the relationship matrix again - empty.

Why does the relationship matrix not show relationships?

I have checked source and target package, type, link type and direction. Everything seems to be in order.

Anyone else experienced this issue? First time I experience this.

EDIT: I use link type Satisfy, and SysML1.4::satisfy. Other link types seems to work fine.

Sparx EA 14.0.1421, tried to restart EA multiple times.

Cheers!

37
Yes, your SQL fragment doesn't know about the data you are returning in your query, so it can' filter that based on some criteria in the template definition.

If you want to keep the fragment a bit more generic, you could use the version of the package or diagram instead of hardcoding it in the query.

Geert

PS. Not that you cannot use the diagram ID in your query. If you have multiple diagrams in your package you will have issues with this approach

Thank you Geert!

I will keep this approach in mind.

Regarding your PS, as for know I will use my whip to make sure there is only one diagram in the packages these reports will be used on :D

38
Hello!

I have a template with

PACKAGE>
DIAGRAM>


then I have an SQL fragment which finds the diagram objects and order after a tagged value, I have the SQL fragment because of my custom sorting criteria. (Can I do this another way?)

I would also like to add an element filter, for instance if I only want to include a specific element version. I tried

¤ Element filters, on model document
¤ Element filters, on SQL fragment

with no success.

I thought before I try other options on model document, template and SQL fragment, I would ask here.

Or is the only option to actually modify the SQL query to do the filtering of element version? But then I guess I need multiple, practically identical SQL fragments, with the different only being

WHERE element.Version = XXX

in the SQL query.


Thank you for your help!

39
ok..

So adding currentDiagram = Repository.GetCurrentDiagram(); again seems to solve the issue.

But why isn't updates/saves enough? Now I don't know which updates/saves are redundant  ::)

Someone that can explain?

40
Hello!

I have made a script to automate the creation of an Operational-Connectivity diagram, based on an Operational-Process diagram (from the framework UAF).

I execute the script on an Operational-Connectivity diagram.

I find corresponding Operational-Process diagram.

I find OperationalRoles (represented as swimlanes) in the Operational-Process diagram, and add them to the Operational-Connectivity diagram.

I find where OperationalActivityActions cross swimlanes in the Operational-Process diagram, and add corresponding connectors between the OperationalRoles in the Operational-Connecitivity diagram.

What I'm trying to do now, is to hide all other connectors which comes with the elements added in the Operational-Connectivity diagram, to make an easy to view diagram.

Ez pz:
Code: [Select]
for ( var i = 0; i < currentDiagramLinks.Count; i++ )
{
var currentLink as EA.DiagramLink;
currentLink = currentDiagramLinks.GetAt( i );

var actualLink as EA.Connector;
actualLink = Repository.GetConnectorByID( currentLink.ConnectorID );

if ( <MY SHOW CONDITION> )
{
currentLink.IsHidden = true;
}
else
{
currentLink.IsHidden = false;

}

currentLink.Update();
}

This work, but I have to run the script twice.

It's like the script can't keep up with the changes. I have tried to update/save everything I can think of.

currentDiagramLinks.Count is always the same whatever I update/save. Unless I run the script again. Then it works as expected.

Code: [Select]
// Get a reference to the current diagram
var currentDiagram as EA.Diagram;
currentDiagram = Repository.GetCurrentDiagram();
Repository.SaveDiagram(currentDiagram.DiagramID);

// Get diagram links
var currentDiagramLinks as EA.Collection;
currentDiagramLinks = currentDiagram.DiagramLinks;

Any thoughts?

One thing I realized now I haven't tried is to do Repository.GetCurrentDiagram() again, but is that really necessary? I will keep on testing stuff until I get a response!

Cheers!

41
Parent packace = 0 means you have the root in hands.

q.

of course. Maybe add "and package.Parent_ID <> 0" to your query? That way you could still use "0" as the dummy value.

Hmm, or you can try "-1" as dummy. I think that should work as well...

Geert

Yeah, I figured I try that, and it works.

Regarding the problem I had with the recursive function, I removed the last if statement, and in the first if statement I updated the allPackageIds variable. Seems to work fine now.

Code: [Select]
if ( childPackageIDs.length > 0)
{
allPackageIDs = getChildPackageIDs(allPackageIDs, childPackageIDs);
}
return allPackageIDs;

For those interested I added an alternative SQL search which finds all elements in the package diagrams. We have these two alternative queries because how we have modelled. The elements in the package is a subset of the requirements, and the diagram elements is the sum of all requirements.

I don't know if this makes sense without knowing the specifics, but here's the query for finding all elements in the package diagrams:

Code: [Select]
var queryString = "SELECT requirement.ea_guid AS CLASSGUID, requirement.Object_Type AS CLASSTYPE, requirement.Name AS Name, requirement.Version AS Version, reqID.Value AS ReqID, reqText.Notes AS ReqTEXT, package.Name AS Package " +
"FROM t_object AS requirement " +
"INNER JOIN t_diagramobjects AS diagramObjects on requirement.Object_ID = diagramObjects.Object_ID " +
"INNER JOIN t_diagram AS diagram on diagramObjects.Diagram_ID = diagram.Diagram_ID " +
"INNER JOIN t_package AS package ON package.Package_ID = diagram.Package_ID " +
"INNER JOIN t_objectproperties AS reqText on reqText.Object_ID = requirement.Object_ID " +
"INNER JOIN t_objectproperties AS reqID on reqID.Object_ID = requirement.Object_ID " +
"WHERE diagram.Package_ID IN (" + packageIDsQuery.join(",") + ") " +
"AND reqText.Property = 'text' " +
"AND reqID.Property = 'id' " +
"ORDER BY len(reqID.Value), reqID.Value";

Thank you for your help! <3

42
1. You can either build your SQL query string differently if there's only one element in your array, or you can do it this way. But in the latter case I would use "0" as dummy value. "99999" might one day be an actual packageID. "0" will never.

I'm not sure about your other questions. I would have to debug them to really understand the problem.

Geert

Yeah, I had 0 first. But then I found a bunch of child packages. But I don't get how a parent package can have ID 0?

I will try to solve this undefinied issue. Will update if I find the problem.

43
See the function getPackageTreeIDString(package) in this script:https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Framework/Utils/Util.vbs

That basically does the same as #Branch#

Geert

Thank you!

I'm almost there...

I had a slighlty different approach, because at first I didn't quite understand what you did. But I think I ended up with basically the same thing, but more buggy and not fully working  ;D

I initiate the function like this:
Code: [Select]
var allPackages = new Array();
allPackages[0] = thePackage.PackageID;
allPackages = getChildPackageIDs(allPackages, allPackages);
Session.Output("RETURNED: " + allPackages);
var queryString = "SELECT ... IN (" + allPackages.join(", ") + ")

Then my function getChildPackageIDs:

Code: [Select]
function getChildPackageIDs(allPackageIDs /* : Array of PackageIDs */, parentPackageIDs /* : Array of PackageIDs */) //Output: Array of PackageIDs
{
// Array.join doesn't work if array only has one value, how do I improve this temporary solution?
if (parentPackageIDs.length == 1)
{
parentPackageIDs.push("9999999");
}

var sqlQuery = "SELECT package.Package_ID FROM t_package package WHERE package.Parent_ID IN (" + parentPackageIDs.join(", ") + ")";
var queryResult = Repository.SQLQuery(sqlQuery);
var DOMDoc = XMLParseXML(queryResult);
var childPackageIDs = XMLGetNodeTextArray( DOMDoc, "//Row/Package_ID" );

allPackageIDs = allPackageIDs.concat(childPackageIDs);

// Without this the function returns once per iteration and over-writes the recursive allPackageIDs...?
if ( childPackageIDs.length > 0)
{
getChildPackageIDs(allPackageIDs, childPackageIDs)
}
if ( childPackageIDs.length == 0 )
{
Session.Output("RETURN: " + allPackageIDs)
return allPackageIDs;
}
}

Some problems.

1. I can't use Array.join if the array onlye has one value. I tried to have an if-statement in the var sqlQuery, but didn't get it to work, so a temporary solution is to add a 'dummy' PackageID. Any suggestions how I can improve that?

2. Without the if-statements in the end of the function, the returned allPackageIDs wrote over each other, with the final allPackageIDs just containing the top-level childpackages.

3. If I print out the return of the function in the last if-statement, Session.Output("RETURN: " + allPackageIDs), this is the correct array of PackageIDs. However, when I print the returned array after I intiate the function Session.Output("RETURNED: " + allPackages) (first code-box) it returns undefined, and the query obviously doesn't work then.
Edit: found a missing ; on the line allPackages = getChildPackageIDs(allPackages, allPackages), but same issue.

How can it be that the return is correct in the function, but the actually returned array is undefined?

From System Output:
RETURN: 3205, 9999999, 3354, 3355, 3357, 3356   

RETURNED: undefined

Thank you for your excellence guidance  8)

44
Writing your own export can start really simple.

Write and SQL search, and use the standard functions to export the results to CSV (make sure to select all results before exporting)
Since v15 this works reasonably well, even for things like newlines etc...

A step further is to write a script to export stuff to .CSV or Excel.

Here's an example of such a script that exports directly to Excel: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/Project%20A/Reports%20and%20exports/LDM%20complete%20overview.vbs

Another possibility is to use my Excel import/export tool. That lets you write an SQL query to define what you want to export: https://bellekens.com/product/ea-excel-import-export/

Geert

Thank you Geert!

I have started, and got quite a bit finished! But I think I'm stuck right now...

This outputs a simple Excel which works fine:
Code: [Select]
case otPackage :
{

// Code for when a package is selected
var thePackage as EA.Package;
thePackage = Repository.GetTreeSelectedObject();

var packageElements as EA.Collection;
packageElements = thePackage.Elements;

Session.Output("Print excel");
var excelApp = new ActiveXObject("Excel.Application");
var excelSheet = new ActiveXObject("Excel.Sheet");


Session.Output("  Excel reference created");
excelSheet.Application.Visible = false;


// Create headers
var header = new Array();
header = ["Name", "ID", "Text", "Package"];

// Add headers to Excel
for ( i = 0; i < header.length; i++)
{
excelSheet.ActiveSheet.Cells(1, i+1).Value = header[i];
}

// SQL-search to find elements to export
var queryString = "SELECT requirement.ea_guid AS CLASSGUID, requirement.Object_Type AS CLASSTYPE, requirement.Name AS Name, reqID.Value AS ReqID, reqText.Notes AS ReqTEXT, package.Name AS Package FROM t_object AS requirement INNER JOIN t_package AS package ON package.Package_ID = requirement.Package_ID INNER JOIN t_objectproperties AS reqText on reqText.Object_ID = requirement.Object_ID INNER JOIN t_objectproperties AS reqID on reqID.Object_ID = requirement.Object_ID WHERE requirement.Package_ID = 3205 AND reqText.Property = 'text' AND reqID.Property = 'id'";
var queryResult as EA.Collection;
queryResult = Repository.SQLQuery(queryString);
Session.Output(queryResult);
var DOMDoc = XMLParseXML(queryResult);
var elementNames = XMLGetNodeTextArray( DOMDoc, "//Row/Name" );
var reqIDs = XMLGetNodeTextArray( DOMDoc, "//Row/ReqID" );
var reqTEXTs = XMLGetNodeTextArray( DOMDoc, "//Row/ReqTEXT" );
var package = XMLGetNodeTextArray( DOMDoc, "//Row/Package" );

for ( i = 0; i < elementNames.length; i++ )
{
excelSheet.ActiveSheet.Cells(i+2, 1).Value = elementNames[i];
excelSheet.ActiveSheet.Cells(i+2, 2).Value = reqIDs[i];
excelSheet.ActiveSheet.Cells(i+2, 3).Value = reqTEXTs[i];
excelSheet.ActiveSheet.Cells(i+2, 4).Value = package[i];
}

excelSheet.SaveAs("H:\\exportedExcel.xlsx");
excelSheet.Application.Quit();
excelSheet = "";
Session.Output("Print excel done!");

break;
}


As you might have figured out I start the script through the project browser, by right-clicking on a package. My thought was to use #BRANCH# in the SQL-search to also get all the elements in sub-packages. In the model search/find in project window this query is exactly what I'm looking for:

Code: [Select]
SELECT requirement.ea_guid AS CLASSGUID, requirement.Object_Type AS CLASSTYPE, requirement.Name AS Name, reqID.Value AS ReqID, reqText.Notes AS ReqTEXT, package.Name AS Package
FROM t_object AS requirement
INNER JOIN t_package AS package ON package.Package_ID = requirement.Package_ID
INNER JOIN t_objectproperties AS reqText on reqText.Object_ID = requirement.Object_ID
INNER JOIN t_objectproperties AS reqID on reqID.Object_ID = requirement.Object_ID
WHERE requirement.Package_ID IN (#Branch#)
AND reqText.Property = 'text'
AND reqID.Property = 'id'

However, the IN (#Branch#) doesn't seem to work with the Repository.SQLQuery(...).

As for now I have 'hard-coded' in a Package_ID and get all the elements in that specific package. Do you have any suggestion how I could use #Branch#? Am I doing something wrong?

What I'm after is to find all elements (or to be specific requirements) in the package, including all sub/child-packages, all the way down.

I would appreciate a nudge in the right direction!

Thank you!

45
Hi!

If I export our requirements as CSV I can add TagNotes_text to show the tagged value text, which is of type memo, as text.

However, we find the CSV-export a bit limited of fields/values to export. So we use the Office MDG Excel-export. But I can't get the tagged value (memo) to show it's actual value, it always outputs <memo>. I tried all kinds of stuff.

Does anyone know how I can get the actual string to print instead of <memo>?

Can I furhter customize the built-in CSV-export?

Is it about time to start working on our own export solution?

Thanks!

Pages: 1 2 [3] 4 5 ... 13