WSO2 Data Mapper is an independent component that does not depend on any other WSO2 product. However, other products can use the Data Mapper to achieve/offer data mapping capabilities. Data Mapper Mediator is the intermediate component you need for that, which gives the data mapping capability into the ESB profile of WSO2 EI.
Data Mapper mediator finds the configuration files from the Registry and configures the Data Mapper Engine with the input message type (XML/JSON/CSV) and output message type (XML/JSON/CSV). Then it takes the request message from the WSO2 EI message from the ESB profile message flow and uses the configured Data Mapper Engine to execute the transformation and adds the output message to the EI message ESB profile message flow.
The Data Mapper mediator is a content-aware mediator.
You need to install the WSO2 Developer Studio EI Tool 5.0.0 EI Tooling to use the Data Mapper mediator. For instructions on installing this WSO2 EI Tooling Plugin, see Installing WSO2 EI Tooling.
The parameters available for configuring the Data Mapper mediator are as follows.
|Mapping Configuration||The file, which contains the script file that is used to execute the mapping. You need to create a mapping configuration file using the Dev Studio-based Tooling plugin, and store it either in the Configuration Registry or Governance Registry, to select and upload it from here.|
|Input Schema||JSON schema, which represents the input message format. You need to create an input schema file using the Dev Studio-based Tooling plugin, and store it either in the Configuration Registry or Governance Registry to select and upload it from here. |
|Output Schema||JSON schema, which represents the output message format. You need to create an output schema file using the Dev Studio-based Tooling plugin, and store it either in the Configuration Registry or Governance Registry to select and upload it from here.|
|Input Type||Expected input message type (XML/JSON/CSV)|
|Output Type||Target output message type (XML/JSON/CSV)|
You can configure the mediator using XML. Click switch to source view in the Mediator window.
When loading a sample input XML file, you cannot have the default namespace (i.e. without a prefix in the namespace element). Also, you need to use the same prefix in all occurrences that refer to the same namespace within one XML file. For example, see the use of the prefix
For example, the Data Mapper mediator provides EI properties like
axis2/transport/synapse/axis2client/operation/.. In the Data Mapper diagram, you can use the Property operator and define the scope and the property name and use it in the mapping. Then, the Data Mapper mediator will identify the required properties to execute the mapping and populate a map with the required properties and will send it to the Data Mapper Engine.