Profile picture for user mcawful

My apologies if this question has been answered in the fourms before, but I'm fairly new to ARIS script and I'm trying to understand the behavior of the equals() method. It seems to behave differently than I expect, such as when comparing strings, it appears to ignore case. I was curious to know if there was a more full documentation on how the method works than what is in the help documentation or if someone who understands the quirks of the method can explain it to me.  Thanks!

by Ralf Angeli
Posted on Tue, 07/27/2021 - 10:57

AFAIK it is Java's equals() method that is called in ARIS Script, so you should be able to get more info by looking into Java's documentation.

By the way, in my case, string comparison with equals() is case-sensitive, as it should be. This code, executed as an ARIS report, will return false (in a message box, so you don't need to use a debugger), for example:

Dialogs.MsgBox("foo".equals("Foo"))

This should call equals() of java.lang.String and this is case-sensitive. A non-case-sensitive comparison can be done with equalsIgnoreCase(). Not sure, why in your case equals() is not case-sensitive. Perhaps you are calling the method of another class?

0
by M. Zschuckelt
Posted on Tue, 07/27/2021 - 10:58

Hello Michael,

which type of object are you talking about that has got an equals method? Strings? Javascript strings do not have an equals() method. If you created your strings as Java-Strings (java.lang.String) you get access to the Java equals() method of that class. In Javascript you compare strings usually with '==' or '==='. '==' does the typical Javascript type conversions, so ('1' == 4 - 3) would evaluate to true, while ('1' === 4 - 3) would be false.

ARIS currently works with an old Rhino 1.7.7 Javascript engine, which apparently also has disabled some of the more modern syntax of Javascript.

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