Profile picture for user Eva Klein

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.

by ravi kiran
Posted on Tue, 07/19/2011 - 11:59

ok

thnks evakle

0
by ravi kiran
Posted on Wed, 08/17/2011 - 07:28

In reply to by tolpeit

thanks eva this is very helpfule for me thanks so

i created output what were changed model names.

for (var i = 0; i <aModels.length; i++) {       

    var oModel = aModels[i];                    // Current model

    var sModelName = oModel.Name(nLocale);   

    var sModelID = getAttributeValue(oModel, Constants.AT_ID);      // ID of current model  

    var sModelDesc = getAttributeValue(oModel, Constants.AT_DESC);  // Description of current model            // Name of current model  

   

    oOutput.OutputLn("Model: " + sModelName, "Arial", 15, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);      

       

       

 

0
by ravi kiran
Posted on Sat, 08/20/2011 - 06:58

In reply to by tolpeit

Hi eva

Thanks, now it looks much better.

Can you please make sure it is possible to use it on model level as well?  

0
by ravi kiran
Posted on Wed, 07/20/2011 - 11:08

hi evakle i had tried this code
but this code was not working

0
by ravi kiran
Posted on Wed, 07/20/2011 - 11:09

could u tell me how to run

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Wed, 07/20/2011 - 13:23

The report above only works for models that are directly in the group, not for models in subgroups.

If you want the report to work for models in subgroups you will have to replace

var oModels = oSelGroups[i].ModelList()
 with 
var oModels = oSelGroups[i].ModelList(true)
This will set the attribute value also in the models contained in subgroups.  
0
by ravi kiran
Posted on Thu, 07/21/2011 - 09:06

ya ekliv i had run using this code

it exhicuted  but it showed empty page

   

    

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Thu, 07/21/2011 - 11:45

The report can't show you an empty page becaue there is no output.

0
by ravi kiran
Posted on Thu, 07/21/2011 - 12:13

hi elev

i want to know folder structure of  aris using svn

 

0
by ravi kiran
Posted on Thu, 07/21/2011 - 13:48

OK elev  for example  i want to exicute under  1FC

IN MAIN GROUP UNDER

ANOTHER FOLDER IS THERE 

EX: 3I STRUCTURE

UNDER SOME ATTRUBUTES IS THERE  SO

I WANT TO EXHICUTE  EACH AND EVERY ATTRIBUTE .THEN

ALREADY  I DEFINED AND DESCRIPTION: IS NOT APPROVED

SO WHENEVER I START EXHICUTE MY REPORT

 I WANT  OUTPUT IS   FOR EXAMPLE:PHMN ORGANIZATION

                                                                     IS NOT APPROVED

THIS IS MY REQUIREMENT ELEV

HOW TO WRITE  REPORT CODE

 

 

 

 

0
by Sebastian Stein
Posted on Tue, 07/26/2011 - 07:58

Who is elev?

0
by ravi kiran
Posted on Tue, 07/26/2011 - 12:40

hi sebastian stein

that name is evaklein.I already posted my problem.I want that code

I am a new of aris tool

thnks sebastian stein

0
by Sebastian Stein
Posted on Tue, 07/26/2011 - 13:08

Hi Ravi,

Eva is providing tutorials to get started in ARIS coding. However, she won't write reports for you. So it is up to you to start coding and trying to figure out how it works. Besides the many ARIS report and macro tutorials here on ARIS Community, you will find an API documentation directly included in the tool.

0
by Ismael Shameem Etowar
Posted on Tue, 07/26/2011 - 13:49

Hi Everybody,

My apologies to pinpoint the following but I find it quite 'rude' and bad mannered to request for help the way it's done above.

The Officials from ARIS  Community are here to help the BEST they can and are in no way to do the job for us.

Personally I will find it hard to assist anybody requesting for help from me using terms like:

  • "give me immediate response:"
  • "I want that code"

and also write my name the wrong way even though it is clearly displayed.

It's a fact that at some point in time we were all newbies but this did not prevent us from asking politely :)

 

Cheers

 

Shameem

 

 

0
by ravi kiran
Posted on Wed, 08/17/2011 - 07:30

it shows error page

 

 

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Wed, 08/17/2011 - 08:39

Hi ravi,

You get the value of the attributes as follows (see line 5 and 6). I am not sure what you mean by "I created output what were changed model names." 

function ravi(aModels){
    for(var i = 0; i <aModels.length; i++) {       
        var oModel = aModels[i];                  
        var sModelName = oModel.Name(g_nLoc);                                       // Name of current model  
        var sModelID = oModel.Attribute(Constants.AT_ID,g_nLoc).getValue();      // ID of current model  
        var sModelDesc =  oModel.Attribute(Constants.AT_DESC,g_nLoc).getValue();  // Description of current model            
       //.....
}
To get an output file (like an excel sheet) you must define an output object.  How this works is described in the report tutorial "My first ARIS report".   Regards Eva   

 

 

0
by ravi kiran
Posted on Wed, 08/17/2011 - 11:42

 hi eva 

  my  problem is  already changed attribute names

for example one of the attribute name defination is "under review not yet approved"

so i was enhanced other name like as  "not approved"

i have to create output object  recent changed model names  i written

var g_nLoc = Context.getSelectedLanguage();
var oOutput = Context.createOutputObject(); 
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");
     }
    } 

var lastchange = oSelModel.Attribute(Constants.AT_LAST_CHNG_2, g_nLoc).getValue();
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);
       
oOutput.TableRow();  
oOutput.TableCell(sModelName, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);  
oOutput.TableCell("", 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);   
oOutput.TableCell(sModelID, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);  
oOutput.TableCell(sModelDesc, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);       

but it shows error

could u help me

thanks

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Wed, 08/17/2011 - 12:49

 

Sorry, but I still do not understand what your problem is. Can you please send me a step-by-step description of what you want the report to do or of what the report result should look like?   Unfortunately the script you have posted is of no help to me. However, what I can say is that you should define oSelModel.   Thank you!
0
by ravi kiran
Posted on Wed, 08/17/2011 - 13:08

i have to  create a report listing the name of all models that were changed.

thanks eva for your suggessions

  

0
by Roberto Feliciano
Posted on Wed, 08/17/2011 - 17:33

Hi Eva,

I'm new to Aris and while this question don't quite fit on this topic, I will be very grateful if you could give me some advice or guidance on where to find this report (If it's there). 

I would like to run a report in Aris that check the assignments (if any) that all of the objects in a specific model have.

 

Please let me know if you can help me.

 

Thanks in advance.

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Thu, 08/18/2011 - 10:02

Hi Roberto,

welcome to the world of ARIS Scripting...have fun ;-).

The Reports & Macros in ARIS group will help you get a good start. Here you can find tutorials about ARIS scripting and creating reports with the WYSIWYG editor.

Now let's have a look at your report problem. If I understand your problem correctly this code will help you. 

var g_nLoc = Context.getSelectedLanguage();
var models = ArisData.getSelectedModels();
var oOutputFile = Context.createOutputObject();     //Output object

for(var i=0;i<models.length;i++){
    //Output header
    //......

    var oModel = models[i];
    var sModelName = oModel.Name(g_nLoc);      //Name of current model    
        
    var oObjDefs = oModel.ObjDefListFilter();   //Returns a list of all object definitions in the group. 
    
    for (var j = 0; j < oObjDefs.length; j++) {
        var oObjDef = oObjDefs[j];
        var oAssignedModels = oObjDef.AssignedModels(); //Returns the assigned models.       
      
        for (var k = 0; k < oAssignedModels.length; k++) {
            var oAssModel = oAssignedModels[k];
            
            //Output
            //........
        }
    }
    oOutputFile.EndTable("", 100, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
}

oOutputFile.WriteReport();
 

If you have further questions feel free to ask me again.

Regards 

Eva  

0
by ravi kiran
Posted on Thu, 08/18/2011 - 11:44

hi eva what we have to mention in the place of //output header and

//output 

could i mention any model name?

0
by ravi kiran
Posted on Sat, 08/20/2011 - 07:02
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");
      
     }
    } 
   

 

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Mon, 08/22/2011 - 07:52

Please try it this way:

var aModels = ArisData.getSelectedModels(); 

for(var j=0; j&lt;oModels.length; j++){ 
  var oModel = oModels[j];  
  var description = oModel.Attribute(Constants.AT_DESC,g_nLoc); 
  description.setValue("Under review not yet approved"); 
}
0
by Roberto Feliciano
Posted on Mon, 08/22/2011 - 17:19

Thanks a lot Eva!

0
by ravi kiran
Posted on Tue, 08/23/2011 - 06:38

hi eva

how we can add some text in specific location?

could u tell me

thanks

 

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Tue, 08/23/2011 - 08:31

Do you want to output text in a report output or set attribute values for objects in the model?

This is how you can output a model name (if that was your question):

oOutputFile.TableRow();
oOutputFile.TableCell(sModelName, 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        

Please insert this code behind the //output row in line 21.

Regards

Eva

0
by ravi kiran
Posted on Tue, 08/23/2011 - 10:01

thank  u very very much eva

 

0
by ravi kiran
Posted on Tue, 08/23/2011 - 12:32

hi eva

thanks for your suggessions.I am saying very very thanks

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

so I have to disply  that new values  model names.

Could you tell me

thanks

0
by Krish P
Posted on Tue, 12/13/2011 - 14:17

Hi Eva,

 

I was wanting to know if I could apply headers across all models with the above technique.  if yes, could you pls let me know how it is to be done.

Thanks

 

krish

 

0
by Elaine Wrobel
Posted on Fri, 01/20/2012 - 00:04

-----------------------------Update----------------------------------------------------

It started working again as suddenly as it had stopped.

I don't know what the problem was or what that error meant, although I am still interested on what the reason could have been, in case it happens again in the future.

Thanks,

Elaine.

--------------------------------------------------------------------------------------------

Could anyone explain what the error '"ArisData" is not defined' mean?

I have a script that used to work fine, but it suddenly start showing this error. I don't know JavaScript, and I developed the report using exclusively the WYSIWYG tool.

Thanks,

Elaine.

0
by Jack Chung
Posted on Thu, 05/03/2012 - 14:55

Hi Eva,

I am new to ARIS and I am trying to do a report to change the value of the atribute Creator of all models and objects.

Reading this topic I could figure out a little about ARIS Reports, i got part of your code and part of code that I found and made this:

function main()
{
  var boutput = false;   // Variable for title (True = table / False = text).
  var bmodellok = false;   // Variable for checking whether the model is of the correct type.
  var berror = false; 
  
  var sname = new __holder("");   // Variable for the analysis name.
  var sextension = new __holder("");   // Variable for the file extension.


      var oObjDefs = new Array();
    
   
  var ogroups = undefined;   var oattribute = undefined;   var ocurrentmodel = undefined;   var ocurrentobjdef = undefined;   var omodels = undefined;   var oobjects = undefined;   var ogroup = null; 
  var i = undefined;   var j = undefined;   var numberofobjects = 0;
  
 
  var g_nLoc = Context.getSelectedLanguage();
  ogroups = ArisData.getSelectedGroups();
  
  for ( i = 0 ; i < ogroups.length; i++ ){
    ogroup = ogroups[i];
    omodels = ogroup.ModelList();

    for ( j = 0 ; j < omodels.length; j++ ){
      ocurrentmodel = omodels[j];
      var creator = ocurrentmodel.Attribute(Constants.AT_CREATOR,g_nLoc);
      creator.setValue("Value");
    }

    omodels = null;

    oobjects = ogroup.ObjDefList();
    for ( j = 0 ; j < oobjects.length; j++ ){
      ocurrentobjdef = oobjects[j];
      var creator = ocurrentobjdef.Attribute(Constants.AT_CREATOR,g_nLoc);
      creator.setValue("Value");
    }
    oobjects = null;
  }
  
  ogroups = null;
}

main();

 

With this code I can change the value of the group that I ran. But I would like to change the value of the objects in subgroups too and this report can't do that. I don't know what i need to do.

Could you help me please?

Regards,

Jack.

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Thu, 05/03/2012 - 15:10

Hi Jack,

if you want the report to work for models in subgroups you will have to replace

omodels = ogroup.ModelList();
with 
omodels  = ogroup.ModelList(true)
I think this will set the attribute value also in the models contained in subgroups.   I hope this helps you, I have not tested it, but it should work:).. 

Regards

Eva

 

0
by Jack Chung
Posted on Thu, 05/03/2012 - 16:27

Hi Eva,

I had already tried it, but it didn't worked well.

I have the main group which is the group of VAC and I have the subgroups which is the EPCs. I started the report in the group of VAC, the model and objects there had changed the value, it worked well.

I don't know if it is possible, but I would like to change the value of model and objects of all subgroups that I have too, by starting the report in the VAC group.

Maybe I should start this report for every group that I have. What do you think?

Regards,

Jack.

 

---Update---

Hi Eva,

I got what I want reusing one code that I found.

I replaced:

ogroups = ArisData.getSelectedGroups();

For:

ogroups = ArisData.getActiveDatabase().GroupList(ArisData.getSelectedGroups()[0]);

And with:

omodels = ogroup.ModelList(true);

I started the report in the VAC group and all objects and models in the group and subgroups had changed.

Thanks a lot for your help.

Regards,

Jack.

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CP
  • BZ
  • Profile picture for user TEF_Bernd
  • ПЦ
  • CR
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock