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

Pages: [1] 2 3
Thanks for your replies!

I will read up on diferent approaches and choose accordingly.

Regarding not creating an instance of requirements and relate to intepretation. How would I collect the intepretation?

Lets say we are designing IT-system x. We relate to the minimum requirements mentioned earlier, with different levels and therefore know the "sub" or child requirements. However, if I go one step further, and collect related intepretations, we would collect all intepretations, including for other projects.

Im thinking scripting now. Start on IT-system x, the script collect all req and sub-req. Then we collect the intepretations. Then I guess I would need a loop to check if the intepretation is connected to IT-system x? This doesn't seem efficient. I'll go the same path twice..? From IT-syst to intepretation and then back.

Well, the thing is that we have a document defining "minimum" requirements in certain areas like functional security requirements. These will ALWAYS apply no matter project, but varies with the mentioned levels.

Therefore we would save a lot of time building up this requirement library and always reuse requirements. Of course each project will have project specific requirements but the minimum requirements should come from the requirements library.

And also, this is how the guideline/policy is structured, perhaps I don't have to follow the structure when I model it. But I would like to have a re-usable requirement library which takes account for chosen level.

Automation Interface, Add-Ins and Tools / Script to fetch requirement?
« on: January 29, 2018, 07:25:20 pm »

This is more of a method question, perhaps the thread should be moved.

I have high level requirements, or capabilities, which is related to requirements. Depending of requirement level, 1, 2 or 3, the requirement have different requirement components.


High-level/capability: The application should have authorization control

Requirement: User should have an unique identity
Req component (depending on level): Everyone should have unique identity, an identity may not be re-used

Depending on how this requirement is leveled, different req components apply. Let's say level 1 corresponds to "Everyone should have unique identity" and level 2 is both of the req components.

Each high-level req/cap has several req, each req has several req comp.

My question is about the best approach to model this.

Should each of the requirement levels be an object? I.e. "User should have an unique identity LEVEL 1", "User should have an unique identity LEVEL 2", etc. Then it is easy to just collect corresponding req comp.

Or create instance of "User should have an unique identity" and set a tagged value of the level? But then I need a script or something to collect the correct req comp since the req comp depends on the chosen level of the req.

I would also like to for each req comp, relate it to an interpretation. So I guess all the req comp's needs to be instances and related an interpretation element, otherwise we can't know how the req comp was interpretated for a speficic project.

How do you see this? Model with elements and script, or instances? Would love some input!


If I use the same template directly on an element (without document script) it works like a charm.

With document script, nothing in child elements.

Bug or do I have the wrong approach?


I use a document script to send elements to the document generator. In my template I have Child Elements ticked.

However no child elements are reported. I tried to send the child elements to the report through the document script as well but it just report it as regular elements, not as child elements to the element in focus.

Any idea what's going on?


I think I solved this... almost.

I connected the Document Artifact to the package. With some document scripts I look for the connectors of the package and find the Document Artifact, and send it to RTF through the docGenerator. However, I think my Document Artifact is too big?

I found this thread:

how to increase script fragment size?

It's and old thread.. Is there a fix for this?

Thank you for all the help!

 I have another question regarding using a generated report as attachment or appendix in another report. I have created another thread for this, feel free to have a look!

Thanks again!

New thread


I have generated a report which traces to a document artifact.

Can I use this document artifact as a appendix in another generated report? Can I somehow make this document artifact a linked document to a package? That would make it really easy.

Thank you!

From DBError.txt:
Code: [Select]
2017-10-30 09:23:22
Microsoft OLE DB Provider for SQL Server [-2147217900]

Invalid column name 'undefined'.

SELECT o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name AS Name, d.Name AS Diagram, d.Diagram_ID AS DiagramID
FROM t_object o
INNER JOIN t_diagramobjects do ON do.Object_ID = o.Object_ID
INNER JOIN t_diagram d ON d.Diagram_ID = do.Diagram_ID
WHERE o.Object_ID = undefined
ORDER BY Diagram

It seems that objectID = undefined. Although, as I mentioned earlier it seems to run the script twice. Once with objectID = undefined and once with correct objectID, since I get the correct report output.

I have no idea how to backtrack this error. Is it in a script, function, template or fragment? :o

Thanks for your help!

The error is a database error, not an XmlDom error, so it should be something on the database side.

EA does some pre-processing with the SQL's we send trough, so it might be related to that. I would really look into the dbError.txt and what you can see on the profiler.

Might not be related, but if you are only interested in the DiagramID, why are you returning all those other fields in your query?


Thank you Geert.

I can't access %appdata%, I don't have Sparx Systems folder locally. I will contact the IT-dep.

I just wanted to see what objects I get out, and I know that with the names not the IDs. I can remove them, do you think it will make a difference though?

Look into %appdata%\Sparx Systems\DBerror.txt or turn on the profiler on your SQL server.

That should given you some more info on the error you are getting. It will probably be something other then this actual query.


I isolated the problem to the function where I call the SQL-query and I think I know the problem.

I tried to print the result from the query and actually got two outputs:

Code: [Select]
Script Trace - <?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">

Code: [Select]
Script Trace - <?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
<Dataset_0><Data><Row><CLASSGUID>{xx}</CLASSGUID><CLASSTYPE>type</CLASSTYPE><Name>name</Name><Diagram>diagram name</Diagram><DiagramID>xx</DiagramID></Row></Data></Dataset_0></EADATA>
My guesss is that the first part yields the error since "//Row/DiagramID" can't be found.

Any thoughts about this?

I did not have this kind of output before though..? Don't know what might of happened.

Code: [Select]
!INC Local Scripts.EAConstants-JScript
!INC EAScriptLib.JScript-XML

function getDiagramOccurences( objectID /* : ElementID */ ) // Output: Array
var SQLresult = Repository.SQLQuery("SELECT o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name AS Name, d.Name AS Diagram, d.Diagram_ID AS DiagramID FROM t_object o INNER JOIN t_diagramobjects do ON do.Object_ID = o.Object_ID INNER JOIN t_diagram d ON d.Diagram_ID = do.Diagram_ID WHERE o.Object_ID = " + objectID + " ORDER BY Diagram");

var DOMDoc = XMLParseXML(SQLresult);
var DiagramIDs = XMLGetNodeTextArray( DOMDoc, "//Row/DiagramID" );

return DiagramIDs;

I would write it like this:
Code: [Select]
"SELECT o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name AS Name, d.Name AS Diagram, d.Diagram_ID AS DiagramID
FROM t_object o
INNER JOIN t_diagramobjects do ON do.Object_ID = o.Object_ID
INNER JOIN t_diagram d ON d.Diagram_ID = do.Diagram_ID
WHERE o.Object_ID ="  + ObjectID +
ORDER BY Diagram"

I've never had the error you mentioned, maybe the above version doesn't have the issue.


Thank you for your input! Your query works good, although I get a similar error:

The generated report still looks good!

I have managed to select diagrams with SQL query, collect the diagramIDs, select diagrams of interest with IF, send it to template with document script.

It works fine, I generate the report I want but I get this strange error code.

My SQL query is:

Code: [Select]
"SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name AS Name, t_diagram.Name AS Diagram, t_diagram.Diagram_ID AS DiagramID

FROM t_object, t_diagram, t_diagramobjects

WHERE t_object.Object_ID LIKE " + objectID + " AND t_diagramobjects.Object_ID = t_object.Object_ID AND t_diagramobjects.Diagram_ID = t_diagram.Diagram_ID

ORDER BY t_diagram.Name"

I get the correct result, but that annoying error message.

Anyone know why?

Thank you for your help!

I did as Uffe said; SQL Query and matching the ID's.

I now get my data as following rows:
<Row><CLASSGUID>{xx}</CLASSGUID><CLASSTYPE>Type</CLASSTYPE><Name>Element name</Name><Diagram>Diagram name</Diagram><DiagramID>xx</DiagramID></Row>

My first problem is to parse this data from the XML-format.

I tried to use JScript-XML and the function XMLGetNodeText/XMLGetNodeTextArray with no success.

Also I do not know which of the following solutions are best.

I want to be able to chose which diagrams to include in the report. I believe it is easiest to choose diagram based on their names since we have an abbreviation in the end of the diagram names. However, when sending the diagram to the report I am more interested in the DiagramID.

Should I create a new object? and .id? Should I have two arrays? One with string one with int? How would you do this?

I appreciate all your help!

I manage to fetch the first entry of DiagramID through

   var DOMDoc = XMLParseXML(SQLresult);
   var DiagramIDs = XMLGetNodeText( DOMDoc, "EADATA/Dataset_0/Data/Row/DiagramID" );

However, I (almost) always has several rows. I can't get XMLGetNodeTextArray to work. Or should I somehow loop XMLGetNodeText?

Dunno why I didn't get this to work before but

   var DOMDoc = XMLParseXML(SQLresult);
   var DiagramIDs = XMLGetNodeTextArray( DOMDoc, "//Row/DiagramID" );

works fine!

I also realized the problem Bellekens pointed out; With regular script or SQL fragment you can't output diagram images.

But if I set this up as Document Script I can choose what to send to the built in section editor?

I know I can use the documentation section

Package: Element: Usage: Diagram

but I can't exclude diagrams from the section. Or can I?

Pages: [1] 2 3