![]() |
![]() | ![]() | ![]() | Data Processing FunctionsMapForce® 2008 delivers powerful, flexible support for defining custom data mapping functions between source and target files. MapForce provides an extensible library of data processing functions for filtering and manipulating data according to the needs of your data mapping project. To save time and leverage work you’ve already completed and tested, you can even import existing data conversion code or an XSLT 1.0 or 2.0 file for use as a function library. MapForce also includes a unique visual function builder for defining custom functions that combine multiple operations.
Developing Custom Data Processing Functions
MapForce can handle the most advanced data conversion scenarios thanks to a comprehensive data mapping function library, which allows you to define mapping rules based on conditions, Boolean logic, string operations, mathematical computations, SQL and SQL/XML statements, or any user-defined function. You can even use an existing Web service to look up or process data in any mapping. In the screenshot below, the box between the lines joining the data source with the target contains a data processing function, which performs custom data manipulations on data elements before completing the mapping.
In this simple XML-to-XML mapping, the source XML Schema (Exp Report) has a Person data element that has the separate child elements First (first name) and Last (last name). However, the target XML Schema (Marketing Expenses) only has a single data element, FullName, for both the first and last name. Define a mapping that uses the concat (concatenation) data processing function, takes the data contained in two separate elements and combines them into a single data element to fit in the target. Parameterizing Transformations MapForce also supports transformation input parameters, which allow the input of outside parameters to affect mapping transformations. This is extremely useful when you want to use MapForce-generated transformations in your own data integration applications, and your mapping project includes filters that extract information from the data source in response to those input parameters. The transformation input parameters can be passed to the main mapping function created by the MapForce code generator in Java, C#, or C++. This parameterization of transformation code is a powerful new way to increase the flexibility of your mapping project and allows you to use MapForce for extremely complex and demanding applications. Function Library MapForce includes a comprehensive function library for building advanced data processing functions to perform any type of computational operation on data to make it adhere to the content model of the target. All functions are available in the library pane of the design window in a hierarchical tree structure that you can expand and collapse. Many of the built-in functions, such as concat, add, multiply, etc., support an unlimited number of parameters, making it easy to perform mathematical manipulations and combine multiple parameters in one easy step. Aggregate functions allow you to perform computations on entire groups of data, and then return a single value to the mapping target. These include count, sum, min, average, join-string, and others. Functions in the core library are generalized and not specific to any type of output. Using these core functions, you can create XSLT 1.0/2.0, XQuery, Java, C++, or C# data conversion code by simply selecting the language(s) you require. The figure below shows some of the functions available in the core library, including logical operators, mathematical functions, and common string operations.
Below the core library, MapForce displays only the libraries and functions that are available in the output language you have selected. If you switch languages and your mapping contains a function that is not available in that language, MapForce provides a clear warning. The data processing functions available in MapForce are completely extensible, and you can easily write your own function libraries, import an XSLT file to use as a function library, or turn existing data conversion code into a function library. For example, you can import the XSLT Standard Library, which is available for download here. You can also connect to Web services to look up or manipulate data before returning it to the mapping target. In addition, MapForce includes the powerful visual function builder for defining and saving complex functions. To use a data processing function, simply drag and drop the function that you would like to use from the function library onto the MapForce design window. Connect the desired elements from the source data model to the inputs of the data processing function, and connect the output of the data processing function to the target data model. MapForce supports advanced multi-stage data processing logic, meaning you can pass the output of one function into the input of another function, chaining them together as required, before completing the data transformation. Complex functions like this can be saved and reused via the visual function builder. Filters and Conditions Filters and conditions are available on the MapForce toolbar. Inserting these data processing functions into a mapping allows you to select data from the source based on Boolean conditions.
When you are working with a database as your mapping source, MapForce provides advanced support for SQL SELECT and WHERE statements, allowing you to insert mapping components based on these operators. Some data processing functions require you to supply a constant. For instance, you may need to insert a space when concatenating the data in two elements. You can add a constant to your mapping by clicking the “Insert constant” button on the toolbar. MapForce also allows you to provide default values to use for a particular element if the output of a mapping is null or absent. This allows you to create stringent if/then data processing rules in your mapping project to ensure that output data conforms to the target model. You may also need to transform the values of an input field into a different set of result data. For example, if months are represented by numbers in your mapping source, but you need them to be written as words in the target, you can configure the Value-Map function to map the numbers that correspond to the actual names of the months (1 to January, 2 to February, and so on). Double-clicking a value-map in a data mapping allows you to create a look up table representing the input and result values.
The Value-Map function can be used for many types of conditions; for example, if the source data is “Order Complete,” you can use the function to write “Send Invoice” to the target field, and so on. This function makes it easier to define precise mappings of XML, database, flat file, EDI, Excel 2007, and Web services data. Experience the ease with which you can create custom data processing functions for your data integration projects. Download a free trial of MapForce® 2008 today! | ![]() |
![]() | ![]() | ||||||||||||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | |||||
|
