'Expire' Assets via jArchi

Started by Alberto, June 20, 2019, 20:10:23 PM

Previous topic - Next topic

Alberto

Hi folks, I need some jArchi help.

How can I run a script through a set of views that have a particular property? And is it possible to trigger this script (and finish) from the command line before generating an HTML report?

Setting:  I have a GIT model which gets published to HTML on a regular basis via CLI.  There are elements that have a 'last updated' date.  I want to modify these elements in Views that have been 'finalized and published' to change their appearance to a yellow/red outline if they are old (90 days) or too old (180 days) since 'last updated'.  I have the script to change the visual appearance (basically a modification of heat map script) but I don't know how to have it run on all views that have the 'finalized and published' property, and that the script runs (and finishes) before it gets exported into the HTML report.


Phil Beauvoir

Are you able to query the properties in a View to find the property and its value?

Something like:

$("view").each(function(v) {
    var val = v.prop("yourKey");
    if(val == "some value") {
        // Do something
    }
});
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Jean-Baptiste Sarrodie

Hi,

There is another option: you can filter using a function:

$("view").filter(function(v) {
    return  v.prop("yourKey") == "some value"
}).each(function(v) {
    // Do something
});
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.