Today, I want to show you how easy it is to set a value for ARIS models using a small ARIS Report. The report selects groups and their models and places the new value into every model attribute of the “Description/Definition” type.

First, we need to know which groups are selected. This is done as follows:

var oSelGroups = ArisData.getSelectedGroups();

To get all models which are in the selected groups use this method:

var oModels = oSelGroups[i].ModelList();

Select the attribute to which you want to assign the new value:

 var description = oModel.Attribute(Constants.AT_DESC,g_nLoc);

With the method „setValue()“ you can place the new value in the attribute:

description.setValue("Under review – not yet approved");

Now you have set the value “under review – not yet approved” for the attribute "Description/Definition" of all models of the selected groups.

The complete script code is shown below:

var g_nLoc = Context.getSelectedLanguage();
var oSelGroups = ArisData.getSelectedGroups();

for(var i=0; i<oSelGroups.length; i++){
    var oModels = oSelGroups[i].ModelList();
    for(var j=0; j<oModels.length; j++){
       var oModel = oModels[j];
       var description = oModel.Attribute(Constants.AT_DESC,g_nLoc);
       description.setValue("Under review – not yet approved");
    }
} 

If you start the report and the models are open please refresh them to see the new value of the "Description/Definition"attribute. 

Note: Make sure to join the Reports & Macros group. You will find additional tutorials and a list of free ARIS reports and macros.

 or register to reply.

Notify Moderator