Profile picture for user RBeddoe

Is there a built-in report that I can run that will output all user-defined attributes in a given database? I am looking for a report that will include the GUID and the attribute name.

Rick Beddoe

Cargill Aris Technical Analyst

Minneapolis, MN, USA

by Toven B
Posted on Thu, 05/24/2012 - 03:06

Hi Rick,

You cannot output user-defined attributes as prebuilt-in report.

But modifying "Export attributes values for translation" report source, you will get your output.

 

For reference, as you already know, below image is useful report list. 

 

Thanks.

Toven

0
by Rick Beddoe Author
Posted on Thu, 06/21/2012 - 15:58

Thanks Toven,

Finally got around to trying this. The problem is that it only outputs maintained attributes. I need the listing of all attributes that can be found in <database>->Configuration->Method->Attribute types

If anyone knows a way to get this table output as it is shown, that would be perfect. I can select the table and copy/paste, but that only gives the attribute name. I need to know Type number and API name

Cheers,

Rick Beddoe

Cargill Aris Technical Analyst

Minneapolis, MN, USA

 

 

 

0
by Ciska de Jager
Posted on Thu, 06/21/2012 - 22:07

Hi Rick,

Glad I can be of some help today.

I will post some ideas what you then can put togeter to give the output you need.

I am more interested in the filter been used, the objects and models and their attributes. In order to get the relevant attributes for a filter you need for example the object types:

var allowedobjtypes  = ocurrentfilter.ObjTypes();

For each object type you can get the attributes defined (within the loop of allowed object types:

var attrtypenums  = ocurrentfilter.AttrTypes(Constants.CID_OBJDEF, allowedobjtypes[i]);

For each attribute type number you can get the information:

Name: ocurrentfilter.AttrTypeName(attrtypenums[j])

API Name: ocurrentfilter.getAPIName(Constants.CID_ATTRDEF, attrtypenums[j])

Values (where applicable):

   var aValueTypes = ocurrentfilter.AttrValueTypeNums(attrtypenums[j]);

   for(var i1 in aValueTypes) {

     aValues.push(ocurrentfilter.AttrValueType(attrtypenums[j], aValueTypes[i1]));

   }

Hope this helps

Ciska

0
by Rick Beddoe Author
Posted on Fri, 06/22/2012 - 16:25

Hi Ciska,

This is PERFECT! I will post my code once it is complete.

One question I have, though. Notice the 'Type' column above. How do I get that information? I have tried many properties and methods of the above object but have not been able to find that information.

Regards,

Rick Beddoe

Cargill Aris Technical Analyst

Minneapolis, MN, USA

0
by Ciska de Jager
Posted on Sat, 06/23/2012 - 01:06

Hi Rick

As I see it you need to have the object/model/cnx type (eg OT_FUNC) in order to get the attribute type, if that is what you refer to. I never really required to have it differently. Keep in mind that certain attributes are only applicable to certain objects or wherever you can assign attributes to. Therefor it is never a good idea to output this based on entire method..... but I would, if no other way, get all the unique attributes for the models/objects/cnx in order to get the complete list of attributes.

You know this is also available in die documentation, tabularar pfd file?

Hope this answer your question.

Ciska

0
by Rick Beddoe Author
Posted on Mon, 06/25/2012 - 06:56

Hi Ciska,

I was able to get what I needed by using your previous semi-pseudo code ;)

Below is the code I came up with. You will see several custom 'libraries' that I've written that handle the data and presentation, but you should get an idea of the logic from the main code. This will give me all custom written attributes since none of them will have an API name starting with "AT_".

As for documentation, I have none. It's a long story how I ended up in this role. I'll tell you over a beer some time.

Cheers,

Rick Beddoe

Cargill Aris Technical Analyst

Minneapolis, MN, USA

var locale = Context.getSelectedLanguage(); // global variable, used throughout
var oDatabase = ArisData.getActiveDatabase();
var oCargillData = new CARGILL_DATA();
var oCargillArisData = new CARGILL_ARIS_DATA(oDatabase, locale);
var oCargillAttributes = new CARGILL_ARIS_ATTRIBUTES();
var oCargillExcel = new CARGILL_EXCEL("List of Attributes");

var oFilter = ArisData.ActiveFilter();

var allowedobjtypes  = oFilter.ObjTypes();

var oAttTable = new oCargillData.DataTable("ARIS Attributes");

var _headers = [
                    {key:"TH_ATTRIBUTE_NAME", value:"Attribute Name",index:1},
                    {key:"TH_API_NAME", value:"API Name",index:2},
                    {key:"TH_ATTR_NUM", value:"Attribute Number",index:3},        
               ];       
        
oAttTable.Columns = _headers;
oAttTable.sort = "TH_ATTRIBUTE_NAME";

    for (var i in allowedobjtypes){
        
        
        var attrtypenums  = oFilter.AttrTypes(Constants.CID_OBJDEF, allowedobjtypes[i]);
        
        for (var j in attrtypenums){
            
            var oName = oFilter.AttrTypeName(attrtypenums[j]);
            var oApiName = oFilter.getAPIName(Constants.CID_ATTRDEF, attrtypenums[j]);
            
            if(oApiName.indexOf("AT_") != -1){continue;}     
            var oDataRow = [
                                {key:"TH_ATTRIBUTE_NAME",value:oName},
                                {key:"TH_API_NAME",value:oApiName},
                                {key:"TH_ATTR_NUM",value:attrtypenums[j]}
                            ]
            oAttTable.AddRow(oDataRow);
        }
    
    }



    var oReport = new oCargillExcel.Report("List of Attributes");

    oReport.Table = oAttTable;
    oReport.Table.RemoveDuplicates("TH_ATTRIBUTE_NAME");
    oReport.Write(oReport.Table.sort);
    oCargillExcel.WorkBook.write();
    

    
0
by Ciska de Jager
Posted on Mon, 06/25/2012 - 09:09

Hi Rick

Beer sound good.... but it will involve some traveling!

Glad I could be of some help.

Ciska

0
by Baglan Beisenov
Posted on Mon, 06/23/2014 - 18:13

Rick Beddoe, hi.

Where can I get  CARGILL_DATA();?

It gives me error?

0
by Ron Cobble
Posted on Wed, 03/23/2016 - 13:45

In reply to by beisenov_bu

Being completely new to scripting in ARIS, I suspect CARGILL_DATA() or any variable with the Cargill name associated depends on the custom libraries he made mention of in the reply that contained the script.

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • 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