Skip to content

Instantly share code, notes, and snippets.

/**
*
* jArchi Library to manage Archi visual relationships in views
*
* Author: Xavier Mayeur
* Version: 1.1
* Date: May 2022
*
*
* Remarks: the code has been written to work with GraalVM, not Nashorn framework.
/*
* This script attemps to import a draw.io (aka diagrams.net) diagram into an Archi model by
* empirically mapping the observable attributes of the XML elements exported from draw.io to Archimate
* elements and relationships. Please note that this mapping is fragile, because draw.io doesn't seem
* to generate the XML attributes in a very consistent way; also, we must unfortunately use element color
* as a key differentiator, to compensate for the lack of usable archimate information in the XML file.
* All of this means that minor changes in the draw.io XML format can break the mapping...
* Notes:
* -- To generate the draw.io file, export it as an *uncompressed* XML file.
* -- When running the script, make sure you have set the current model to import it in (e.g. by selecting a view in the model)
@davidsara
davidsara / BatchPropertyUpdate.ajs
Created September 17, 2020 09:47
#jArchi - Batch creating or updating properties.
// Batch creating or updating properties.
//
// (c) 2020 David Sara
var key = window.prompt("Please enter the property key", "");
var value = window.prompt("Please enter the property value", "");
$(selection).each(function (obj) {
obj.prop(key, value);
});