Skip to content

Instantly share code, notes, and snippets.

@smileham
smileham / Export to Markdown.ajs
Last active April 25, 2024 14:06
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
@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 / GetInstalledPackages.ajs
Created November 28, 2023 16:06
GetInstalledPackages
/*
* Get Installed Packages via Salesforce CLI
*
* Please ensure you have first authenticated against your Salesforce sandbox and have defined an Alias
* No Warranty is provided for this script.
*
* This script if a Proof of Concept to create Application Components based on Installed Packages in a SF sandbox
*
* Running this script will then:
* * Create new Managed Packages folder
@smileham
smileham / DescribeSObjects.ajs
Last active November 28, 2023 15:58
DescribeSObjects.ajs #jarchi #salesforcecli #salesforce #sfdx
/*
* Describe sObjects in view via Salesforce CLI
*
* Please ensure you have first authenticated against your Salesforce sandbox and have defined an Alias
* No Warranty is provided for this script.
*
* This script if a Proof of Concept to populate the detail of selected sObjects created via the GetSObjects script
*
* Once the model has been populated with Salesforce sObjects, create a new view using the sObjects you
* wish further detail on.
@smileham
smileham / GetSObjects.ajs
Last active November 28, 2023 15:58
GetSObjects.ajs #jarchi #salesforcecli #salesforce #sfdx
/*
* Get sObjects via Salesforce CLI
*
* Please ensure you have first authenticated against your Salesforce sandbox and have defined an Alias
* No Warranty is provided for this script.
*
* Script calls the Salesfoce CLI for a given alias and retrieves all sObject records, these are created
* as "Data Objects", set with a specialization of sObject and stored in a folder.
*
* A second script can then populate the detail of selected sObjects (DescribeSObjects)
/*
* 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 / 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,
@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 / 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