\page MeasurementRules
\section rules_com_highqsoft_moma_rules_mearules_AddLiteralsRule AddLiteralsRule
\addindex AddLiteralsRule
This rule is used to add attributes with a constant value or change the value of an existing
attribute to a constant. If an attribute does not exist it is created, otherwise the value
or the existing attribute is changed.
If you do not supply values for the attributes they will be created with the specified data type
and the flag will be set to 0 (INVALID). This is useful to create attributes that will be populated
by subsequent measurement rules.
\subsection AddLiteralsRuleProperties Properties
\addindex AddLiteralsRule Properties
The AddLiteralsRule is initzialized with the following properties:
\li \b MeasurementHolderRef (required)
The name of the reference in the context where the MeasurementHolder instance that is used
as input for the rule is stored.
\li \b ResultRef (optional, MeasurementHolderRef)
The name of the reference in the context where the resulting MeasurementHolder instance
is stored. If it is omitted the resulting MeasurementHolder instance replaces the input
instance.
\li \b DumpFilePath (optional, no default)
The directory where the dumpfiles are created. If this Property is set and is not an
empty string the rule creates a dump of all modified ElementHolders. The
dump files are named "\
_\_*.dmp.
\li \b SplitChar (optional, default " ")
The character used to split the attribute name lists below. If there are attribute names
with spaces another split character must be used.
\li \b IgnoreIfEmpty (optional, default false)
If true, attributes without values are not added. "Without value" means, the string representation of the
value is the empty String.
\li \b IgnoreUnresolvedProperties (optional, default false)
If true, attributes with an unresolved property as value are ignored. If an attributes value is
${prop} and it cannot be resolved, the attribute value is not set if this property is true, otherwise
the attribute value is set to the literal value ${prop}.
\li \b AoMeasurementAttrNames (optional)
The list of measurement attribute names that will be added or changed.
\li \b AoMeasurementAttrValues (optional)
The list of values for the attributes listed in AoMeasurementAttrNames.
The length of the list must match the length of AoMeasurementAttrNames.
If \e AoMeasurementAttrValues is given and \e AoMeasurementAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoMeasurementAttrDatatypes (required if AoMeasurementAttrNames is given)
The list of datatypes for the attributes listed in AoMeasurementAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoMeasurementAttrNames.
\li \b AoMeasurementQuantityAttrNames (optional)
The list of measurement quantity attribute names that will be added or changed.
\li \b AoMeasurementQuantityAttrValues (optional)
The list of values for the attributes listed in AoMeasurementQuantityAttrNames.
The length of the list must match the length of AoMeasurementQuantityAttrNames.
If \e AoMeasurementQuantityAttrValues is given and \e AoMeasurementQuantityAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoMeasurementQuantityAttrDatatypes (required if AoMeasurementQuantityAttrNames is given)
The list of datatypes for the attributes listed in AoMeasurementQuantityAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoMeasurementQuantityAttrNames.
\li \b AoSubmatrixAttrNames (optional)
The list of submatrix attribute names that will be added or changed.
\li \b AoSubmatrixAttrValues (optional)
The list of values for the attributes listed in AoSubmatrixAttrNames.
The length of the list must match the length of AoSubmatrixAttrNames.
If \e AoSubmatrixAttrValues is given and \e AoSubmatrixAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoSubmatrixAttrDatatypes (required if AoSubmatrixAttrNames is given)
The list of datatypes for the attributes listed in AoSubmatrixAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoSubmatrixAttrNames.
\li \b AoLocalColumnAttrNames (optional)
The list of local column attribute names that will be added or changed.
\li \b AoLocalColumnAttrValues (optional)
The list of values for the attributes listed in AoLocalColumnAttrNames.
The length of the list must match the length of AoLocalColumnAttrNames.
If \e AoLocalColumnAttrValues is given and \e AoLocalColumnAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoLocalColumnAttrDatatypes (required if AoLocalColumnAttrNames is given)
The list of datatypes for the attributes listed in AoLocalColumnAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoLocalColumnAttrNames.
\li \b AoUnitAttrNames (optional)
The list of unit attribute names that will be added or changed.
\li \b AoUnitAttrValues (optional)
The list of values for the attributes listed in AoUnitAttrNames.
The length of the list must match the length of AoUnitAttrNames.
If \e AoUnitAttrValues is given and \e AoUnitAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoUnitAttrDatatypes (required if AoUnitAttrNames is given)
The list of datatypes for the attributes listed in AoUnitAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoUnitAttrNames.
\li \b AoQuantityAttrNames (optional)
The list of quantity attribute names that will be added or changed.
\li \b AoQuantityAttrValues (optional)
The list of values for the attributes listed in AoQuantityAttrNames.
The length of the list must match the length of AoQuantityAttrNames.
If \e AoQuantityAttrValues is given and \e AoQuantityAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoQuantityAttrDatatypes (required if AoQuantityAttrNames is given)
The list of datatypes for the attributes listed in AoQuantityAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoQuantityAttrNames.
\li \b AoPhysicalDimensionAttrNames (optional)
The list of physical dimension attribute names that will be added or changed.
\li \b AoPhysicalDimensionAttrValues (optional)
The list of values for the attributes listed in AoPhysicalDimensionAttrNames.
The length of the list must match the length of AoPhysicalDimensionAttrNames.
If \e AoPhysicalDimensionAttrValues is given and \e AoPhysicalDimensionAttrValues is not specified the
attributes will be created and set to \e INVALID.
\li \b AoPhysicalDimensionAttrDatatypes (required if AoPhysicalDimensionAttrNames is given)
The list of datatypes for the attributes listed in AoPhysicalDimensionAttrNames. If the datatypes
do not match the datatypes of the target ODS model they will be converted when the attributes are written.
The length of the list must match the length of AoPhysicalDimensionAttrNames.
Properties for an element (for example AoMeasurement) must always be specified at least with attribute names
and data types and must have
the same number of list elements. If there is no mapping needed for an application element the properties
for this element can be omitted.
\subsection AddLiteralsRuleExample Example
\addindex AddLiteralsRule Example
The example below is called from the \ sequence in a modelmapper control file.
It is used to add some literal values to attributes to measurements and local columns.
\code
\endcode
\subsection AddLiteralsRuleMomaMethods Methods used within the Modelmapper
\addindex AddLiteralsRule Modelmapper Rules
\li void execute()
The execute() method loops over all Instance Elements stored in the
MeasurementHolder and adds the attributes specified.