Documentation MetaData

From RLIB

Jump to: navigation, search

MetaData

<MetaData> allows you to define result set data types. All fields come to XML as strings, it's handy to translate them ahead of time. Generic documentation is under MetaData section in Report XML Definition. Example:

    <MetaData>
        <MetaData name="split_shift_bonus" value="val(split_shift_bonus)"/>
        <MetaData name="method" value="val(method)"/>
        <MetaData name="start_of_day" value="tstod(start_of_day)"/>
    </MetaData>

MetaData is similar to #define in the C language:

    #define split_shift_bonus     val(split_shift_bonus)
    #define method                val(method)
    #define start_of_day          tstod(start_of_day)

A defined symbol is substituted in expressions with its value in one pass. MetaData affects all expressions, including variables. You can have the same MetaData name as your data source field names. If you use metadata you can convert your resultset field values in one place and not spread out all over expressions. So instead of writing "tstod(start_of_day)" (as in the 3rd example line above), defining a MetaData for it and using the defined MetaData name later makes your report XML readable and maintainable.

Personal tools