setFeatureStateExpression

abstract fun <FS : FeatureState> setFeatureStateExpression(featureStateExpressionId: Int, featureset: TypedFeaturesetDescriptor<FS, *>, expression: Value, state: FS, callback: FeatureStateOperationCallback = FeatureStateOperationCallback { })

Sets a feature state expression that applies to features within the specified featureset.

All feature states with expressions that evaluate to true will be applied to the feature. Feature states from later added feature state expressions have higher priority. Regular feature states have higher priority than feature state expressions. The final feature state is determined by applying states in order from lower to higher priority. As a result, multiple expressions that set states with different keys can affect the same features simultaneously. If an expression is added for a feature set, properties from that feature set are used, not the properties from original sources.

Note that updates to feature state expressions are asynchronous, so changes made by this method might not be immediately visible and will have some delay. The displayed data will not be affected immediately.

Parameters

featureStateExpressionId

Unique identifier for the state expression.

featureset

The featureset descriptor that specifies which featureset the expression applies to.

expression

The expression to evaluate for the state. Should return boolean.

state

The state object with properties to update with their respective new values.

callback

The feature state operation callback called when the operation completes.