Path maps are variables that allow URIs to be more portable. A URI can contain a path map variable that can be resolved to different values in different environments. Here is an example of a model reference that uses a URI that contains a path map variable "RT_SAMPLE_LIB":
href="pathmap://RT_SAMPLE_LIB/RTSampleCustomLibrary.emx#_FPfjMF83EeiD6r1CftWc8g?RTSampleCustomLibrary/BaseA?"
Path map variables can be defined in the Model RealTime preferences (Modeling – Path maps).
The model compiler needs access to the values of all path map variables that are used within the built model. The command-line option --pathmap
should be used to specify a file that contains the path map variables and their values. The easiest way to get such a file is to generate it from inside Model RealTime. There is a button on the RealTime Development preference page that allows you to do this.
The file is in the following form:
[map]
<variable>
…
<variable>
Each
Note: NAME is the path variable name, and all paths should use '/' as separator (also on Windows).
NAME=file:/<path to folder>
For a file located in a folder
NAME=jar:file:/<path to jar file>!/<path to folder within jar file>
For a file located inside a JAR file.
pathmap://NAME/<file name>=file:/<path to file>
This syntax allows you to map a certain pathmap URI to a specific file located in a folder.
pathmap://NAME/<file name>=jar:file:/<path to jar file>!/<path to file within jar file>
This syntax allows you to map a certain pathmap URI to a specific file located in a JAR file.
It is possible to use environment variables within path map variable definitions. Use the syntax ${VAR}
or $(VAR)
. Environment variables are substituted first before parsing the path map variable definition.
You can use comments in the file, and write them in a line that starts with "#".
Here are some examples of path map variable definitions:
Description | Mapping |
---|---|
Mapping of path map variable to folder in jar archive | [map] RT_SAMPLE_LIB = jar:file:/D:/work/tmp/plugins/sample.jar!/libraries |
Direct mapping of pathmap URI to physical file | [map] pathmap://RT_SAMPLE_LIB/RTSampleCustomLibrary.emx = file:/D:/tmp/sample.emx |
Direct mapping of pathmap URI to file within jar archive | [map] pathmap://RT_SAMPLE_LIB/RTSampleCustomLibrary.emx = jar:file:/D:/tmp/pathmap.jar!/entry2.emx |
Mapping of path map variable to folder in the file system | [map] RT_SAMPLE_LIB = file:/D:/work/tests/com.hcl.test.profiles.and.libs/libraries |