Profile picture for user Eva Klein

The following tutorial describes how to output the following information from an EPC to an Excel sheet using a report:

First you need all selected models over which you want to iterate:

var aModels = ArisData.getSelectedModels(); 

Use the following method to determine the name of the current model:

var sModelName = oModel.Name(nLocale);      // Name of current model

The 'ObjOccListFilter' method returns all object occurrences of the relevant model, in this case all functions.

var oFuncOccs = oModel.ObjOccListFilter(Constants.OT_FUNC); 

Use the following expression to determine all incoming connections:

var aCxnOccs = oFuncOccs[j].Cxns(Constants.EDGES_IN);

In this case, only connections of the 'carries out' type are to be included in the evaluation, which means that the connection type must be checked:

if(aCxnOccs[k].CxnDef().TypeNum()==Constants.CT_EXEC_1 || aCxnOccs[k].CxnDef().TypeNum()==Constants.CT_EXEC_2)

If this query returns 'true', determine the relevant source object and check whether it is of type 'Person type':

var oSourceObjOcc = aCxnOccs[k].SourceObjOcc();       

if (oSourceObjOcc.ObjDef().TypeNum() == Constants.OT_PERS_TYPE)

If the source object corresponds to this type, the following information is output:

oOutputFile.TableCell(sModelName, 20, getString("TEXT_1"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
var nSource = oSourceObjOcc.ObjDef().Name(nLocale);
oOutputFile.TableCell(nSource, 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
var nCxn = aCxnOccs[k].CxnDef().ActiveType();
oOutputFile.TableCell(nCxn, 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
oOutputFile.TableCell(oFuncOcc.ObjDef().Name(nLocale), 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
                

The complete report with all iterations and the entire output looks as follows:

var oOutputFile = Context.createOutputObject();     // Output object
var nLocale = Context.getSelectedLanguage();    // Selected database language
var aModels = ArisData.getSelectedModels();  
 
for (var i = 0; i < aModels.length; i++) { 
    oOutputFile.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0); 
    oOutputFile.TableRow();
    oOutputFile.TableCell("ModelName", 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_CENTER | Constants.FMT_VTOP, 0);        
    oOutputFile.TableCell("Actor", 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_CENTER | Constants.FMT_VTOP, 0);        
    oOutputFile.TableCell("Connection", 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_CENTER | Constants.FMT_VTOP, 0);        
    oOutputFile.TableCell("Task", 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_CENTER | Constants.FMT_VTOP, 0);        
 
    var oModel = aModels[i];                    // Current model
    var sModelName = oModel.Name(nLocale);      // Name of current model
    
    //functions
    var oFuncOccs = oModel.ObjOccListFilter(Constants.OT_FUNC);  
    for (var j = 0; j < oFuncOccs.length; j++){
        
        var oFuncOcc = oFuncOccs[j];
        
        var aCxnOccs = oFuncOccs[j].Cxns(Constants.EDGES_IN);
        for(var k=0; k<aCxnOccs.length; k++){
            if(aCxnOccs[k].CxnDef().TypeNum()==Constants.CT_EXEC_1 || aCxnOccs[k].CxnDef().TypeNum()==Constants.CT_EXEC_2){
                // check type of source object
                var oSourceObjOcc = aCxnOccs[k].SourceObjOcc();        
                if (oSourceObjOcc.ObjDef().TypeNum() == Constants.OT_PERS_TYPE){
                         
                    oOutputFile.TableRow();
                    oOutputFile.TableCell(sModelName, 20, getString("TEXT_1"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
                    var nSource = oSourceObjOcc.ObjDef().Name(nLocale);
                    oOutputFile.TableCell(nSource, 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
                    
                    var nCxn = aCxnOccs[k].CxnDef().ActiveType();
                    oOutputFile.TableCell(nCxn, 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        

                    oOutputFile.TableCell(oFuncOcc.ObjDef().Name(nLocale), 20, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);        
                } 
            }
        }
    }
    oOutputFile.EndTable(sModelName, 100, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
}
 
oOutputFile.WriteReport();

Let's see if any more wishes will come true...

by Ismael Shameem Etowar
Posted on Mon, 12/27/2010 - 12:14

Hi Ms Eva,

Thanks a lot for this post.

I'm really grateful to you and the whole Team for that :)

This is in fact my Christmas gift:)lol.

Keep on with the wonderful job you are doing for the ARIS Community.

Happy New Year 2011 to you all :)

 

Cheers



Shameem

0
by Misha Akopov
Posted on Mon, 11/14/2011 - 12:36

hi Ms. Eva Klein

 

                         I looked through your script, and didn't understand how did you split cells ?  modelname colomn contains 9 lines. in the loop you wold have 9 lines with modelname STRINGs.

 

 

 

Thanks

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Mon, 11/14/2011 - 15:44

I'm not sure what you want to know. Can you please explain what you exactly mean?

0
by Misha Akopov
Posted on Tue, 11/15/2011 - 10:13

Ms. Eva Klein

I'am new to ArisScripting and last week was wondering how it was possible to merge cell-s and collumns in excell report. So , when I saw your report in the picutre, you have ModelName ->"Test" only once (in one cell for all 9 columns), and you have merged 9 rows (Modelname column). But according to your code the output will have "Test" (modelname) 9 times in each row. Am I right ? :)

0
by Eva Klein
Badge for 'Community Team' achievement
Author
Posted on Tue, 11/15/2011 - 10:37

Ah okay, now I know what you mean:). My report only provides the data, not the layout of the picture above. That means that my report outputs the model name 9 times, for example, but does not merge the cells as shown in the picture above.

Welcome to the world of ARIS scripting:-)

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

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