JavaScript allow-listing

Components of Medallia Experience Cloud use JavaScript processing engine called Mozilla Rhino — also known as the Rhino Engine — to provide flexibility for scripting.

The Rhino Engine allows scripts to access Java objects such as survey records and survey pagination logic. This is useful for carrying out arbitrary tasks, including transformation of data while loading spreadsheets provided by clients.

Access to the Rhino Engine is restricted by a ClassShutter mechanism regardless of the point of access, limiting JavaScript's class access.

Allow list violations

When JavaScript is executed by the Rhino Engine, any access to a Java class is passed through the ClassShutter mechanism. The ClassShutter implements arbitrary logic and makes a decision as to whether Rhino may allow access to the class. Wen access is allowed, the ClassShutter mechanism is transparent to the end-user. When access is denied, Experience Cloud shows an error message similar to the message below:

TypeError: Cannot call property toString in object [JavaPackage java.lang.Class]. It is not a function, it is "object". (__script__#3)

The JavaScript editor shows this error when you attempt to run the script.

When you use a mechanism that does not make use of the JavaScript Editor, you do not see the error until runtime.

In either case, this is an indication that you have attempted to access a class that is not allowed by Medallia’s Rhino class allow list.

JavaScript allow list

The classes in the list below are included in the allow list. If the class you are attempting to access is on this list, you can access it via Rhino Engine without issue. If the class you are attempting to access is not on this list, contact your Medallia expert.

  • advil.api.BounceCategory

  • com.medallia.concurrent.executors.DaemonThreadFactory$LocalNameThread

  • com.medallia.fields.repository.SurveyDynamicField

  • com.medallia.fields.surveyfields.repository.Efield

  • com.medallia.fields.surveyfields.repository.Question

  • com.medallia.fields.orghierarchyfields.repository.UnitDataField

  • com.medallia.fields.orghierarchyfields.repository.UnitGroupDataField

  • common.convert.csv.CSV

  • common.js.JSLookup$JSLookupException

  • common.web.dust.DustRenderer$$Lambda

  • common.web.dust.DustRenderer

  • edu

  • express.autoimporter.fieldlibrary.AccountPlugin

  • express.autoimporter.fieldlibrary.AccountPlugin$PermissionStaticAutoImporterField$UnitGroups

  • express.autoimporter.fieldlibrary.AccountPlugin$PermissionEntry

  • express.autoimporter.fieldlibrary.ex360.WaveParticipantPluginUtils

  • express.autoimporter.processor.transform.AutoImporterJavaScriptExecutor$DiscardedException

  • express.bl.datamodel.account.AccountMeta$Kinds

  • express.bl.datamodel.account.Role

  • express.bl.datamodel.alert.AlertStatus

  • express.bl.datamodel.alternative.AlternativeDb

  • express.bl.datamodel.alternative.DynamicAlt

  • express.bl.datamodel.company.Company

  • express.bl.datamodel.geography.Country

  • express.bl.datamodel.i18n.LanguageDb$LanguageAlt

  • com.medallia.fields.surveyfields.repository.CalculatedSurveyField$CalculatedSurveyFieldWrapper

  • express.bl.datamodel.nesteddropdown.JsAlternative

  • express.bl.datamodel.orghierarchy.Unit

  • express.bl.datamodel.orghierarchy.UnitGroup

  • express.bl.datamodel.orghierarchy.UnitMeta$State

  • express.bl.datamodel.survey.CommittedSurveySpec

  • express.datamodel.feed.survey.responses.Survey$Statuses

  • express.datamodel.feed.survey.responses.Survey$SurveySource

  • express.ibs.js.JsSlugCubeDecorator$JsAggregationAvgStats

  • express.ibs.js.JsSlugCubeDecorator$JsAggregationStats

  • express.ibs.js.JsSlugCubeDecorator$JsSlugCube

  • express.ibs.js.JsSlugCubeDecorator$JsSlugFieldCube

  • express.omniexporter.definition.HttpOmniExporterAction$HttpResultGenerator$HttpResultInfo

  • express.web.actions.casemanagement.CaseManagementFormWebAction

  • express.web.actions.casemanagement.FormFieldWebViewFactory

  • express.web.actions.casemanagement.CaseManagementFormWebAction$CaseManagementAlertAction

  • express.web.actions.framework.WebResponse$Template

  • express.web.actions.jsonrender.JsonToHtmlRenderer$$Lambda

  • i18n.transstrings.TransStringWithArgs

  • java.io.StringWriter

  • java.lang.Double

  • java.lang.IllegalArgumentException

  • java.lang.Integer

  • java.lang.Object

  • java.lang.String

  • java.lang.Thread

  • java.net.URI

  • java.text.SimpleDateFormat

  • java.util.ArrayList

  • java.util.ArrayList$Itr

  • java.util.Calendar

  • java.util.Collections$UnmodifiableCollection

  • java.util.Collections$UnmodifiableSet

  • java.util.Collections$UnmodifiableSortedSet

  • java.util.Date

  • java.util.GregorianCalendar

  • java.util.HashMap

  • java.util.LinkedHashMap

  • java.util.LinkedHashSet

  • java.util.Locale

  • java.util.TimeZone

  • net

  • org.joda.time.DateTime

  • org.joda.time.DateTime$Property

  • org.joda.time.DateTimeConstants

  • org.joda.time.DateTimeZone

  • org.joda.time.Days

  • org.joda.time.Hours

  • org.joda.time.IllegalFieldValueException

  • org.joda.time.Interval

  • org.joda.time.LocalDate

  • org.joda.time.LocalDateTime

  • org.joda.time.LocalTime

  • org.joda.time.MutableDateTime

  • org.joda.time.Period

  • org.joda.time.UTCDateTimeZone

  • org.joda.time.format

  • org.joda.time.format.DateTimeFormat

  • org.joda.time.format.DateTimeFormatter

  • org.joda.time.format.ISODateTimeFormat

  • org.joda.time.format.PeriodFormatter

  • org.joda.time.format.PeriodFormatterBuilder

  • org.joda.time.tz.CachedDateTimeZone

  • org.joda.time.tz.DateTimeZoneBuilder$PrecalculatedZone

  • org.joda.time.tz.FixedDateTimeZone

  • org.mozilla.javascript.EcmaError

  • org.mozilla.javascript.WrappedException

  • org.slf4j.impl.Reload4jLoggerAdapter

  • org.slf4j.helpers.NOPLogger

  • sun.util.calendar.ZoneInfo

  • surver.pub.spec.SurveySpec$ValidationFunctionsImpl

  • surver.pub.cond.ValidationScript$TestValidationFunctions

  • surver.pub.cond.ValidationScript$ValidationFunctionsForSyntaxValidation

  • tiny.Encoding

  • tiny.Encoding$HashType

  • tiny.Encoding$OutputEncoding

  • tiny.Strings