KP

Hi All,

I am new in ARIS scripting.

Please help me on this report...I need script for below ,

Report should show all group names and last user of selected model.like if I have same model in different group then report all the group names which have same model.

I hope i will get good response from Aris Community .

Thanks in Advance.

by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 06/12/2015 - 09:35

Hello,

oModelList = ArisData.getSelectedModels();

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

    oModel = oModelList;

    // output the name, group and last user...

    sValue = oModel.Name(g_nLoc);

    sValue = oModel.Group().Path(g_nLoc);

    sValue = oModel.Attribute(Constants.AT_LUSER, g_nLoc).getValue()

}

Well, that is the basic - you will have to define the output object and output the three sValues to either cells in a table or lines in a word file...

Otherwise I would strongly recommend to have a look at the scripting examples provided in this forum.

0
by kavita P Author
Posted on Fri, 06/12/2015 - 11:44

Hi Robert Goldenbaum,

I need script for below,

Eg: In ABC Database had two groups,

1: Group1 , In this had two groups,

    a : subGroup1, inside this had model "xyzmodel".

    b : subGroup2, inside this had another model "pqrmodel".

    

2:Group2, Had a sub group,

    subGroup4, inside this had "xyzmodel".

Now we need report of both parents group names which have "xyzmodel" in database. like ex: "Group1 and Group2".

var oModelList = ArisData.getSelectedModels();

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

    oModel = oModelList;

    // output the name, group and last user...

    var sValue1 = oModel.Name(g_nLoc);

    var sValue2 = oModel.Group().Name(g_nLoc);

    var sValue3 = oModel.Attribute(Constants.AT_LUSER, g_nLoc).getValue()

    

    oOutput.OutputLn("sValue1: " + sValue1, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

    oOutput.OutputLn("sValue2: " + sValue2, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

    oOutput.OutputLn("sValue3: " + sValue3, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

}

This script is giving sub group name.

Ex: sValue2 - subGroup1.// given only one group name.

0
by Martin Miskovic
Posted on Fri, 06/12/2015 - 12:59

If you reached certain SubGroup and want the Group, just use:

var sValue2 = oModel.Group().Parent().Name(g_nLoc);

Regards.

Martin

0
by kavita P Author
Posted on Fri, 06/12/2015 - 13:23

In reply to by martin.miskovic

Hi Martin,

Thank you very much.

It's working fine for me but can i get all the group names which have same model in database.

Example : 

 Model Name : xyzModel

Group Name          Last User

Group1                      aaa

Group2                      bbb

Group3                      aaa

Group4                      xxx

Group5                      yyy

 

File attachments
0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 06/12/2015 - 13:24

Well, you could also do it like this:

oSelGroupList = ArisData.getSelectedGroups();

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

    oGroup = oSelGroupList[i];

    oModelList = oGroup.ModelList(true);

    // iterate through the model list

}

So you would have a list of all models below the one parent group and a list of all models below the other one...

 

0
by Liju Ram
Posted on Thu, 12/07/2017 - 16:26

In reply to by rgoldenbaum

Hi Robert, Is there a way to print the graphic of models in model list as per the hierarchy. Cause for me the models are getting printed in no particular oder in the report. I need the models in the same order as they are in ARIS. Appreciate ur inputs. 

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 12/08/2017 - 13:14

In reply to by liju

Ahm, there is something in the sort for this:

oModelList = ArisData.sort(oModelList, Constants.SORT_GROUP_HIERARCHY, 1033) or something like this. Please use the help for the sort and get the correct constant.

0
by Liju Ram
Posted on Mon, 12/11/2017 - 13:33

In reply to by rgoldenbaum

Dear Robert,

I tried the sort function as u said. But its not getting sorted. I am really clueless. Below is my code. Can u plz have a look.

Code Sample

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

    {

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

    var grp=p_aGroup[i];

    subGroups.push(grp);

    subGroups = subGroups.concat(grp.Childs(false));

    }

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

        var subModels = subGroups[i].ModelList()

        subModels = ArisData.sort(subModels, Constants.SORT_GROUPHIERARCHY,nLocale);

        for(var j=0; j<subModels.length; j++)

        {

        p_output.BeginSection(297.2, 420.3, 28.34467120181406, 28.34467120181406, 30, 30, 20, 20, false, Constants.SECTION_DEFAULT)

        sectionPageSetup( p_output )

        p_output.BeginParagraph( Constants.FMT_LEFT, 0, 0, 0, 0, 0)

        writeData5(p_output, subModels[j].Name(nLocale))

        p_output.EndParagraph()

        writeData3(p_output, subModels[j].Graphic(true, false, nLocale, false))

  

        

        var oobjocc = subModels[j].ObjOccList();

        for(var a=0;a<oobjocc.length;a++){

        if(oobjocc[a].SymbolName()=="Value-added chain")

        {

            if(oobjocc[a].ObjDef().AttrList(nLocale, [Constants.AT_DESC])!="")

            {

             p_output.OutputLn("", getString("ID_REPORTDEF_12"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,Constants.FMT_LEFT, 0)

              writeData(p_output, oobjocc[a].getObjDefName(nLocale))

              p_output.OutputLn(" ", getString("ID_REPORTDEF_12"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,Constants.FMT_LEFT, 0)

              p_output.OutputLn(getString("ID_REPORTDEF_3"), getString("ID_REPORTDEF_12"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,Constants.FMT_LEFT, 20)

              iteration_group1(p_output, oobjocc[a].ObjDef().AttrList(nLocale, [Constants.AT_DESC]))

        }}}

        

        var ocurrentgroup = subGroups[i];

        var ochildren = ocurrentgroup.Childs(true);   

        for(var p=0; p<ochildren.length; p++) 

        {

        var smallModels = ochildren[p].ModelList();

        smallModels = ArisData.sort(smallModels,Constants.SORT_GROUPHIERARCHY,nLocale);

        for(var q=0; q<smallModels.length; q++)

        {

        p_output.BeginSection(297.2, 420.3, 28.34467120181406, 28.34467120181406, 30, 30, 20, 20, false, Constants.SECTION_DEFAULT)

        sectionPageSetup( p_output )

        p_output.BeginParagraph( Constants.FMT_LEFT, 0, 0, 0, 0, 0)

        writeData5(p_output, smallModels[q].Name(nLocale))

        p_output.EndParagraph()

        writeData3(p_output, smallModels[q].Graphic(true, false, nLocale, false))

        

        

        

        var oobjoccchild = smallModels[q].ObjOccList();

        for(var b=0;b<oobjoccchild.length;b++)

        {

        if(oobjoccchild[b].SymbolName()=="Process step")

        {

            if(oobjoccchild[b].ObjDef().AttrList(nLocale, [Constants.AT_DESC])!="")

            {

              p_output.OutputLn("", getString("ID_REPORTDEF_12"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,Constants.FMT_LEFT, 0)

              writeData(p_output, oobjoccchild[b].getObjDefName(nLocale))

              p_output.OutputLn(" ", getString("ID_REPORTDEF_12"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,Constants.FMT_LEFT, 0)

              p_output.OutputLn(getString("ID_REPORTDEF_3"), getString("ID_REPORTDEF_12"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,Constants.FMT_LEFT, 0)

              iteration_group1(p_output, oobjoccchild[b].ObjDef().AttrList(nLocale, [Constants.AT_DESC]))

        }

        }

        }

        }

        }

        }

        }

 

Note :

I am able to print all the Models inside groups with above code. But the hierarchy is not correct. This is my current obsession with ARIS script. 

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Mon, 12/11/2017 - 14:32

In reply to by liju

Hm well, you only get the models of a single group and then sort them via their group hierarchy - which is the same for every model of the same group.

I thought you would be doing something like this:

oModelList = oStartGroup.ModelList(true)

oModelList = ArisData.sort(oModelList, Constants.SORT_GROUPHIERARCHY, 1033)

...

 

 

 

0
by Martin Miskovic
Posted on Fri, 06/12/2015 - 14:38

Well... your request is to export data based on the model, but you have to understand that there is only 1 model in each database. You can have more models with the same name, but they are different objects.

The simplest thing to do is the following:

1. get all the models into 1 array like Rober suggested.

2. sort it alphabetically by its name.

3. loop through the array while checking if there is more than 1 model in database / groups.

Martin

0
by Liju Ram
Posted on Fri, 09/29/2017 - 14:49

Suppose i run a report on a model . is it possible to print a different model in that report. Is there a way i can iterate over all the models?

 

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 09/29/2017 - 15:48

Yes sure you can...

And you could get the models assigned to the objects in your start model by going over the ObjDefList() of the model and then via the AssignedModels() of the single ObjDefs.

 

0
by Liju Ram
Posted on Fri, 09/29/2017 - 16:02

Maybe i should rephrase my question. I have a model in a group A . There is another model in Group B. These models are not related or connected in any way. But what i need is to run a report on model in group A. But i need to print the model from group B as well in that same report. I dont't know if this possible? 

I tried to simply print the model graphic by the name of model  as below. But this is also not happening somehow.

writeData3(p_output,(FSS SLA map).Graphic(true, false, nLocale, false))

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 09/29/2017 - 16:27

Ahm well, that depends on how you want to find this "other" model...   You could go from the group of the start model to the parent group and then to the "other" group of the "other" model and get it like this...

But well, this seems like not such a good approach...  

0
by Liju Ram
Posted on Wed, 10/04/2017 - 16:46

In reply to by rgoldenbaum

I have the model name which i need to be printed in my report. Is it possible to print the model somehow from the model name? 

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Wed, 10/04/2017 - 17:28

Well, you could search the database for models with this name....   but this is not very good, as there could be multiple models with this name...

0
by Liju Ram
Posted on Wed, 10/04/2017 - 17:36

Which ARIS function should i use for this ? I tried with getSelectedModels() on Model name , But it throws error as "Cannot find function getSelectedModels in object".

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Thu, 10/05/2017 - 10:02

Hm well, there is the database method "Find" - there you can add the needed parameters etc.

The search can help :-)

And ArisData.getSelectedModels() only returns the models where you have started the script on...  Once again - use the search and also have a look into other standard scripts...

0
by Liju Ram
Posted on Thu, 10/05/2017 - 22:25

I tried with the code below. But it prints Undefined. Appreciate any help. I am going crazy with this 

 var nLocale = Context.getSelectedLanguage();

 var output = Context.createOutputObject();



var db = ArisData.getActiveDatabase();

var models = db.Find(Constants.SEARCH_MODEL);

 

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

{

 

    if(models[i]== "Develop Vision and Strategy")

    {

    var pic = models[i].Graphic(false, false,nLocale);

    }

}

     output.OutputLn("Model  "+ pic, "Arial", 15, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

     output.WriteReport();

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 10/06/2017 - 07:52

Well, you should take the name of the model to compare...  models[i] is just an object of the type model...

models[i].Name(nLocale)...

0
by Liju Ram
Posted on Fri, 10/06/2017 - 09:29

Thanx alot Robert. It works like a charm.

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