Skip to content

Instantly share code, notes, and snippets.

@nfigay
nfigay / ArchiRelationshipArrayBuilder.ajs
Last active October 8, 2022 14:41
This #jArchi script aims at create the table of allowed relationships in ArchiMate, as implemented by Archi, as a excel table.
/*
* Archi Relationship Array Builder script
*/
console.log("Archi Relationship Array Builder");
var ArchiMateObjects=["Resource","Capability", "Value_Stream","Course_Of_Action","Business_Actor","Business_Role", "Business_Collaboration", "Business_Interface", "Business_Process", "Business_Function", "Business_Interaction", "Business_Event", "Business_Service", "Business_Object", "Contract", "Representation", "Product", "Application_Component", "Application_Collaboration", "Application_Interface", "Application_Function", "Application_Interaction", "Application_Process", "Application_Event","Application_Service", "Data_Object", "Node", "Device", "System_Software","Technology_Collaboration", "Technology_Interface", "Path","Communication_Network", "Technology_Function", "Technology_Process", "Technology_Interaction", "Technology_Event", "Technology_Service", "Artifact", "Equipment", "Facility", "Distribution_Network", "Material", "Stakeholder", "Driver", "Assessment", "Goal", "Outcome", "Principle", "Requirem
@nfigay
nfigay / ExportToOWL.ajs
Last active May 14, 2024 20:30
This #jArchi script export the content of a selected model as an OWL2 file.
/*
* ArchiMate Model export as OWL2 file
* Author: Nicolas Figay 2021
* Version: 0.1
* This script creates a vis.js graph
*/
console.log("Export to Ontology Web Language");
load(__DIR__ + "lib/archimate.js");
@nfigay
nfigay / ExportToVisJs.ajs
Last active February 22, 2026 13:23
This #jArchi script export the content of a selected Archi diagram on a single HTML page, with side by side the exported image of the diagram, and two interactive #visjs graphs, one as a flat graph, the other using an expendable node for all the composite model element of the graph. It reuses archimate.js, which provides a set of arrays containi…
/*
* View export as Vis.js
* Author: Nicolas Figay 2021
* Version: 0.1
* This script creates a vis.js graph
*/
var ArchiMateRelationArcs =
["arrows:{to: {enabled:false,type:'arrow'},\
from: {enabled:false,type:'arrow'}},\
@trischbeck
trischbeck / colorAssessments.ajs
Created August 11, 2021 13:48
#jarchi Color all assessment elements in the model according to a given property.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: colorAssessments
Purpose: Color all assessment elements in the model according to a given property.
Dependening on this property's value the color is set on a red-yellow-green scale.
default values: property_name = "bewertung"; min_value = -10 (weak); max_value = 10 (strong)
Thomas Rischbeck, rischbeck@itmc.ch, (C) ITMC 2021
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@trischbeck
trischbeck / exportToExcelCSV.ajs
Last active October 8, 2022 14:41
#jarchi Export all elements from the current model (including their properties) to a CSV file which can be opened in Excel.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: exportToExcelCSV
Purpose: Export all elements from the current model (including their properties) to a CSV file which
can be opened in Excel. This also works for special characters and for German locale.
Export uses latin encoding and replaces some characters so that Excel can directly open the CSV
(double-click).
This works in conjunction with smileham's importFromCSV to reimport changes (but doesn't require PapaParse),
see https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d
@FrancoisCoudeville
FrancoisCoudeville / Step by step script examples - v0.1.ajs
Created May 26, 2021 10:48
jArchi Step by step Tutorial Beginner Guide script example creating, updating, navigating, deleting objects, relationship #jArchi
/****************************************
* Step by Step JArchi script examples *
* v0.1 *
* Francois Coudeville *
* May 2021 #jArchi *
* #Beginner #Guide #Tutorial #Example *
****************************************/
//---------
// 1 Utils
@timolaine
timolaine / Insert Labels of Related Elements.ajs
Last active May 14, 2024 20:34
Insert Labels of Related Elements in Archi
@stefjoosten
stefjoosten / Merge all equal name-type elements.ajs
Created December 30, 2020 14:12
This jArchi-script ensures that all elements that share type and name are one and the same element. This will not affect any of your views. Executing this script is idempotent.
/* Merge all equal name-type elements.ajs
* Situation: Archi can make an element show up in different views. The relationships to and from that element in all these views are attached to the same element.
* Problem: If I accidentally make a copy of an element (e.g. by copying a view from one model to another), multiple elements may arise that have the same type and name.
* Such copies do not share relations, which violates an important benefit of Archi.
* Solution: This Archi-script ensures that all elements that share type and name are one and the same element. This will not affect any of your views. Executing this script is idempotent.
* Impact: after running this script
* - you will see that double occurrences in your elements list (in the "Models"-pane of Archi) are gone;
* - the information of all double occurrences has been accumulated in the remaining one without losing any information;
* - you will also see that the properties of the merged elements are all included in the re
@stefjoosten
stefjoosten / Show duplication.ajs
Created December 29, 2020 09:19
This jArchi-script shows which Archi-elements in a model share the same type and name.
/* Show duplication.ajs
* Situation: Archi can make an element show up in different views. The relationships to and from that element in all these views are attached to the same element.
* Problem: If I accidentally make a copy of an element (e.g. by copying a view from one model to another), multiple elements may arise that have the same type and name.
* Such copies do not share relations, which violates an important benefit of Archi.
* Solution: This Archi-script signals the situation, so you can fix it if you want.
* (c) 2020 by Stef Joosten
*/
var debug = true;
debug ? console.show():true;
@nfigay
nfigay / TransversalFolderStructure.ajs
Last active January 21, 2022 16:17
Import of a hierarchy as a transversal folder structure plus Grouping hierarchy
/*
* Creation of Transversal Folder Structure script
* Author: Nicolas Figay 2020
* Version: 0.1
* This #jarchi script - from a text describing a table of content or a hierarchy - creates a folder structure for
* each ArchiMate layer and for views
* In addition, a grouping is created per hierarchy element
*/
console.log("Creation of Transversal Folder Structure script");