Data Processor Transformation Development
Use the New Transformation wizard to auto-generate a Data Processor transformation, or create a blank Data Processor transformation and configure it later. If you create a blank Data Processor transformation, you must select to create a Script, XMap, Library, or Validation Rules object in the transformation. A Script can parse source documents to hierarchical format, convert hierarchical format to other file formats, or map a hierarchical document to another hierarchical format. An XMap converts an input hierarchical file into an output hierarchical file of another structure. A Library converts an industry messaging type into an XML document with a hierarchy structure or from XML to an industry standard format. Choose the schemas that define the input or output hierarchies.
- 1. Create the transformation in the Developer tool.
- 2. For a blank Data Processor transformation, perform the following additional steps:
- a. Add schema references that define the input or output XML hierarchies.
- b. Create a Script, XMap, Library, or Validation Rules object.
- 3. Configure the input and output ports.
- 4. Test the transformation.
Create the Data Processor Transformation
Create a Data Processor transformation in the Developer tool. If you create a blank Data Processor transformation, you must then create a Script, XMap, Library, or Validation Rules object in the transformation. Alternatively, you can use the New Transformation wizard to auto-generate a Data Processor transformation.
1. In the Developer tool, click File > New > Transformation.
2. Select the Data Processor transformation and click Next.
3. Enter a name for the transformation and browse for a Model repository location to put the transformation.
4. Select whether to create Data Processor transformation with a wizard or to create a blank Data Processor transformation.
5. If you selected to create a blank Data Processor transformation, click Finish.
The Developer tool creates the empty transformation in the repository. The Overview view appears in the Developer tool.
6. If you selected to create an Data Processor transformation with a wizard, perform the following steps:
- a. Click Next.
- b. Select an input format.
- c. Browse to select a schema, copybook, example file, or specification file if required for certain input formats such as COBOL, JSON, or ASN.1.
- d. Select an output format.
- e. Browse to select a schema, copybook, example file, or specification file if required for the output format.
- f. Click Finish. The wizard creates the transformation in the repository.
The transformation might contain a Parser, Serializer, Mapper, or an object with common components. If you selected a schema, copybook, example file, or specification file the wizard also creates a schema in the repository that is equivalent to the hierarchy in the file.
Select the Schema Objects
Choose the schema objects that define the input or output hierarchies for each XMap or Script component that you plan to create.
You can add schema references on the References view or you can add the schema references when you create Script or XMap objects. A schema object must exist in the Model repository before you can reference it in a Script or XMap.
1. In the Data Processor transformation Refererences view, click Add.
2. If the schema object exists in the Model repository, browse for and select the schema.
3. If the schema does not exist in the Model repository, click Create a new schema object and import a schema object from a hierarchical schema file.
4. Click Finish to add the schema reference to the Data Processor transformation.
Create Objects in a Blank Data Processor Transformation
Create a Script, Library, XMap, or Validation Rules object on the Data Processor transformation Objects view. After you create the object, you can open the object from the Objects view in order to configure it.
Creating a Script
Create a Script object and define the type of Script component to create. Optionally, you can define a schema reference and example source file.
1. In the Data Processor transformation Objects view, click New.
2. Enter a name for the Script and click Next.
3. Choose to create a Parser or Serializer. Select Other to create a Mapper, Transformer, or Streamer component.
4. Enter a name for the component.
5. If the component is the first component to process data in the transformation, enable Set as startup component.
6. Click Next if you want to enter a schema reference for this Script. Click Finish if you do not want to enter the schema reference.
7. If you choose to create a schema reference, select Add reference to a Schema Object and browse for the Schema object in the Model repository. Click Create a new schema object to create the Schema object in the Model repository.
8. Click Next to enter an example source reference or to enter example text. Click Finish if you do not want to define an example source.
Use a example source to define sample data and to test the Script.
9. If you choose to select an example source, select File and browse for the sample file.
You can also enter sample text in the Text area. The Developer tool uses the text to test a Script.
10. Click Finish.
The Script view appears in the Developer tool editor.
Creating an XMap
Create an XMap on the Data Transformation Objects view. When you create an XMap, you must have a schema that describes the input and the output hierarchal documents. You select the element in the schema that is the root element for the input hierarchy.
1. In the Data Processor transformation Objects view, click New.
2. Select XMap and click Next.
3. Enter a name for the XMap.
4. If the XMap component is the first component to process data in the transformation, enable Set as startup component.
Click Next.
5. If you choose to create a schema reference, select Add reference to a Schema Object, and browse for the Schema object in the Model repository.
To import a new Schema object, click Create a new schema object.
6. If you have a sample hierarchical file that you can use to test the XMap with, browse for and select the file from the file system.
You can change the sample hierarchical file.
7. Choose the root for the input hierarchy.
In the Root Element Selection dialog box, select the element in the schema that is the root element for the input hierarchal file. You can search for an element in the schema. You can use pattern searching. Enter *<string> to match any number of characters in the string. Enter ?<character>to match a single character.
8. Click Finish.
The Developer tool creates a view for each XMap that you create. Click the view to configure the mapping.
Creating a Library
Create a Library object on the Data Transformation Objects view. Select the message type, component and name. Optionally, you can define a sample message type source file that you can use to test the Library object.
Before you create a Library in the Data Processor transformation, install the library software package on your computer.
1. In the Data Processor transformation Objects view, click New.
2. Select Library and click Next.
3. Browse to select the message type.
4. Choose to create a Parser or Serializer.
Create a Parser if the Library object input is a message type and the output is XML. Create a Serializer if the Library object input is XML and the output is a message type.
5. If the Library is the first component to process data in the Data Processor transformation, enable Set as startup component.
Click Next.
6. If you have a sample message type source file that you can use to test the Library with, browse for and select the file from the file system.
You can change the sample file.
7. Click Finish.
The Developer tool creates a view for each message type that you create. Click the view to access the mapping.
Creating Validation Rules
Create a Validation Rules object in the Data Processor transformation Objects view.
1. In the Data Processor transformation Objects view, click New.
2. Select Validation Rules and click Next.
3. Enter a name for the Validation Rules.
4. If you have a sample XML file that you can use to test the Validation Rules with, browse for and select the file from the file system.
You can change the sample XML file.
5. Click Finish.
The Developer tool creates a Validation Rules object and opens it in the Validation Rules editor.
Adding an Example Source
Choose the example source to test the Script, XMap, Library, or Validation Rules that you plan to create.
You can add an example source when you create a Script, XMap, Library, or Validation Rules. Once selected, the example source is added to the Model repository. Due to Model repository limitations, the exaple source file size is limited to 5 MB.
You can change the example source.
Create the Ports
Configure the input and output ports in the Overview view.
When you configure additional input or output ports in a Script, the Developer tool adds additional input ports and additional output ports to the transformation by default. You do not add input ports on the Overview view.
1. If you want to return rows of output data instead of XML, enable Relational Output.
When you enable relational output, the Developer tool removes the default output port.
2. Select the input port datatype, port type, precision and scale.
3. If you are not defining relational output ports, define the output port datatype, port type, precision, and scale.
4. If a Script has additional input ports, you can define the location of the example input file for the ports. Click the Open button in the Input Location field to browse for the file.
5. If you enabled relational output, click Output Mapping to create the output ports.
6. On the Ports view, map nodes from the Hierarchical Output area to fields in the Relational Ports area.
Testing the Transformation
Test the Data Processor transformation in the Data Viewer view.
Before you test the transformation, verify that you defined the startup component. You can define the startup component in a Script or you can select the startup component on the Overview tab. You also need to have chosen an example input file to test with.
1. Open the Data Viewer view.
2. Click Run.
The Developer tool validates the transformation. If there is no error, the Developer tool shows the example file in the Input area. The output results appear in the Output panel.
3. Click Show Events to show the Data Processor Events view.
4. Double-click an event in the Data Processor Events view in order to debug the event in the Script editor.
5. Click Synchronize with Editor to change the input file when you are testing multiple components, each with a different example input file.
If you modify the example file contents in the file system, the changes appear in the Input area.