Archi Forum

Archi Plug-ins => jArchi => Topic started by: wiebow on February 03, 2023, 21:00:54 PM

Title: element specialization export
Post by: wiebow on February 03, 2023, 21:00:54 PM
Hi there,

I am trying to export to an excel sheet my elements and also their specialization (by modifying the sample export script):

// Loop through all elements and set cells to elememt info
$("element").each(function(e) {
    excel.set(0, 0, current_row, e.name);
    excel.set(0, 1, current_row, e.documentation);
    excel.set(0, 2, current_row, e.type);
    excel.set(0, 3, current_row, e.specialization);

I added that last line to the script, but it does not what I expect: I keep getting "undefined" in my excel sheet. Now, according to the jArchi docs, specialization should work on all objects in a model. Am I missing something?

[edit: I should note that the elements DO HAVE a specialisation set]

Any ideas?
Title: Re: element specialization export
Post by: Phil Beauvoir on February 03, 2023, 21:08:55 PM
Please see https://forum.archimatetool.com/index.php?topic=1277.msg6738#msg6738
Title: Re: element specialization export
Post by: wiebow on February 03, 2023, 21:24:31 PM
Not really what I was looking for.  I can filter out the undefined later on.

My issue is that elements that DO HAVE a specialization set, do not get the specialization name added in the column #3, but "undefined". As specialization is an optional thing in the element properties window, it's like it is not recognized as being set... I don't get it, the docs state that this SHOULD work.
Title: Re: element specialization export
Post by: Phil Beauvoir on February 03, 2023, 21:34:59 PM
I tested it and it's working here. I set a Specialization in the Properties tab and changed the same line as you did.
Title: Re: element specialization export
Post by: wiebow on February 03, 2023, 21:36:50 PM
Could there be an issue with Archi versions? I made a diagram in Archi 5 beta 3, and moved this to Archi 4?

I'll start something from scratch and retry it!

result: does not fix it for me. I'm stumped
Title: Re: element specialization export
Post by: wiebow on February 03, 2023, 21:48:43 PM
What I did in a new model is add an element (in this case a location) and added a specialization for it (datacenter) and then set the specialization requester in the element properties to it.

Then I ran the script. Should work, right?
Title: Re: element specialization export
Post by: wiebow on February 04, 2023, 13:44:00 PM
Of course, it was a version issue with the jArchi plugin! I had the most recent installed but of course in the beta, and not on the 4.xx version of Archi. Tip: never code late in the evening. Thanks for the assistance, Phil!