Recent posts

#11
General Archi Discussion / Re: Double quotes in import fi...
Last post by Yost67 - February 21, 2024, 16:21:48 PM
I now learned that I got an import message because 1 of my fields included a comma, and as the field was not delimited by quotes, that line suddenly contained more fields than the import function expected...

This problem occurred because the CSV export from both Excel and Numbers creates files with semicolons, and I was searching & replacing those semicolons with commas, and I wasn't aware that some of my fields contained commas already. The underlaying problem is that both Excel and Numbers don't "quote" fields with commas, if they are using semicolons as delimiter.

I found a (weird) way for forcing Numbers to create CSV files with commas as delimiter (and also use quotes around fields that include commas): use MacOS System Preferences to set the number display to US (so to 9,999,999.99). After restarting your Mac, Numbers will have automagically changed the delimiters from semicolons to commas.

Also note: I heard from colleagues that they are using Open Office or Libre Office for creating CSV files, as these product give you full and explicit control over how to format your export files. I did not test this myself.
#12
jArchi / Re: jArchi 1.6
Last post by Phil Beauvoir - February 21, 2024, 11:18:35 AM
Hi, yes I get the same error.

@Jean-Baptiste Sarrodie This is caused by the new property entries to support CommonJS modules. Do you know why?

I opened an issue - https://github.com/archimatetool/archi-scripting-plugin/issues/127
#13
jArchi / Re: jArchi 1.6
Last post by fanievh - February 21, 2024, 10:22:15 AM
Thank you for the new version, @Phil Beauvoir!

I noticed a change and I'm not sure if the problem is on my side.  When running @smileham CSV import script (https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d) which uses Papa Parse, I get this error which I didn't get with jArchi 1.5:

> Import CSV
> Loaded Papa Parse
> Please Wait...
> File Loaded
org.graalvm.polyglot.PolyglotException: ReferenceError: "Papa" is not defined
   at <js>.:program(Import from CSV.ajs:48)
   at <js>.:program(<eval>:1)
   at org.graalvm.polyglot.Context.eval(Context.java:399)
   at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:478)
   at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:446)

Any idea what could be causing this change in behaviour?
#14
General Archi Discussion / Re: Archi file with images
Last post by ievgenii - February 21, 2024, 02:22:14 AM
Quote from: Phil Beauvoir on July 13, 2023, 13:14:42 PMThe non-zip format is used if the .archimate file is in a git repository. This was done to support coArchi 2 (WIP). This is undocumented and unsupported.
Actually, that is good "feature". In some cases having the images unzipped gives more flexibility. For example, similar viewing (or even editing!) the pages/images model tree directly at the GitHub, overview/update of images in local folders might be beneficial.
#15
jArchi / Re: jArchi 1.6
Last post by Phil Beauvoir - February 20, 2024, 16:31:49 PM
Thanks JB, I added your comments to the wiki.
#16
jArchi / Re: jArchi 1.6
Last post by Jean-Baptiste Sarrodie - February 20, 2024, 16:26:57 PM
Hi All,

Some comments on importing Node.js modules into jArchi scripts:
- By "Node.js" modules we mean CommonJS modules. So a modules doesn't have to be specifically written for Node.js: as soon as it respects CommonJS specification, it should be usable.
- Not all modules will work within Archi because Archi doesn't implement core/native/builtin (call them whatever you want) modules. A rule of thumb: the less dependencies a module have, the higher the chance it will be usable.
- Archi doesn't come with npm, so if you want to reuse real Node.js modules, you will have either to install Node.js and npm on your workstation and make sure it downloads modules at the right place. You can also download modules manually (only doable for modules with no, or really few, dependencies)
- The wiki contains an example of a very simple module, I would encourage people to do so for scripts that serve as common libraries.

Regards,

JB
#17
General Archi Discussion / Re: Double quotes in import fi...
Last post by Yost67 - February 20, 2024, 12:04:12 PM
Thanks for the reply. So the lack of quotes is not the reason for the error I'm getting, interesting. I will have to "debug" some more...
#18
jArchi / Re: jArchi 1.6
Last post by Alexis_H - February 20, 2024, 06:57:09 AM
Many Thanks Phil !

Very good enhancements : Node.js support should help a lot to integrate third party JS libs (eg : a unit-testing fwk for QA checks on the model, I was digging in Jasmine code to make it run outside of a browser or Node.js context.. no more headache now).
+ the line-width/color I was missing to port a 'Heatmap' jArchi script.

Alexis.

#19
jArchi / jArchi 1.6
Last post by Phil Beauvoir - February 19, 2024, 11:43:37 AM
Hello jArchi scripters!

jArchi 1.6 is available at the usual outlets.

This version includes support for Node.js modules (thanks to @Jean-Baptiste Sarrodie for that), some fixes and a few new features.

Please note that this version requires Archi 5.2 or later.

Change log - https://github.com/archimatetool/archi-scripting-plugin/wiki/Change-Log

Cheers,

Phil
#20
General Archi Discussion / Re: Double quotes in import fi...
Last post by Phil Beauvoir - February 19, 2024, 11:15:21 AM
Actually, you don't need double quotes for a field except where you use a comma in the text field. The use of double quotes is recommended in the User Guide to be on the safe side.

For example:

ID,Type,Name,Documentation,Specialization
100,ArchimateModel,Archisurance,An example of a fictional Insurance company.,
101,BusinessActor,"Archisurance, Inc.",,
102,BusinessActor,Back Office,,

This is how Excel on Mac will export to CSV.