Element <include>¶
Zweck: Bindet einen weiteren Descriptor oder eine Properties-Ressource in den aktuellen Setup-Scope ein.
Warum: Verwende dieses Element, um Descriptoren oder Properties wiederzuverwenden, statt Konfiguration zu kopieren.
Beispiel¶
1 | |
Entscheidungshilfe¶
Fachlicher Nutzen: Hält gemeinsame Modellfragmente und umgebungsspezifische Properties ohne Kopieren wiederverwendbar.
-
Verwenden, wenn
- Wenn mehrere Descriptoren ein Fragment oder eine Properties-Datei teilen.
- Wenn URI oder Properties dynamisch ausgewählt werden.
-
Anderen Ansatz wählen, wenn
- Wenn der Inhalt nicht vertrauenswürdig ist oder einmalig inline verständlicher bleibt.
-
Voraussetzungen
- Halte den Include-Pfad im Descriptor-Workspace und deklariere referenzierte Properties vorher.
-
Alternativen
- Halte einen kleinen einmaligen Ablauf direkt im owning setup. (Siehe:
<setup>)
- Halte einen kleinen einmaligen Ablauf direkt im owning setup. (Siehe:
Vollständige Beispiele¶
Ein typisiertes Descriptor-Fragment mit lokalen Parametern aufrufen
Verwende einen param-Vertrag und include-lokale Properties, wenn mehrere fachliche Produkte dieselbe Modellform mit unterschiedlichen begrenzten Werten nutzen.
| parameterized-fragment/fragments/payment.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 | |
| parameterized-fragment/datamimic.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 | |
Regeln und ungültige Kombinationen¶
I201 — Include File Not Found
Include file '{uri}' not found in task workspace
Warum: The referenced configuration could not be found for the include configuration.
Lösung: Ensure the referenced file exists and the identifier/path is correct.
I202 — Include Properties Parse Failed
Failed to parse include properties file '{uri}': {error}
Warum: The system failed to parse include properties file '{uri}': {error}.
Lösung: Fix the input format and retry.
I203 — Include Unsupported File Type
Unsupported include file type '{uri}'. Only .properties and .xml are supported
Warum: The configuration uses an unsupported include file type '{uri}'. Only .properties and .xml are supported.
Lösung: Use a supported file or adjust the configuration.
I204 — Include Unsupported File Type Generate
Unsupported include file type '{uri}' inside
Warum: The configuration uses an unsupported include file type '{uri}' inside
Lösung: Use a supported file or adjust the configuration.
I205 — Include Condition Not Boolean
Condition '{condition}' for include '{uri}' evaluated to a non-boolean value (not a valid boolean value): {value}
Warum: A condition evaluated to a non-boolean value in the include configuration.
Lösung: Ensure the expression evaluates to true or false.
I206 — Include Condition Eval Failed
Failed to evaluate condition '{condition}' for include '{uri}': {error}
Warum: The system failed to evaluate condition '{condition}' for include '{uri}': {error}.
Lösung: Fix the expression or script and retry.
I207 — Include Path Outside Descriptor
Include path '{uri}' is outside descriptor directory '{descriptor_dir}' or violates relative-path policy: {reason}
Warum: The include path is outside the descriptor directory or does not follow relative-path requirements.
Lösung: Use a relative include path under descriptor_dir.
I208 — Include Dynamic Properties With Overlay
Include '{uri}' resolved to a .properties file, but
Warum: The include resolved to a .properties file even though the descriptor configured XML-only property overlays.
Lösung: Remove the
I616 — Parser Include Property Duplicate
Duplicate
Warum: The include configuration defines the same scoped property name more than once.
Lösung: Remove or rename the duplicate
I617 — Parser Include Property On Properties
Element
Warum: Scoped include properties are only supported when the include target is an XML descriptor.
Lösung: Remove the
I618 — Parser Include Param Missing
Fragment contract violation for
{contract_table}
{missing_summary}
Warum: The included fragment declares required params that were not supplied by the caller.
Lösung: Supply the missing
I619 — Parser Include Param Invalid Value
Invalid value for param '{param_name}' in
Warum: The include caller supplied a literal value that does not satisfy the fragment param contract.
Lösung: Update the
Erlaubte Elternelemente / Erlaubte Kindelemente¶
Erlaubte Elternelemente: else, else-if, generate, if, iterate, setup, while
Erlaubte Kindelemente:
property
Zugehörige Konzepte und Anwendungsfälle¶
- Dynamische Includes und Fragmentparameter — Explains URI interpolation, scoped include properties, typed fragment params, runtime caller context, nesting, conditions, and cataloged failures for reusable XML composition.
- Erstes DATAMIMIC-Modell — Builds the smallest model and then composes preparation and generation stages.
Attribute¶
Alle 2 Attribute anzeigen
condition
Condition expression to evaluate whether to include this file.
optional; string; Standardwert: null.
uri
URI of the file to include.
erforderlich; string.