wiki:FDORfc44

FDO RFC 44 - Add IF Expression Function

This page contains an change request (RFC) for the FDO Open Source project. More FDO RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission Date Nov. 10, 2009
Last Modified Orest Halustchak Timestamp?
AuthorOrest Halustchak
RFC StatusNot Ready for Review
Implementation Statusdraft
Proposed Milestone3.5.0.0
Assigned PSC guide(s)Orest Halustchak
Voting History
+1
+0
-0
-1

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.

Provider Implementation

TBD.

Test Plan

Expand unit tests to test the proposed enhancements defined above.

Funding/Resources?

Autodesk to provide resources / funding.

Last modified 8 years ago Last modified on Nov 10, 2009 10:28:22 AM