The Input to the tooling is data transformation information captured in:
1) an Excel Spreadsheet (CSV) which is discussed first this article OR
2) a json format file OR
3) an XML format file (a WebSphere ESB Business Object Map was used in the prototype)
Two and three above are recently added alternatives discussed later in the article.
Figure 1. Example CSV input
A DFDL schema is used by the tooling to parse the CSV data. You’ll see the first row is a header row containing information about the source and target objects and parsers. After that we have repeating rows of element mapping definitions.
The DFDL schema for the CSV data.
Figure 2. DFDL Schema definition
The Output is an IBM GDM .MAP file ready to be deployed.
Figure 3. IBM GDM image output
The tool uses the standalone Java DFDL Parser classes to parse a comma delimited (CSV) file. It then leverages JAXB against the published MSL.XSD schema file for the IBM GDM.
Currently, the tool supports simple single input schema, single output schema maps. It concentrates on building the element relationships. It currently supports MOVE, ASSIGN and FN:CONCAT( for two input fields to one output field).
The collateral supporting MOVE, ASSIGN and FN:CONCAT is available from GitHub:
https://github.com/DAVEXACOM/IBMGraphicalDataMapGenerator
Possible uses for this tooling
1) Automated Integration Delivery in conjunction with Patterns based development.
2) Converting transformation logic from other integration tools (from other vendors) to an IBM GDM deployable to IBM Integration Bus and potentially IBM Datapower.
Running the tool – using the CSV as input meta-data
The Java class ParseMetaSerialMSL contains both the DFDL CSV Parser code and the JaxB serialize to MSL (XML) code. (It should be noted that as far as Java development goes…. I was a pretty average COBOL programmer back in the early 90s).
The ParseMetaSerialMSL.java class is the executable code and provides demonstration on how to use the standalone DFDL Java parser and leverage JaxB Java code against JaxB Objects generated by the IIB Toolkit from the IBM GDM MSL.XSD XML schema.
ParseMetaSerialMSL.java reads the IOMapModelMetaCSV.xsd (DFDL model) and IOMapModelMeta.csv the source file containing the definitions of the mapping to be performed from the GDMGenerator project. It writes out a inmodel_outmodel.map file. The .map file and the XSDs for the input and output schemas are in the GeneratedMapTargetApp application project.
From the IIB Toolkit (Java Perspective) open the ParseMetaSerialMSL.java source and “Run as Java Application”.
Figure 4. ParseMetaSerialMSL class
Check the console to review the XML output and a successful run.
Switch to the Integration perspective and you will see the
Figure 5. Generated Map Target App project before execution
Refresh the GeneratedMapTargetApp project and open the newly created inmodel_outmodel.map
Figure 6. Generated Map Target App project after execution
Running the tool – using the JSON as input meta-data
The ParseJSONSerialMSL.java class is the executable code and provides demonstration on how to convert a json file to java object and leverage JaxB Java code against JaxB Objects generated by the IIB Toolkit from the IBM GDM MSL.XSD XML schema.
ParseJSONSerialMSL.java reads the IOMapModelMetaCSV.json source file containing the definitions of the mapping to be performed from the GDMGenerator project. It writes out a inmodel_outmodelfrom_JSON.map file. The .map file and the XSDs for the input and output schemas are in the GeneratedMapTargetApp application project.
From the IIB Toolkit (Java Perspective) open the ParseJSONSerialMSL.java source and “Run as Java Application”.
Check the console to review the XML output and a successful run.
Switch to the Integration perspective
Refresh the GeneratedMapTargetApp project and open the newly created inmodel_outmodel_fromJSON.map
Running the tool – using the XML (WESB BO Map) as input meta-data
The ParseBOXMLSerialMSL.java class is the executable code and provides demonstration on how to leverage JaxB to unmarshal an XML file (WESB BO Map) to Java Objects generated in the IIB Toolkit from an XSD generated from an example BO Map (not the definitive BO Map schema). It then leverages JaxB Java code against JaxB Objects generated by the IIB Toolkit from the IBM GDM MSL.XSD XML schema and marshals the Java to produce the GDM map.
ParseBOXMLSerialMSL.java reads the WESB_mesBlastBlockMessageType_To_Blastblock_Submap.map source file containing the definitions of the mapping to be performed from the GDMGenerator project. It writes out a WESB_mesBlastBlockMessageType_To_Blastblock_Submap.map file in the GeneratedMapTargetApp application project. The the XSDs for the input and output schemas are in the GeneratedMapTargetApp application project.
ParseBOXMLSerialMSL.java supports Move and CustomJava. To support CustomJava I have created a “placeholder” Java project and called GeneratedMapTargetJava and class called placeholder. This allows me to configure the IBM GDM CustomJava mapping with a target class and method. The Java code from the BO Map is copied into the Documentation field for that mapping. So this would have to be refactored by hand post conversion.
From the IIB Toolkit (Java Perspective) open the ParseBOXMLSerialMSL.java source and “Run as Java Application”.
Check the console to review the XML output and a successful run.
Switch to the Integration perspective
Refresh the GeneratedMapTargetApp project and open the newly created WESB_mesBlastBlockMessageType_To_Blastblock_Submap.map file.
Wrap Up
As mentioned, this is prototype tooling and demonstrates how to use:
1) the standalone DFDL Java parser OR
2) a Json to Java converter OR
3) a JaxB unmarshaller
and JaxB code against the published Map Specification Language schema (MSL.XSD) to create IBM GDM Maps based on some meta-data. I chose to capture my mapping meta-data in:
1) an Excel Spreadsheet OR
2) a json format file
3) an XML file (WESB BO Map)
out of convenience but you may have Business Analysts or Data Architects that use other tools to capture data transformation requirements. Meta-data from those tools could be used in a similar way. Or perhaps harvest meta-data from an existing non-IBM data mapping tool.