Skip to main content

Expander Mapping Scope

Expressions in a mapping file has access to a number of variables.

  • expansionSource: The target of the ExpanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.. An instance of the Composite class of the ElementType defined by the ExpanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..
  • {element}: The same value as expansionSource, but named after the ElementType. (e.g. dataElement)
  • {ancestor}: Any parent or ancestor in the model is also included. (e.g. component and applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution.)
  • expansionContext: A CompositeExpansionContext implementation with additional context information.
  • expander: The ExpansionComposite of the current ExpanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..
  • expansionResource: The ExpansionResourceComposite of the current expansion-resource bundle. Can be useful to retrieve the version of the expansion-resource.
  • module: If any, the ModuleComposite of the parent module. (Wraps Component or other ModuleType.)
  • program: The ProgramComposite of the program being expanded. (Wraps ApplicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. or other ProgramType.)
  • expansionConfiguration: The ExpansionConfigurationComposite for this expansion.

It also contains some support classes:

  • dataRegistry: A DataRegistryComposite It provides several methods to look up elements or data from DataResources.
  • classBuilder: A ClassBuilder instance, which can be used to wrap java class names in a queryable object. (e.g. classBuilder.from('some.java.Class') or classBuilder.from(dataElement)).
  • technologies: A TechnologyHelper instance, which can be used to look for technologies enabled for the program or module.
    • Use technologies.has('TECH') to check if a technology was included.
    • Use technology.get('TECH') to get the TechnologyComposite instance with the given name.
  • filters: A Filters instance that provides helpful filters.
    • filters.forLayer(layer) returns a predicate, which checks whether a Composite is included in that layerLayerLogical separation of functionality within a single system/application, focused on code organization. (does not have a no~Layer option for that layerLayerLogical separation of functionality within a single system/application, focused on code organization.).
Deprecated

Some variables are still available in the scope, but use is not recommended:

  • artifactName
  • globalOptionSettings
  • presentationSettings
  • technicalInfrastructure
  • businessLogicSettings

Extending the scope​

It is possible to define new variables in the mapping scope, which can be used in other mapping statements.

For this you can use a let statement. How to use this, can be found here.