Profile picture for user Anjana

I want to generate a report from a folder level or databse level , I know how to generate report from a model and i want to get all roles in this report , which are available in this database. Please give your valuable comments. Thanks

by karthikeyan balasubramanian
Posted on Mon, 01/23/2012 - 13:29

Hi Anjana,

When creating a new report, Select the context as "Database".

//In code, define the below line globally for running the report on the selected database,

var oDB = ArisData.getActiveDatabase();

//Inside your search function , find the total objects ,array length and print the output,

var objs=oDB.Find(Constants.SEARCH_OBJDEF,43); // 43 is the type num of your search object.

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

Print the objs[i].Name(g_nloc) for Search object.

 

Hope this information will help you to design the required database report

0
by Anjana Nehra Author
Posted on Tue, 01/24/2012 - 09:57

Hi  Karthikeyan,

Thanks  but its not working, the  below mention code is for model and its working fine but i have tried for group its not working showing  error. In line 7 .model is a symbol name, what does it mean??

 

 

 

 

1.function getModelSelection() {

  2.  var oSelectedModels = ArisData.getSelectedModels();

   3. if (oSelectedModels.length == 0) {

       

      4.  var oSelectedObjOccs = ArisData.getSelectedObjOccs();

        5. if (oSelectedObjOccs.length > 0) {

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

           7.      oSelectedModels.push(oSelectedObjOccs[i].Model());

        8.     }

          9.  oSelectedModels = ArisData.Unique(oSelectedModels);

       10.  }

    11. }

    return oSelectedModels;

}

 

 

 

 

0
by karthikeyan balasubramanian
Posted on Tue, 01/24/2012 - 10:35

In reply to by davidbann

Hi Anjana,

Try using the below basic code to list all the OU type object from the database.Create a new report with context as "Database" and use the below code,

 

// Code to list all OU object in database

var oDB = ArisData.getActiveDatabase();   

var g_outfile=null;

var g_nloc=Context.getSelectedLanguage();

function main()

{

    var objs=oDB.Find(Constants.SEARCH_OBJDEF,43);

    var g_ooutfile = Context.createOutputObject();

    g_ooutfile.DefineF("REPORT2", getString("TEXT6"), 14, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0, 21, 0, 0, 0, 1);   

    g_ooutfile.BeginTable(100, Constants.C_GREY_80_PERCENT, - 1, 8, 0);

    g_ooutfile.TableRow();   

    g_ooutfile.TableCell("Name", 15, getString("TEXT1"), 9, 0, getTableCellColor_Head(), 0, 145, 0);   

    g_ooutfile.TableCell("Type", 15, getString("TEXT1"), 9, 0, getTableCellColor_Head(), 0, 145, 0);   

    g_ooutfile.TableCell("Group", 15, getString("TEXT1"), 9, 0, getTableCellColor_Head(), 0, 145, 0);



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

    {

            g_ooutfile.TableRow();   

            g_ooutfile.TableCell(objs[i].Name(g_nloc), 15, getString("TEXT1"), 10, 0, Constants.C_WHITE, 0, 136, 0);

            g_ooutfile.TableCell(objs[i].Type(), 15, getString("TEXT1"), 10, 0, Constants.C_WHITE, 0, 136, 0);

            g_ooutfile.TableCell(objs[i].Group().Path(g_nloc), 15, getString("TEXT1"), 10, 0, Constants.C_WHITE, 0, 136, 0);



    }

    g_ooutfile.EndTable("", 250, getString("TEXT1"), 12, 0, - 1, 0, 136, 0);

    g_ooutfile.WriteReport();

}

main()

 

0
by karthikeyan balasubramanian
Posted on Fri, 02/03/2012 - 07:22

In reply to by davidbann

Hi Anjana,

Have you tried my last code?. Did it worked. In this same code structure with little modification you can also generate the report at group level . 

0
by Jim Cai
Posted on Thu, 02/09/2012 - 03:28

In reply to by beatriz.bueno

Hi Karthikeyan,

I have tried your last code, it works fine.

I could not find object type number instead of symbole type number. Do you know how to apply the symbol type number in the code?

 

Thanks!

0
by Anjana Nehra Author
Posted on Thu, 02/09/2012 - 11:00

Hi Karthikeyan

 

Thanks a ton for youe help, i did not try your code.. i have done in some other way.

 

Regards,

Anjana

0
by Anjana Nehra Author
Posted on Thu, 02/09/2012 - 11:16

Hi Jim,

You can find the object type numbet in ARIS in below mentioned folder.

Configration  > Method > Symbols

Select one object which one you want,  right click on that and go to last options(if its a user defined than you get its GUID).

 

 

Thanks

 

Regards,

Anjana

0
by Jim Cai
Posted on Thu, 02/09/2012 - 22:31

In reply to by deepti.mittal

Thanks Anjana!

I do not think we need GUID in the following code.

 var objs=oDB.Find(Constants.SEARCH_OBJDEF,43);

 

43 should be object type ID, one of our object named "Control" and what I could find is symbol type ID.

 

0
by karthikeyan balasubramanian
Posted on Fri, 02/10/2012 - 08:07

Hi Jim,

// var objs=oDB.Find(Constants.SEARCH_OBJDEF,43);

The above code works only for Object Type Num not for Symbol Type Num .

If you want get the object by Symbol Type Num then use the below code,

var objs=oDB.Find(Constants.SEARCH_OBJDEF,<Give Type Num of an Object>);

var obj_symbol=objs[i].ObjDef().getDefaultSymbolNum();

if(obj_symbol==<Give Type Num of Symbol>)

Print the Object

Else

Continue

Hope this will help !!!

 

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