Method
generate(mainTemplate:arguments:models:)
Executes the specified main template with the given arguments.
@MainActor func generate(mainTemplate: String, arguments: [(any EcoreValue)?], models: [String : Resource]) async throws
Parameters
mainTemplate-
The name of the main template to execute
arguments-
The arguments to pass to the template
models-
The input models keyed by alias (e.g., “IN”, “LIB”)
Discussion
This is the primary entry point for MTL generation. It:
-
Resets statistics
-
Registers input models
-
Finds the specified main template
-
Executes the template with arguments
-
Finalizes the context
-
Records statistics
Example
var models: [String: Resource] = [:]
models["IN"] = inputModel
try await generator.generate(
mainTemplate: "main",
arguments: [modelRoot],
models: models
)