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.

Topics - RWHurra

Pages: [1]
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!



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

Automation Interface, Add-Ins and Tools / Element Usage list through API
« on: October 04, 2017, 07:46:18 pm »

I am creating some documentation/reports via script fragments. I would like to show specific diagrams. My first idea was to iterate through the element usage list (ctrl+u) and send diagrams to the report based on the name of the diagram.

However I didn't find anything like ctrl+u in the API, and didn't find it googling/searching the forum either. Does anyone know a method to create a collection with the diagrams like ctrl+u?

Is there a better approach to select specific diagrams?

Thank you!


I have a fragment in my document generator which finds element of interest with a SQL query. When I print the element's note the hyperlink is printed as a string instead as a hyperlink:

Code: [Select]
<a href="$element://{3D79297A-4128-4fdd-9070-3BA328E674F0}"><font color="#0000ff"><u>My element of interest</u></font></a>
This is no problem when inserting the note with the pre-built sections. Can I convert this html-string to an actual hyperlink in my documentation?

Thank you!


I have an output to show connections to/from the current selected element as follows:

Code: [Select]
package >
HEADING 1 {Pkg.Name}
element >
HEADING 2 {Element.Name}

connector >
source >
element >
< element
< source
target >
element >
< element
< target
< connector
< element
< package

However, I would like to show it in a table:
Source #1Connection #1Target #1

The problem is though that the information is in different section-contents (or whatever it is called, i.e. connector >, source >). I can't get all the information in the table. Is there a way around this?

Second question:
Is there a way to include the shapescript of elements/stereotypes? I found insert image and similar, but since the shapescript is embedded with the element/stereotype I thought it would be easy to show the image/shapescript. I do not find anything. Someone knows something about this?



Where is my thought process off?

I have an on Diagram-script.

currentDiagram = Repository.GetCurrentDiagram(); (as EA.Diagram)
allObjects = currentDiagram.DiagramObjects; (as EA.Collection)

Code: [Select]
var listOfObjectNames = new Array();
var listOfElementIDs = new Array();
for (var i = 0; i < allObjects.Count; i++)
thisObject = allObjects.GetAt(i);
thisElement = Repository.GetElementByID(thisObject.ElementID);


allElements = Repository.GetElementSet(listOfElementIDs, 1);

for (var j = 0; j < allObjects.Count; j++)
thisObject = thisElement;
// Do stuff
thisObject.left = thisObject.left - 10;

My problem is the Collection.GetByName. At first I tried it on a collection with DiagramObjects, but I found in the documentation that:
GetByName(string Name)
Notes: Gets an item in the current collection by name. Supported for Model, Package, Element, Diagram and element TaggedValue collections.
If the collection does not contain any items (or, for the Tagged Value collection, if the collection contains items but the method cannot locate an object with the specified name) the method returns a null value. For other collections, if the method is unable to find an object with the specified name, it raises an exception.
Name: String

Therefore I created a collection with Elements, through allElements = Repository.GetElementSet(listOfElementIDs, 1);. But I get the same error message. The end of this code snippet is kind of pseudo code.

The main problem is that I can't get Collection.GetByName to work.



I made a small script to export a diagram as PDF. I know there is a setting in Diagram Properties > Diagram > Page Setup > Advanced > Scaled Printing: Scale to 1 Page which I use for larger diagrams.

I did some googling but didn't found any functions for this in the API. Is there? Or how can I change this setting with script, or make this setting default for a model/project?

Thank you!

Automation Interface, Add-Ins and Tools / List Composite Diagrams
« on: June 08, 2017, 11:19:02 pm »

I am interested in adding a diagram as list in another diagram for navigation purposes. The default SQL search string is
Code: [Select]
t_object.ea_guid AS CLASSGUID,
t_object.Object_Type AS CLASSTYPE,

FROM t_object
(t_diagram INNER JOIN t_diagramobjects ON t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID) ON t_object.Object_ID = t_diagramobjects.Object_ID

WHERE t_diagram.ea_guid='{myElementGUID}'

ORDER by t_object.Name

By adding
Code: [Select]
AND NType=8

in the WHERE statement I get a list of all elements in the diagram with composite, or child, diagrams. However, instead of listing the elements I would like to list the diagrams. I have a hard time figuring out the SQL query for this search.

I should find all diagrams which is composite, or child diagrams, to the elements in the current diagram. With JScript and the API I could figure this out, but not with SQL.

Could I get some pointers?

Thank you!


I would like to have the size of a vertical compartment on the left side fixed.

| xxx| ...............|
| xxx| ...............|
| xxx| ...............|
| xxx| ...............|

Extend the width would be:

| xxx| ..............................|
| xxx| ..............................|
| xxx| ..............................|
| xxx| ..............................|

My shape script today has two rectangles with 10% respectively 90%, this will be extended when the width is extended.

I hope you understand and thanks for your help!


I have made a simple JScript to add a stereotype to selected elements in the project browser. The problem is that it only adds stereotypes, not remove current stereotype. The applied stereotypes just keeps piling up. How do I remove applied stereotypes?



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

* Project Browser Script main function
function OnProjectBrowserScript()
  // Show the script output window
Repository.EnsureOutputVisible( "Script" );

     // Get the type of element selected in the Project Browser
     var selElem as EA.Collection;

     var input=DLGInputBox( 'Enter new stereotype', 'Multi-select element update', '');
     selElem = Repository.GetTreeSelectedElements();
     for (i=0; i < selElem.Count; i++) {
var e as EA.Element;
e = selElem.GetAt(i);
e.Stereotype = input;
Session.Output('Element changed: '+e.Name+' changed stereotype to '+e.Stereotype);
Session.Output('All selected elements updated.');


Bugs and Issues / Inherit background color in MDG Technology
« on: October 25, 2016, 01:01:51 am »

I have an MDG technology where I create stereotypes which is a GENERALIZATION of Archimate2::ArchiMate_X and EXTENSION of metaclass x. I want my new stereotypes to inherit properties from Archimate, such as shapes and colors, however the background color will not inherit.


Thank you!

Automation Interface, Add-Ins and Tools / Add in: get stereotype
« on: September 20, 2016, 04:49:10 pm »

A few weeks ago a saw a post on this forum on how it is possible to create a add-in to allow shape scripts such as

Code: [Select]
decoration symbol {
    orientation = "SE";

However, I didn't know anything about creating add-ins and had to read up on that. Now I can't find the post regarding that add-in. I have searched this forum and googled like crazy...

Can someone help me with this topic or refer me to that forum post?

Thank you,


Pages: [1]