= FDO RFC 22 - Enhance expression engine CONCAT function = This page contains an change request (RFC) for the FDO Open Source project. More FDO RFCs can be found on the [wiki:FDORfcs RFCs] page. == Status == ||RFC Template Version||(1.0)|| ||Submission Date|| June 25, 2008 || ||Last Modified|| Dan Stoica [[Timestamp]]|| ||Author||Bruce Dechant, Dan Stoica, Orest Halustchak|| ||RFC Status||draft|| ||Implementation Status||draft|| ||Proposed Milestone||3.4.0.0|| ||Assigned PSC guide(s)||Greg Boone|| ||'''Voting History'''|| || ||+1|| || ||+0|| || ||-0|| || ||-1|| || == Overview == This RFC is for adding an additional syntax to the CONCAT function of the expression engine. == Motivation == The existing CONCAT function syntax is difficult to work with when multiple concatenations need to be done. It requires the CONCAT functions be nested whenever a new item needs to be concatenated. == Proposed Solution == The proposed solution is to add support for an additional syntax to the CONCAT function. Old syntax: {{{ CONCAT ('Parcel ID: ', CONCAT ( PID , CONCAT ('\nOwner Name: ', CONCAT ( OWNER_NAME , CONCAT ('\nAddress: ', SITE_ADDR ))))) }}} New syntax: {{{ CONCAT ('Parcel ID: ', PID , '\nOwner Name: ', OWNER_NAME, '\nAddress: ', SITE_ADDR ) }}} The new syntax will consist of a comma delimited list of concatenation items. In terms of API changes, the following addition to FdoFunctionDefinition class is proposed: FdoFunctionDefinition.h {{{ class FdoFunctionDefinition : public FdoIDisposable { ... public: /// \brief /// Indicates that this object allows its list of arguments to be variable so the /// last argument may be repeated. /// /// \return /// Returns false /// FDO_API virtual bool FdoFunctionDefinition::SupportsVariableArgumentsList() { return false; } }}} FdoFunctionConcat will override SupportsVariableArgumentsList() to return true instead. It will relax the check for allowed number of literal values passed in for evaluation. FdoFunctionConcat.h {{{ /// Indicates that this object allows its list of arguments to be variable so the /// last argument may be repeated. /// virtual bool SupportsVariableArgumentsList() { return true; } }}} == Implications == The existing CONCAT function syntax will continue to be supported in addition to the new syntax. The client UI has the means to display "..." by checking the new method. == Test Plan == Test that the existing and new CONCAT function syntax work. Update the Expression Engine unit test to exercise CONCAT with extra arguments. == Funding/Resources == Autodesk to provide resurces / funding.