Retrieving values from DMX files for database insertion

The Data Manager uses the <row> level remove attribute to determine if an entry will be inserted onto the database for that row. If the remove attribute is set to true, then the Data Manager will not insert an entry for that row. The row will be ignored.

DMX files store the locale information for the attributes for the database table. As the database must be built for only one locale, the Data Manager uses the curam.dmx.locale property to determine the locale that must be used when inserting data specified in DMX files onto the database. This property can be set in either the Bootstrap.properties file or as a system variable. If set in both the Bootstrap.properties file and as a system variable, the system variable will override the setting in the Bootstrap.properties file. This property must be set to a valid locale, i.e. in the format language_Country, where language is mandatory and country is optional. For example,

curam.dmx.locale=en_US

If this property is not set, the infrastructure will fallback on the en locale.

As mentioned, the Data Manager processing uses the curam.dmx.locale to determine the value to insert for an attribute in a DMX file. The locale can be specified at a <row> or <attribute> level. If specified at a row level, then this takes precedence over the attribute level. For example, given the following:

<?xml version="1.0" encoding="UTF-8"?>
<table name="CONCERN">
  <column name="CONCERNID" type="id"/>
  <column name="NAME" type="text"/>
  <column name="COMMENTS" type="text"/>
  <row>
    <attribute name="CONCERNID">
      <value>1</value>
    </attribute>
    <attribute name="NAME">
      <value/>
    </attribute>
    <attribute name="COMMENTS">
      <value>Concern 1 core</value>
    </attribute>
  </row>
  <row locales="en_GB">
    <attribute name="CONCERNID">
      <value>2</value>
    </attribute>
    <attribute name="NAME">
      <value/>
    </attribute>
    <attribute name="COMMENTS">
      <value language="fr">Concern 2 French core</value>
      <value language="en"
                country="GB">Concern 2 en_GB core</value>
    </attribute>
  </row>
</table>

In this example, if the curam.dmx.locale environment variable is set to the fr locale, then there will be no entry inserted for the record where CONCERNID is set to 2, as the locales attribute for the <row> is only applicable for the en_GB locale, even though the attribute for COMMENTS has an entry for the fr locale.

The Data Manager attempts to match the locale specified by the curam.dmx.locale environment variable with the locales attribute for the <row> element within a DMX file. If this attribute is not set, then the Data Manager attempts to match on the <value> for an <attribute>, i.e. it tries to match on the language and country attributes of the <value> element.

Since DMX files are not guaranteed to contain an entry for every locale, a fall back mechanism is in place. This fallback mechanism is only applicable to the attribute <value> element, i.e. it is not applicable to the <row> locales attribute. Once a <value> has been found and there is no direct match with the locale specified by curam.dmx.locale, the rules for fall back are as follows:

Figure 1. Locale Fallback Example
<row>
      <attribute name="ADDRESSELEMENTID">
        <value>3227</value>
      </attribute>
      <attribute name="ELEMENTTYPE">
        <value language="en">EN_TYPE</value>
        <value country="US" language="en">EN_US_TYPE</value>
      </attribute>
      <attribute name="ELEMENTVALUE">
        <value language="fr">French Value</value>
      </attribute>
   </row>

In Retrieving values from DMX files for database insertion, lets assume the curam.dmx.locale is set to en. The following is set for each attribute: