Class
ATLVirtualMachine
Actor responsible for executing ATL transformations.
@MainActor final class ATLVirtualMachine
Overview
The ATL Virtual Machine orchestrates the execution of Atlas Transformation Language modules, coordinating matched rule evaluation, called rule invocation, and helper function execution. It provides a concurrent execution environment that maintains transformation state consistency while enabling parallel rule processing.
Overview
The virtual machine operates through several execution phases:
-
Initialisation: Module validation and execution context setup
-
Matched Rule Execution: Automatic rule triggering for matching elements
-
Lazy Binding Resolution: Deferred property binding and reference resolution
-
Called Rule Processing: Explicit rule invocation as requested
-
Finalisation: Target model validation and resource cleanup
Execution Model
ATL transformations follow a hybrid declarative-imperative model:
-
Declarative Phase: Matched rules execute automatically for all matching source elements
-
Imperative Phase: Called rules execute on-demand through explicit invocations
-
Resolution Phase: Lazy bindings resolve forward references and circular dependencies
Concurrency Design
The virtual machine is implemented as an actor to ensure thread-safe transformation execution. Rule processing can occur concurrently for independent elements while maintaining serialised access to shared transformation state.
Example Usage
let vm = ATLVirtualMachine(module: transformationModule)
try await vm.execute(
sources: ["IN": sourceResource],
targets: ["OUT": targetResource]
)
Topics
Initializers
Creates a new ATL virtual machine for the specified module.
Instance Properties
The ATL module to execute.
Statistics tracking transformation execution.
Instance Methods
Enable or disable debug output for systematic tracing.
Executes the ATL transformation with the specified models.
Executes a called rule with the specified parameters.
Retrieves current execution statistics.
Relationships
Conforms To
See Also
Transformation Execution
Execution context for ATL transformations, coordinating between ATL constructs and the ECore execution framework.
Statistics tracking ATL transformation execution performance and behaviour. Comprehensive execution statistics for ATL transformation monitoring.