jArchi script to set properties?

Started by casacde, July 01, 2019, 07:50:27 AM

Previous topic - Next topic

casacde

I take my first steps with jArchi and wondered if there is an approach or a finished script that allows me to set the properties of several (or all) elements in my model? Can someone give me an indication of how I come to a solution? Many Thanks!

Phil Beauvoir

#1
The general approach with jArchi is to use the various selectors that return a collection of objects and then set or read the properties on those.

For example to set a property on all elements in a model:

$("element").prop("key", "value");

You could also filter the collection further to select only certain types of elements, or those that meet a certain condition.

More examples - https://gist.github.com/search?utf8=%E2%9C%93&q=%23jarchi+extension%3Aajs&ref=searchresults

Reference - https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Collection
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.