Skip to content

Scripting API

Use these read-only helpers from a function invoked by a DSL script= expression. They expose the active evaluation context; they are not a general-purpose runtime API.

Boundary: Snapshot helpers return an empty/default value outside evaluation. Memstore loaders require an active context and raise a catalogued task-configuration error otherwise. Returned containers are copies.

For nested record values, start with the expression scopes. Browse all safe globals, entities, generators, converters, and custom components. The complete Scripting API project executes all seven helpers at their real evaluation boundary.

Use case

The complete Scripting API project calls every helper.

get_context_info

Purpose: Return a read-only snapshot of the current evaluation context.

Signature: get_context_info()

Parameters

  • None.

Returns

A snapshot mapping; unavailable context values are None.

get_current_product

Purpose: Return a copy of the current product being generated.

Signature: get_current_product()

Parameters

  • None.

Returns

A dynamic record mapping, or None when no product is active.

get_property

Purpose: Return a read-only property value from the root context.

Signature: get_property(name, default=null)

Parameters

  • name: str; required.
  • default: dynamic Python value; default null.

Returns

The dynamic Python value stored in the active descriptor, or the supplied default.

get_record_position

Purpose: Return the current record position (1-based) when available.

Signature: get_record_position()

Parameters

  • None.

Returns

int | null.

get_variable

Purpose: Return a read-only variable value from the current evaluation context.

Signature: get_variable(name, default=null)

Parameters

  • name: str; required.
  • default: dynamic Python value; default null.

Returns

The dynamic Python value stored in the active descriptor, or the supplied default.

load_memstore

Purpose: Load memstore data for the current task.

Signature: load_memstore(product_name)

Parameters

  • product_name: str; required.

Returns

A list of dynamic record mappings; field names and values come from the stored product.

load_memstore_page

Purpose: Load a paged window of memstore data for the current task.

Signature: load_memstore_page(product_name, skip, limit)

Parameters

  • product_name: str; required.
  • skip: int; required.
  • limit: int; required.

Returns

A list of dynamic record mappings; field names and values come from the stored product.