PG

How do I compare an attribute value where you have a combo drop down (attribute list) in a report script? I've been trying all kinds of ways of getting the AT_STATE_1 attribute of models to see whether they are equal to Constants.AVT_RELEASED, but all I'm getting from the Model.Attribute() function is the string name of the value ("Released").  Apparently, the Model.Attribute() function returns an object of JS class AAttrLongDef, but whether I try value(), getValue(), GetValue(false), MeasureValue(), all I have to show for my pains is the string "Released". Names can be changed in the ARIS configuration, and be localized besides: I'd prefer doing a future-proof comparison. Any hints? 

My example code: arisModelDef is a Model, g_nLoc is the locale. In my frustration, I pulled out the JS members in the attrs variable, and found 37 members of the result from Model.Attribute(), but none that seem to yield an integer value comparable with e.g. Constants.AVT_RELEASED. 

    var stateAttribute = arisModelDef.Attribute(Constants.AT_STATE_1, g_nLoc);
    var stateObjValue = arisModelDef.Attribute(Constants.AT_STATE_1, g_nLoc).GetValue(false);
    var stateValue = arisModelDef.Attribute(Constants.AT_STATE_1, g_nLoc).getValue();
    var stateValue2 = stateAttribute.value(); 
    var attrClass = stateAttribute.getClass(); // AAttrLongDef
    var measure = stateAttribute.MeasureValue();
    var attrs = new Array();
    for ( m in stateAttribute )
        attrs.push(m);

ARIS version: 10.0.13.10.1491549

by Nikita Martyanov
Posted on Wed, 06/02/2021 - 20:39

Hello Pontus,

try arisModelDef.Attribute(Constants.AT_STATE_1, g_nLoc).MeasureUnitTypeNum(). It returns integer comparable with Contstants.AVT_RELEASED.

---

BR, Nikita

0
by Pontus Gagge Author
Posted on Fri, 06/04/2021 - 08:53

In reply to by billie1989

Ah, thanks: that did it! I would never have guessed that the enumeration values/value list/scalars/enums could also be called TypeNums – I assumed it was related to technical typing (ints, floats, strings) or to physical units of measure. 

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