![Start of change](../../delta.gif)
Using regular expressions to modify the mapping file
You can optionally request that the mapping file produced by the export process is automatically modified by the import process, according to rules defined using regular expressions.
The mapping file produced by the export process of a workload application contains a list of elements, some of
which are dependent on the topology of the environment in which it is used. These elements need to
be customized to match the target environment. When the import process is performed from the
wappman command line, you can optionally request that the mapping file is automatically
modified according to rules defined using regular expressions and specified in one of the following
ad-hoc files:
- workload applicationname_BasicRegExpMapping.UTF8.rules
- This file contains rules defined using basic regular expressions that include only '*' and '?' wildcard characters.
- workload applicationname_AdvancedRegExpMapping.UTF8.rules
- This file contains rules defined using advanced regular expressions according to Java standards. For additional details about advanced regular expressions, see the related documentation.
Select the file that better fits your needs and customize the regular expressions according to the names that the objects will have in the target environment. The import process, performed from the wappman command line, then applies the defined rules to modify the value of the elements included in the mapping file.
Each file is organized in sections, one for each type of object that can be contained in a
workload application. For each section, you can
find comments including examples of rules, defined using regular expressions, that apply to the
specific object. For example:
[JOBSTREAM]
#*_DEV=*_PRD
#A24Y?=B42X?
Uncomment the provided examples or add your own rules. For example:
[JOBSTREAM]
*_DEV=*_PRD
A24Y?=B42X?
J*=A*
Each rule is composed of two
regular expressions. The regular expression on the left defines the search pattern, the regular
expression on the right defines the replacing value of each matching element. During the import
process, both the search and the replace actions are performed on the value of the elements included
in the mapping file. If an object of your workload application matches more than one entry in the file, only the rule
included in the last matching entry is applied. For example:
According to the above rules:
- the job stream JS1_DEV is renamed as AS1_DEV
- the job stream CCB_DEV is renamed as CCB_PRD
- the job stream A24YK is renamed as B42XK
![End of change](../../deltaend.gif)