Motivation

This enhancement is to allow an application using an FDO expression to generate different values from a boolean expression. Typically this is to generate a different string value from a boolean expression. The MapGuide? stylization engine includes a similar function, but it is not available at the FDO level and will be useful for users at this level.

Overview

This RFC proposes a new FDO expression function called IF that takes a boolean expression and chooses between two data values for the output. This function will be based on the stylization function and will be a migration of that implementation.

Proposed Solution

Define a new FDO Expression function called IF.

///
/// Result, ValueIfTrue, and ValueIfFalse are the same data type. They can be any FDO numeric, string, or date/time data type.
/// If Boolean Expression evaluates to true, then ValueIfTrue is returned. If Boolean Expression evaluates to false or is null,
/// then ValueIfFalse is returned.
Result = IF(Boolean Expression, ValueIfTrue, ValueIfFalse)
///
/// E.g. IF(BoolProperty, ‘Oui’, ‘Non’) would generate ‘Oui’ if BoolProperty is true, otherwise ‘Non’.
/// E.g. IF(BoolProperty, 1, -1) would generate 1 or -1.