Mapping
Last updated
Last updated
Mapping component is used to transform input data to output data. Mapping component requires both source and target nodes before the mapping dialog is opened.
The left side is input, and multiple tables can be displayed. The right side is the output, and only one table is displayed. This table comes from the right component of the mapping.
The buttons on the top right are these.
Connect by name is used to connect source ant target by name.
The inputs come from the previous components which have DataStructureId property in output properties.
If the output includes the property DataStructureId, it is recommended to assign a unique name to the corresponding field (which is a text field). This can be done by modifying the output properties of the SQL Component, as shown in the screenshot.
This component generates ResultArray output and if Use Data Structure is checked, ResultArray is linked to DataStructureId property too. If another SQL component next this component has same configuration, the link of this component is overwritten. Mapping component cannot find the ResultArray data of this component and mapping fails.
This flow has two SQL components, one SQLBatch component, and one Mapping component. Mapping component will find the input sources from the left two SQL components.
When Mapping component is open, two inputs are displayed. Each input and output table has this layout.
Data structure name (Component name)
If you don't need certain input sources for mapping, set No to "Use in mapping" property.
Then the data structures which are set to Yes will be displayed.
If ISM messages are used for mapping, for example, DB ??? DB Synchronization, the input is ISM type, and the output is ISM type too. And this type of transaction mostly involves huge records like 100k records. The structures of the input and output are simple, there will be only one operation ??? for example, insert only. This operation does not need to keep the order of the selected records.
Mapping of this type of operation is processed concurrently with 10 worker threads internally. Processing unit is 1000. The worker threads receive offsets of 1000. If the input has 10k records, each worker thread receives 1 offset. If the input has 100k records, each worker thread receives 10 offsets. The results of mapping are added to a single output data. And the output data is file backed up list. The real data is in a file and the list in the memory contains the index and position attributes.
Move mouse over to the input field, then an arrow icon is displayed.
Drag mouse from the input and stop at the output field. Then a wire is drawn between the input and output fields.
One output field can have more than one input fields or no input fields.
If an output field is double clicked, Function popup is displayed.
Function has three types.
Set a value to Default field.
Default type is displayed in green color.
Java function class is from custom directory. Class name is the name of function. No package is allowed to Java function.
The parameters of Java function are defined with $1, $2 and ends with semi colon(;). The function can be tested at function dialog.
1) Choose a function from the list.
2) Enter test parameters.
3) Click Execute button, and the result is displayed.
Java function type is displayed in blue color.
Function(JavaScript)
JavaScript type function executes a function. The script can have more than one functions. The detail information of how JavaScript works can be found here.
1) Write JavaScript.
2) Enter test parameter.
3) Click Execute button, then the result is displayed.
If a parameter with number value is passed as string, the return value is converted into double type by default.
JavaScript function is displayed in purple color.
Type | Description |
---|---|
Default
Default value.
· Default value is set if no input value is connected.
· Default value is appended if input value(s) exist.
Function(Java)
Java class to generate output value.
Function(JavaScript)
JavaScript to generate output value.