Class
ATLExecutionContext
Execution context for ATL transformations, coordinating between ATL constructs and the ECore execution framework.
@MainActor final class ATLExecutionContext
Overview
The ATL execution context serves as the main coordination layer for ATL transformations, delegating heavy computational operations to the underlying ECoreExecutionEngine while managing ATL-specific state such as helpers, rules, and trace links on the MainActor.
Architecture
Following the established swift-ecore pattern:
-
Coordination: Handled on
@MainActorfor UI integration and command compatibility -
Computation: Delegated to
ECoreExecutionEngineactor for performance -
Commands: Integrated with EMF command framework for undo/redo support
Integration with ECore
The context bridges ATL concepts to ECore fundamentals:
-
ATL expressions → ECore expressions via ATLECoreBridge
-
ATL models → ECore IModel interface via ATLModelAdapters
-
ATL operations → ECoreExecutionEngine delegated calls
-
ATL helpers → Runtime behavior injection
Example Usage
let context = ATLExecutionContext(
module: atlModule,
sources: ["IN": sourceModel],
targets: ["OUT": targetModel],
executionEngine: engine
)
let result = try await context.evaluateHelper("myHelper", arguments: [value])
Topics
Initializers
Creates a new ATL execution context.
Instance Properties
Debug mode flag for systematic tracing.
The underlying ECore execution engine for heavy computation.
The ATL module being executed.
Source models indexed by their aliases.
Target models indexed by their aliases.
Instance Methods
Add a lazy binding for later resolution.
Add a lazy binding with current variable context captured.
Add a source model to the context.
Add a target model to the context.
Add a trace link between source and target elements.
Call a helper function with arguments.
Clear all caches in the execution engine.
Clear the error context.
Create a new element in a target model using commands.
Find an element by ID across all models.
Find all elements of a given type using the execution engine.
Get cache statistics from the execution engine.
Get the current error context.
Get a source model by alias.
Get a target model by alias.
Get trace links for a source element.
Get a variable value from the current scope or scope stack.
Navigate a property from a source object using the execution engine.
Pop the current variable scope from the stack.
Push a new variable scope onto the stack.
Register a helper function.
Resolve all pending lazy bindings.
Set a variable value in the current scope.
Relationships
Conforms To
See Also
Transformation Execution
Actor responsible for executing ATL transformations.
Statistics tracking ATL transformation execution performance and behaviour. Comprehensive execution statistics for ATL transformation monitoring.