Skip to content

Instantly share code, notes, and snippets.

@smileham
smileham / Export to Markdown.ajs
Last active March 6, 2024 15:18
Export an ArchiMate diagram to Markdown format. #jarchi
/*
* Export View to Markdown
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Markdown - https://www.markdownguide.org/
*
* Version 2: Updated to support Diagram Groups
* Version 2.1: Add check for Selected View
* Version 2.2: Change to regex, added date of export
/*
* Change Concept Type
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Updated from original to prompt for types
*
* Version 1: First release
* Version 2: Error handling
*
@smileham
smileham / Export to CSV.ajs
Last active April 24, 2024 16:44
Export to CSV #jarchi
/*
* Export To CSV
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* Requires PapaParse - https://www.papaparse.com/
* Works with Import from CSV script - https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d
*
* Version 1: Export to CSV
* Version 1.1: Avoid duplicate concepts exported from diagram
* Version 1.2: Fix missing properties
@smileham
smileham / Import from CSV.ajs
Last active April 24, 2024 16:43
Import from CSV #jarchi
/*
* Import from CSV
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* Requires PapaParse - https://www.papaparse.com/
* Works with Export to CSV Script - https://gist.github.com/smileham/15c445b17a92bd6f5dc1508e573bcd8a
*
* Version 1: Import from CSV
* Version 1.1: Force character encoding to use UTF-8
* Version 2: Support for Specialization and creates "CSVImport-timestamp" view
@smileham
smileham / Search by Properties.ajs
Last active June 14, 2022 14:04
#jarchi Find all Archimate elements which match the properties of the selected element.
/*
* Search by Properties
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Find all Archimate elements which match the properties of the selected element.
*
*
* Version 1: First release
* Version 2: Added layers to results
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 8 columns, instead of 5. in line 7.
Relationship ID,From Name,From Type,Relationship Type,To Name,To Type,Relationship Name,Relationship Documentation
611228f0-c06c-4ffc-9145-7f7091113cf4,[archi] jArchi Plugin,application-function,influence-relationship,Support Archi on Patreon,requirement,,
b03b0ef5-9085-4204-9cc0-b8456cca1d46,[archi] jArchi Plugin,application-function,Comprises,[archi] Export to CSV,application-function,,
5f24cdf4-66a6-4541-926e-2fcb7a08ce3c,jArchi Plugin <<Software>>,artifact,Realises,[archi] jArchi Plugin,application-function,,
937991e2-2221-4e8a-bf5b-a277d598678d,Documentation <<Folder>>,artifact,Comprises,Export to CSV.csv <<CSV>>,artifact,,
c334768f-c847-45cb-ab95-78c1bccc8966,Documentation <<Folder>>,artifact,Comprises,Export to CSV-relationship.csv <<CSV>>,artifact,,
5d8206f6-8ec3-409a-bf50-6db0e5fa59b7,[archi] Archi 4.3.3,application-component,Assigned to,[archi] jArchi Plugin,application-function,Plugin,
9c3dfe66-0b79-4da8-89d6-82111c8b5a8a,[archi] Archi 4.3.3,application-component,Serves/Used By,Develop Enterprise A
@smileham
smileham / archi-seq.puml
Last active December 4, 2020 16:49
Common include for PlantUML scripts to define ArchiMate concepts
@startuml Common
' PlantUML ArchiMate Sequence Diagram template v5
' Changelog:
' v3 Updated for new PreProcessor
' v4 Function to Procedure
' v5 Added Motivation, migrated to Styles, added Structure type
' Author: Steven Mileham (steven.mileham@gmail.com)
skinparam dpi 150
skinparam useBetaStyle true
<style>
@startuml Archi Usage
!include archi-seq.puml
title Archi Print Usage
' Define Elements
$businessActor("Architect","architect")
$applicationComponent("Archi","archi")
$applicationFunction("Update\nModel","update")
$applicationFunction("Print\nView","print")
$systemSoftware("Windows\nPrint\nService","windowsPrint")
@smileham
smileham / HeatMapByPropertyvalue.ajs
Last active February 17, 2023 02:39
jArchi script to create Heatmap (set Red, Amber or Green background to element) based on the value of a given property. #jarchi
/*
* HeatMap by Property Value
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Version 1: Set colour to red, amber or green based on value of given property.
* Version 2: Pull out all Properties used in Elements in view, present all possible values of that Property to assign RAG colours
* Version 3: Error handling and key generation
* Version 4: Updated for dynamic colour selection and support for more than 3 colours
* Version 5: If there are less than 5 values, buttons are used instead of the menu.
@smileham
smileham / AuditModel.ajs
Last active March 11, 2023 12:20
#jarchi Script to audit an Archi model based on a defined metamodel
/*
* AuditModel
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Version 0.1: Audits all elements in selected view, comparing to a view called "Audit"
* Version 0.2: Bug in "Template" selection - fixed
* Version 0.3: Audits all elements in selected view, allowing a user to select from views in an "Audit" Folder
* Creates the Audit folder and a default Audit view if one is not found.
* Version 0.4: 2023-03-11 - Support for Audit on Documentation/Properties of the View,