evaluate

suspend fun evaluate(profileVariables: Map<String, Any>): Result<ArcadeEvaluationResult>

Evaluate the script using the supplied profile variables. Each entry of the profileVariables dictionary is placed into the interpreter as a value accessible throughout the script. The name and type of these should comply with the profile the Arcade evaluator has been constructed with. Values are not persisted across evaluations, meaning all required profile variables must be supplied with each evaluation.

Each value of a key/value pair in the dictionary is converted to a type understood by the interpreter.

Values in the dictionary can be any of the following types

  • String.

  • Numbers, integer and floating point types of various sizes. Arcade uses doubles for all internal calculations.

  • Boolean.

  • Instant.

  • LocalDate.

  • LocalTime.

  • OffsetDateTime.

  • Geometry.

  • GeoElement (or anything derived from it such as Feature, EncFeature).

  • FeatureLayer.

  • FeatureTable, see FeatureTableType.

  • MutableDictionaryImpl, String to supported type.

  • Geodatabase.

  • ServiceGeodatabase.

  • GeoModel (or anything derived from it such as ArcGISMap or ArcGISScene).

  • Location.

To be explicit on the conversions of compound types.

  • GeoElement types are converted to Arcade Feature type.

  • Location is converted to an Arcade Feature type.

  • FeatureLayer types are converted to Arcade FeatureSet type.

  • FeatureTable types are converted to Arcade FeatureSet type.

  • Geodatabase is converted to Arcade FeatureSetCollection type.

  • ServiceGeodatabase is converted to Arcade FeatureSetCollection type.

  • GeoModel is converted to Arcade FeatureSetCollection type.

Return

The task object representing the asynchronous evaluation of an Arcade script. The value of the task result is an ArcadeEvaluationResult object.

Since

200.1.0