Model extensions support the re-use of sequences of frequently used statements. These model extensions are called by the defined name and shorten the code of plans and components. By default automaIT is delivered without any predefined model extensions.
Definition of Model Extensions
An XML file containing the statements has to be created. Its root element is
extensions. To define statements the element
command must be used.
These command elements contain:
- required and optional parameters
- block element that contains the content to be executed
The file has to be located in the file system of the server. Its location has to be referenced by the server property
Model extensions are unversioned, i.e. take caution when removing or changing a command.
Installation of Model Extensions
To use the custom extensions within automaIT use the server property
extensions.custom.xml in Tomcat's context.xml to reference to the extensions XML file.
Use of Model Extensions
Using the previously model extensions requires:
- add additional namespace xmlns:ext="http://www.novatec-gmbh.de/np/schemas/server/model/extension" to plan or component.
- use this namespace for the predefined statements, e.g.
The server property
extensions.protocol.prefix defines the namespace prefix used in the execution protocol of model extensions.
One should configure this variable, if another prefix than
ext is used to reference extension statements in the automaIT model code (for example using
The schema file of the custom extensions (
custom-extensions.xsd) can be downloaded in the automaIT web UI (Menu element: extensions) to support code validation and completion in the XML Editor.
To use advantages of auto completion and schema validation in the development environment for custom extensions as well the
custom-extensions.xsd must be registered in the XML catalog analog to
model.xsd, as described in Development Environment.