Data Mapper Utility (Magic xpi 4.5)
Magic xpi’s Data Mapper utility lets you create an association between records and fields in different formats and from different Sources using a visual mapping device.
You can use the Data Mapper to graphically represent the relationship between Source data elements and Destination data elements. This creates a way of manipulating the data without having to write any lines of code.
You define the Source and Destination formats in the Data Mapper utility's Source and Destination Properties panes. The Data Mapper can carry out any of the following actions:
-
Create or update files in XML, HTML, JSON, or Flat File formats.
-
Create, update, and delete a set of database records.
-
Call a flow and pass arguments.
Magic xpi provides Unicode support for the Data Mapper. For more information, see Unicode in the Data Mapper.
As per your XSD, elements which allow null values can be mapped and populated with null values within Magic xpi.
The following table shows the types of data that the Data Mapper can handle. Any Source can be mapped to any Destination.
|
|
XML: A valid XML should be specified according to a given XML Schema Definition (XSD).
|
XML: The XML output file is created according to a given XML Schema Definition (XSD).
|
Database: (Select statement): The Data Mapper supports Oracle, MSSQL, Pervasive, DB2, DB2400, and other databases (such as MySQL or Access) using the ODBC protocol. To use database information, you must define your databases in the database section of the Settings dialog box's Resources section.
|
Database: (Insert/Update/Delete statement): The Data Mapper supports Oracle, MSSQL, Pervasive, DB2, DB2400, and other databases (such as MySQL or Access) using the ODBC protocol. To use database information, you must define your databases in the database section of the Settings dialog box's Resources section.
|
Flat file: Parses a flat file according to a given structure and allows mapping of fields.
|
Flat file: Creates/appends data to a flat file according to a given structure.
|
Variable: Global, context, business process, and flow variables can be selected for the current flow.
|
Variable: Global, context, business process, and flow variables can be selected for the current flow.
|
ODS: Select ODS entries from the ODS repository. Also supports ODS arrays. You can only select one ODS entry.
|
ODS: Select ODS entries from the ODS repository. Also supports ODS arrays. You can only select one ODS entry.
|
UDS: Select UDS entries from the UDS Repository.
|
UDS: Select UDS entries from the UDS repository.
|
Call Flow: Call a flow for each occurrence in the Source. Arguments can be passed to the Destination flow. These arguments can contain defined variables of all types (flow, context, global, and business process).
|
Template: Create a new HTML file based on an HTML Template file.
|
JSON: During development, Magic xpi parses a JSON schema and displays its structure, with all data types and restrictions. If, during runtime, the JSON file is determined to be valid, the mapping is executed. If the validation process fails, the mapping is aborted.
|
JSON: During development, Magic xpi parses a JSON schema and displays its structure, with all data types and restrictions. During runtime, the JSON file is created by the Data Mapper and is then validated internally. If there is a mismatch in the validation process, an error is generated. This error can be seen in the C.sys.LastErrorInfo and C.sys.ErrorDescription system variables. However, if there is an error, the JSON file remains as it has already been created.
|
The Data Mapper supports multiple Sources and multiple Destinations. Multiple Sources can be mapped to a single Destination, or a single Source can be mapped to multiple Destinations. Multiple Sources can be mapped to multiple Destinations. Any of the available Source data types can be mapped to any of the available Destination types.
When using one Source and multiple Destinations in the Data Mapper, the actual database operation (such as Insert) is the last operation that is carried out, regardless of the order of the Destinations. This is problematic when you have two tables with a parent-child relationship. Instead, use separate Source-Destination pairs; the first should be the database operation and the second the call flow.
The Data Mapper is available as an individual flow step, but is also invoked automatically when you select XML as the Interface type during component configuration.
In addition, Magic xpi lets you convert data (string to string) by using a repository. For example, you can convert the string USD to $, every time it occurs, with the Data Converter. The Data Converter repository maintains the conversion table definitions, and stores the Source and Destination strings in a file. You can access this file by double-clicking the Data Converter repository in the Solution Explorer. The Data Converter tab opens in the main pane. The Data Converter repository is read from the files when the Magic xpi Server starts.
Notes:
|
-
Magic xpi does not handle mandatory fields. You should make sure that you set values for mandatory fields either by mapping or by defining an expression.
-
In most cases, a Data Mapper with a Database Source type and a Destination type that is set to anything other than Database does not open a transaction. (A transaction is opened when the Destination type is set to Database.) The only exception is where the Source type is a DB2/400 database and one of the selected fields' types is a BLOB.
|
Using the Data Mapper Utility
Source and Destination Properties Panes
Default Data Format Repository
Data Mapper Screen
Data Mapper Rules
Mapping Information from Databases
Mapping Data Using Merge Tags
Invoking the Data Mapper from a Flow Component Configuration
Data Mapper Error Handling
Data Mapper Troubleshooting
Data Mapper (How To section)