Profile picture for user MWZ

Much content in ARIS is stored in different attributes. Therefore we want to add further column rows which contains values of the attributes “Identifier” and “Description”:

Model name

Object name

Identifier

Description

<Name of model 1>

 

<ID of model 1>

<Desc. of model 1>

 

<Name of object 1>

<ID of object 1>

<Desc. of object 1>

 

<Name of object 2>

<ID of object 2>

<Desc. of object 2>

 

<…>

<…>

<…>

<Name of model 2>

 

<ID of model 2>

<Desc. of model 2>

 

<Name of object 1>

<ID of object 1>

<Desc. of object 1>

 

<Name of object 2>

<ID of object 2>

<Desc. of object 2>

 

<…>

<…>

<…>

<…>

 

<…>

<…>

Therefore we first write this function to read the attribute value:

function getAttributeValue(oItem, nAttrType) {
    var oAttr = oItem.Attribute(nAttrType, nLocale);    // Attribute with the specified type number in the specified language
    var sAttrValue = oAttr.getValue();                  // Content of the attribute
    return sAttrValue;
}

With method “Attribute()” and the parameters attribute type number and language we get the attribute object and with method “getValue()” of this attribute we get the maintained value.

In the report we use this method as follows:

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

Our complete script now looks like this:

var oOutput = Context.createOutputObject();     // Output object
var nLocale = Context.getSelectedLanguage();    // Selected database language

oOutput.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);          
oOutput.TableRow();    
oOutput.TableCell("Model name", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_YELLOW, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
oOutput.TableCell("Object name", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_YELLOW, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
oOutput.TableCell("Identifier", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_YELLOW, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
oOutput.TableCell("Description", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_YELLOW, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

var aModels = ArisData.getSelectedModels();     // Array of selected models
for (var i = 0; i < aModels.length; i++) {            
    var oModel = aModels[i];                    // Current model
    var sModelName = oModel.Name(nLocale);      // Name of current model
    var sModelID = getAttributeValue(oModel, Constants.AT_ID);      // ID of current model
    var sModelDesc = getAttributeValue(oModel, Constants.AT_DESC);  // Description of current model    

    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);
    
    var aObjDefs = oModel.ObjDefList();         // All object definitions that have occurrences in the model
    for (var j = 0; j < aObjDefs.length; j++) {            
        var oObjDef = aObjDefs[j];              // Current object definition
        var sObjName = oObjDef.Name(nLocale);   // Name of current object
        var sObjID = getAttributeValue(oObjDef, Constants.AT_ID);       // ID of current object
        var sObjDesc = getAttributeValue(oObjDef, Constants.AT_DESC);   // Description of current object    
        
        oOutput.TableRow();    
        oOutput.TableCell("", 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
        oOutput.TableCell(sObjName, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
        oOutput.TableCell(sObjID, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
        oOutput.TableCell(sObjDesc, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

    }    
}
oOutput.EndTable("", 100, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
oOutput.WriteReport();

function getAttributeValue(oItem, nAttrType) {
    var oAttr = oItem.Attribute(nAttrType, nLocale);    // Attribute with the specified type number in the specified language
    var sAttrValue = oAttr.getValue();                  // Content of the attribute
    return sAttrValue;
}

Here you can download the entire source code from the "Output models with attributes" report.

Note: This article describe how to develop a report in ARIS. See this post for links to similar articles.

by Ahmed Alnasasrah
Posted on Thu, 08/26/2010 - 13:02

Too Nice  Mr. Michael Wieczorek  but i have a question 

if i add to any object in my EPC Model  link attribute  thats connect with doc files and i hope to print thats doc in my report how can do it ?

thanks.

Regards Ahmed Alnasasrah

1
by Edwin Verstraeten
Posted on Wed, 02/02/2011 - 15:09

In reply to by Sathish212

Hi Ahmed,

It's not possible to include links into your report. You can however include the link in your report, and open the link from your report. Note that you need to have access to that link to do so.

Best regards,

Edwin

1
by Cheuk Fung
Posted on Wed, 01/12/2011 - 19:02

Thank you for these tutorials. They have helped me gain an understanding of how scripts work. Is there a repository where all the methods (e.g. GetSelectedModels) and constants (e.g. AT_DESC) can be found?

1
by ravi kiran
Posted on Fri, 07/29/2011 - 14:29

hi michel really very thnks this code is very helpful .But i have a question

how we have to place  attribute should then be placed in the model,

at the position under the heading.Please could you tell me how to add.I am the new of aris

thanks michel

1
by ravi kiran
Posted on Fri, 08/05/2011 - 11:22

hi michel

how to exhicute all attributes under model

could u tell me

thanks

1
by Eyal Perez
Posted on Tue, 01/31/2012 - 14:43

 

Hi Michael,

I’m trying to build a report for an EPC (row display) model.

I tried to add to the report above two additional field with no succeed.

1. Field stating if this row is an Organizational unit or Application System Type

2. The name of the Organizational Unit Application System Type objects.

 

Can you assist with this one?

 

Thanks in advance

 

1
by Pankaj Patel
Posted on Mon, 12/21/2015 - 14:02

Hi All,

I need to get the assignments to the models as shown above and then their attributes too.

I would be grateful for your help.

Thanks.

1
by Edwin Verstraeten
Posted on Mon, 12/21/2015 - 14:32

In reply to by Pankaj Patel

Please check the script help in the ARIS help. The object model is described in there.

1
by Gautam Kumar Singh
Posted on Mon, 06/10/2024 - 20:49

Too Nice  Mr. Michael Wieczorek

It's very help full to learn ARIS Script.
I want to use boarder on table.
Please suggest me how can I achieve that.

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