The value of a constant is specified in the CDATA section of the <dataitem> XML element. The following example defines a time span constant of ten minutes:
<constant>
<dataitem>
10 MINUTE
<datatype name="TIMESPAN"></datatype>
</dataitem>
</constant>
If the entries for the data type and value of the constants are correct, possible entries in the value attribute for the <dataitem> element are ignored. The following definition creates a constant of two hours:
<constant>
<dataitem value="9">
2 HOUR
<datatype name="TIMESPAN"></datatype>
</dataitem>
</constant>
If the entry in the CDATA section of the <dataitem> element returns no value or a value with an invalid data type, it is ignored. Instead, the entries in the value XML attribute are processed. In the following example, the value of the constant with the DOUBLE data type is specified, although the LONG data type is expected. The incorrect value entry is ignored and the value of the value attribute ("2") is written to the constant instead:
<constant>
<dataitem value="2">
4.0
<datatype name="LONG"></datatype>
</dataitem>
</constant>
If the value specified in the value attribute does not match the expected data type, the calculation is canceled:
<constant>
<dataitem value="2.4">
4.0
<datatype name="LONG"></datatype>
</dataitem>
</constant>
In the following example the calculation is canceled, as the data type and the value specified do not match and there is no entry in the value XML attribute:
<constant>
<dataitem>
4.0
<datatype name="LONG"></datatype>
</dataitem>
</constant>
A constant must always be specified with the unit that is permissible for the attribute data type. The data type must be known in the PPM system.
Numerical constants consist of the specification of the value with a unit that is permissible for the data type and the data type itself.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE keyindicatorconfig SYSTEM 'KeyindicatorConfiguration.dtd'>
<keyindicatorconfig>
...
<calcattr name="..." type="...">
<calculation>
...
<constant>
<dataitem>
10 MINUTE
<datatype name="TIMESPAN"></datatype>
</dataitem>
</constant>
...
</calculation>
</calcattr>
...
</keyindicatorconfig>
XML element |
Description |
---|---|
dataitem value |
Value of constant with unit |
datatype name |
Name of the data type. Both internal and user-defined data types can be used. |
Alphanumeric constants are specified as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE keyindicatorconfig SYSTEM
'KeyindicatorConfiguration.dtd'>
<keyindicatorconfig>
...
<calcattr name="..." type="...">
<calculation>
...
<constant>
<dataitem>
Constant text
<datatype name="TEXT"/>
</dataitem>
</constant>
...
</calculation>
</calcattr>
...
</keyindicatorconfig>