A2uiExecutionContext


interface A2uiExecutionContext


Provides environment access, dynamic payload evaluation, and function execution capabilities within the scope of a specific component.

Summary

Public functions

Any?
evaluatePayload(payload: Any?)

Evaluates a dynamic payload.

Any?
executeFunction(name: String, args: Map<StringAny>)

Executes a catalog function by name.

open A2uiFunctionDefinition?

Returns the definition of a catalog function by name, or null if not found.

T
<T : Any> getOrCreateFunctionScopedCache(
    functionDefinition: A2uiFunctionDefinition,
    factory: () -> T
)

Gets or creates a component-scoped cache for functionDefinition.

Any?

Resolves a value from the data model at the given path.

Public properties

A2uiDataPath

The base data path used to resolve relative paths in this context.

Public functions

evaluatePayload

Added in 1.0.0-alpha01
fun evaluatePayload(payload: Any?): Any?

Evaluates a dynamic payload.

Parameters
payload: Any?

payload to evaluate

Returns
Any?

evaluated result, or null if evaluation fails

executeFunction

fun executeFunction(name: String, args: Map<StringAny>): Any?

Executes a catalog function by name.

Parameters
name: String

name of the function to execute

args: Map<StringAny>

arguments to pass to the function

Returns
Any?

result of the function execution, or null if execution fails

getFunctionDefinition

Added in 1.0.0-alpha01
open fun getFunctionDefinition(name: String): A2uiFunctionDefinition?

Returns the definition of a catalog function by name, or null if not found.

Parameters
name: String

name of the function

Returns
A2uiFunctionDefinition?

function definition, or null if the function is not found in the catalog

getOrCreateFunctionScopedCache

Added in 1.0.0-alpha01
fun <T : Any> getOrCreateFunctionScopedCache(
    functionDefinition: A2uiFunctionDefinition,
    factory: () -> T
): T

Gets or creates a component-scoped cache for functionDefinition.

Each component and functionDefinition pair gets a separate cache that persists across function invocations and data model updates. Ideal for storing the results of heavy operations that do not rely on data model values (e.g., static metadata, parsed templates, compiled regexes, etc.).

Warning: The cache does not refresh upon data model changes. Caching values that are based on the data model will result in a stale cache.

Parameters
functionDefinition: A2uiFunctionDefinition

definition identifying the cache

factory: () -> T

factory to construct the cache if missing

Returns
T

cache instance

resolveValue

Added in 1.0.0-alpha01
fun resolveValue(path: A2uiDataPath): Any?

Resolves a value from the data model at the given path.

Parameters
path: A2uiDataPath

data path to resolve

Returns
Any?

resolved value, or null if value resolution fails

Public properties

dataPath

Added in 1.0.0-alpha01
val dataPathA2uiDataPath

The base data path used to resolve relative paths in this context.