User Guide > Process Steps and Components > Transformer Step > Automatic Mapping Transformer
Was this helpful?
Automatic Mapping Transformer
Automatic Mapping Transformer lets you automatically map source and target fields by relative position, field names, or by direct duplication of the source layout in the target. Automatic Mapping Transformer then executes the simple transformation.
Once you create the transformation by specifying the source and target connection and the method for the source-to-target field mapping, the functionality is similar to executing a default conversion using djengine.
The transformer converts a single source record layout to a single target record layout. The connection string also supports authentication.
Note:  You cannot auto-map anything that requires you to add a schema. This component can only be used for simple files that contain single records with built-in schema or single database/table.
Supported Actions
Action
Description
Execute
Executes the supported action parameters and properties.
DJMessage objects can be used as either the Source or the Target. For more information, see Using a DJMessage Object with a Map.
Supported Action Parameters
Action
Parameter
Description
Execute
Source Message
Name of the source message.
Execute
Target Message
Name of the target message.
 
Supported Action Properties
Action
Properties
Description
Execute
Source Connector
This property provides a drop down list of connectors to assist in connecting to the source dataset or table.
Source Connection
When the text box for this property is clicked, a browse button will appear. If the browse button is selected, the Source Connection dialog will appear, allowing you to configure a connection to the source dataset or table using the connector specified in the Source Connector property.
Target Connector
This property allows you to select a connector for the target connection which the transformer component.
Target Connection
This property behaves the same as the Source Connection property. Click in the text box for this property, then click Browse to configure the Target Connection dialog.
Starting Record
The property can be used to specify where to start processing source records. The default value is “1”, which indicates the component will start processing the first record in the source. The Starting Record and Record Count properties can be used in conjunction to process a sub-set of the source records if desired.
Record Count
Quantity of records to process. The default value is “-1”, which indicates all records will be processed. If a non-negative number is provided, this value will indicate how many records from the source will be processed by the Transformer Component.
Auto Map Method
Automatic mapping options are:
Map by name (case-sensitive)
Map by relative field position (default)
Duplicate source layout
Recommended (Dictionary/Algorithm)
Note:  For more information about Recommended (Dictionary/Algorithm) option, see Using Map Recommend.
Output Mode
The options are:
Replace
Append (default)
DeleteandAppend.
Note:  When you use Append mode to write to an ASCII delimited file with a header, an additional header record is inserted at the point of appending.
 
Clear Mapped Schema
The options are:
True
False (default)
Note:  If true, clears the mapped schema after transformation.
Set this option to true if the transformer performs multiple transformations and therefore processes more than one source files, with at least two source files having different schemas.
This is because, after each transformation, a mapped (target) schema is generated based on the source schema. If two source files have different schemas, two distinct target schemas will be generated. In such cases, it is advisable to clear the target schema after each transformation to prevent a schema B_BADMATCH error from occurring.
Some combinations of property settings can result in unexpected behavior in your process. For more information, see Errors.
Best Practice — It is recommended to select the Target Connector before you specify the Target Connection. You can select from the Target Connection dialog. However, the available connectors are not specific to the component and all the connectors are displayed. Hence, make sure to select the correct connector.
Errors
Target Exists
Settings
Behaviour
Yes
Output mode: Append
Auto Map Method: Duplicate source layout
Your process generates an error.
No
Output mode: Append
Your process proceeds as if the Replace output mode is selected.
No
Auto Map Method: May by relative field position or Map by name
Your process proceeds as if Duplicate source layout is selected.
No
Output mode: Append
Auto Map Method: Duplicate source layout
Your process proceeds as if the Replace output mode is selected.
The Automatic Mapping Transformer supports the following error conditions.
Error Code
Error Name
Description
Reason
2
BADNAME
Specified message name is invalid or the message does not exist.
Unknown message name (source or target).
5
NOMEM
Out of memory.
No more memory is available.
16
BADMODE
Unknown mapping method, or unknown output mode.
Application attempted to set an invalid output mode for a target data source or mapping method.
34
INVALID
Component encountered an unusual error condition.
Invalid source or target information, or error executing the transformation.
Generating an Error File
When you test a source file against a schema, you can generate an XML file containing any errors found in the file. You can then use the XML file as the source in a map to generate a response. Use the response for determining the source file issues.
Unable to render embedded object: File (./images/proc.gif) not found.
To generate an XML error file:
1. Make sure the process file is closed.
2. Create a user environment variable called XMLOUTPUT with a value as 1.
3. Create a new process or open an existing process file.
4. For the Validator step, the OutputFile/URI property will appear. Enter the path and file name of the XML file that you want to generate.
If structural validation fails, the step creates the XML file. If the file is valid, proceed to the next step in the process.
Last modified date: 12/03/2024