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 ... 5
General Board / Re: Element name on default iamge
« on: March 16, 2018, 11:35:01 pm »
Thank you qwerty!

I tried to return to original format, but the element looks strange.

I originated from an ArchiMate BusinessProcess default appearance. Now I have the stereotype on the element, and what it looks like, a function symbol above the process symbol.

General Board / Re: HTML report for large diagrams
« on: March 16, 2018, 09:07:48 pm »
First thought: why is the diagram that big? Can't you chop it off in several smaller diagrams?

General Board / Element name on default iamge
« on: March 16, 2018, 07:09:04 pm »

I was requested to use an image as background image for a certain type of element. We have not made a custom MDG and can therefore (?) not add a background through shape script. I added the image by right clicking: Appearance: Set Default Image.

The problem is that I now only can place the name under the element, or hide it. Can I somehow still have the name in the same place in the element, just on top of the background image?

I tried to do some googling but didn't find anything.

I guess the problem also is that this has to be done to all element "instances" of this type. I guess I might be able to script it..

I know I have played around with editing shape scripts through: UML Types, but I cant find any elements from ArchiMate there? I do see two ArchiMate relations: ArchiMate3::ArchiMate_Association and ArchiMate3::ArchiMate_Composition, but no elements.

Thank you!

No, mainly because there's no generally agreed on definition of "real" I guess.


There is no spoon.

use "left join" instead of "inner join"


Thanks for your fast reply Geert!

I really need to step up my SQL game.. hehe ::)

Hello again!

I added
Code: [Select]
inner join t_objectresource objr on o.Object_ID = objr.Object_ID

to fetch start and end date. It works fine but:

if the element have no resource allocation assigned the row comes empty.

Column 1: Name of related element
Column 2: Start date of column 1 element
Column 3: End date of column 1 element

So if column 1 element have no start/end date, there is no row. Can I somehow always show column 1, and leave column 2 and 3 blank if there is no data? Or do I have to do this with scripting?


Thank you Geert and Uffe!

The problem was that we had a <Diagram Notes> in the diagram. I removed it and ticked "Show Diagram Details" instead, works like a charm again!

I guess there is no built-in solution to only get "real" elements. I have to to a for loop to check type/sub-type?

Code: [Select]
Script Trace - CWIX 2017 has 6 childs
Script Trace - Element: CIWX 2017 IPC, stereotyp: ArchiMate_BusinessCollaboration
Script Trace - Element: CWIX 2017 ESC, stereotyp: ArchiMate_BusinessCollaboration
Script Trace - Element: CWIX 2017 EXE, stereotyp: ArchiMate_BusinessCollaboration
Script Trace - Element: CWIX 2017 FCC, stereotyp: ArchiMate_BusinessCollaboration
Script Trace - Element: CWIX 2017 MPC, stereotyp: ArchiMate_BusinessCollaboration
Script Trace - Element: , stereotyp:

Where does the extra empty element(?) come from??

Notice that this is the only element with this problem. Other elements with child elements and diagrams documents fine.

When I change location of the diagram, i.e. no child diagrams, it runs fine. But other elements with child diagram runs fine as well...

childElems has length 6 although there are only 5 child elements, and 1 child diagram.

Automation Interface, Add-Ins and Tools / EA Element class .Elements
« on: March 08, 2018, 02:00:57 am »

I am building a rather complex document spanning down four levels and collecting various neighbouring elements.

I have run into a problem, which I first thought might be a bug, but probably is some error in the code.

I start the documentation with a diagram with elements. For each element I get child elements with the built in sections: package>element>child elements>, and then continue with a custom script.

Quote from: enterprise architect user guide: EA Element Class


Notes: Read only

Returns a collection of child elements (sub-elements) attached to this element as seen in the tree view.

Collection Class

I had no problem continuing the document documenting relevant neighbours and further child elements. However, we added a child diagram which caused problems and I don't understand why. According to the documentation elem.Elements should only collect child elements, not all childs like child diagrams.

The strange thing also is that some elements which have child diagrams have correct documentation, but one element with child diagram only generates correctly if the child diagram is removed.

Snippet of the code which cause error SOMETIMES when there is a child diagram:
Code: [Select]
element = Repository.GetElementByID( objectID );
childElems = element.Elements;
for ( i = 0; i < childElems.Count; i++ )
currentElement = childElems.GetAt( i );
relatedRoles = getNeighbour( currentElement.ElementID, "stereotype", "ArchiMate_BusinessRole" );
if ( relatedRoles.length == 0 )

I think the problem is that childElems sometimes include a child diagram. Is that even possible??

Any help where to start debugging is appreciated! Perhaps it is enough to add
Code: [Select]
if ( childElems.Count == 0 )
? But I doubt that is the problem since there are child elements..

Thanks Geert, I implemented the union!

I have another question. It is easy to add a column with ParentID, by adding o.ParentID as Parent. However, I would like to have the name of the parent in the column. Is there a way to do this? I tried o.ParentID.Name but I guessed before I tried it it wouldn't work  8)

I guess it will be similar to your SQL searches here: ?


inner join t_object o2 on o.ParentID = o2.Object_ID

Works fine!

maybe I'm getting a hang of this :D

Thanks Geert!

Thanks for your time Geert.

The output of your latest search only gives me the element connected to the 'myStereotype' element. I want to go the other way around. The element list should be a list of 'myStereotype', which all of these elements are related to the known start element.

I will start from scratch, to understand what I'm doing.

Code: [Select]
select o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE, o.Name, o.Note AS [Notes] --choose columns to show from t_object
from t_object o --table to show
where o.Stereotype = 'myStereotype' --filter out all other stereotypes
The result is a list of all elements in the model with stereotype 'myStereotype'. Now I want to remove some results, to only show the 'myStereotype' connected to the element with objectID X.

Code: [Select]
select o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE, o.Name, o.Note AS [Notes] --choose columns to show from t_object
from t_object o --table to show
inner join t_connector c on c.Start_Object_ID = X --only show rows which match, this doesn't seem to work?
where o.Stereotype = 'myStereotype' --filter out all other stereotypes

This gives me, for what I can see, all the elements in the model which has stereotype 'myStereotype'. And also, what I don't quite understand, the elements are shown several times? So this search actually gives me more results than the previous one, how is that possible?
 Not what I'm looking for.

Quote from:
The INNER JOIN keyword selects records that have matching values in both tables.

A picture says more than a thousand words:

I have the starting element object ID x. I want the element list from the query only to show the 'myStereotypes', related to my starting node.

I don't need a working SQL query, since I need to know these kind of stuff. I really want to understand this better.

Thanks for any input. I hope I'm not confusing  ::)

Actually just typing this together made me solve this, I think. This seems to give me what I'm looking for:

Code: [Select]
select o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE, o.Name, o.Note AS [Notes]
from t_object o
inner join t_connector c on c.End_Object_ID = o.Object_ID
where o.Stereotype = 'myStereotype' and c.Start_Object_ID = x

I've tried your SQL search Geert, and I think it is not quite what I'm after.

Suppose I have a known element. From this element I want all neighbours of a certain stereotype.

I have an element with a known objectID X. From objectID X I want all related elements with stereotype Y.

The resulting element set should be a list of elements of stereotype Y, all with a relation to element X.

Perhaps this is what your query does, but I think I get an element set of 'all elements which have a relation to myStereotype'.

Thanks Geert!

Do you know anything about the sorting method in JScript?

I have tried both with an array with strings: str = ['a', 'b', ...] and with elements: ele = [ele1, ele2, ... ]

I've tried str.sort() and ele.sort(), ele.Name.sort(), the script always stops after I try to sort the array.

Do I use the sorting function wrong or is it not implemented in EA or something like that..?



I'm creating some documentation and usually find elements via scripting, not SQL, which I know, is not the best idea. I've run into some problems sorting an array in JScript, I don't know what really..

Therefore I thought I might try to create a SQL query instead and of course ran in to problems due to my lack of experience..

I want a search where I collect all neighours of a certain stereotype.

My first thought was some kind of JOIN of t_object.stereotype = #<Search Term># and t_connector.End(or Start)_ObjectID=#OBJECTID#. I will have the ObjectID through the script. I'm guessing I somehow have to use xref also?

SELECT obj.ea_guid AS CLASSGUID, obj.Object_Type AS CLASSTYPE, obj.Name AS Name, obj.Note as Description
FROM t_object obj JOIN t_connector con..?
WHERE obj.Stereotype LIKE '#WC#<Search Term>#WC#' AND..?

All help appreciated!

Pages: [1] 2 3 ... 5