Skip navigation links

Package com.orchestranetworks.addon.dint

Provides classes and interfaces to execute a data integration task.

See: Description

Package com.orchestranetworks.addon.dint Description

Provides classes and interfaces to execute a data integration task.

The main class of this package is DataIntegrationExecutor, which performs a data integration task between a SourceTable and a TargetTable. Use a TableMapping to map source and target fields. In case the fields of source and target table are the same structure or label, you can use the provided FieldMatcher. To determine which field in the source table will match with which field in the target table, you have to define in TableMapping. In case you want to transform data, you can add transformations to field mappings. For more information, refer to the packages related to transformation functions. Get integration results using DataIntegrationExecutionResults.

Example code for Export CSV use case:

  1. Get an instance of EBXSourceTable:

                    EBXSourceTableSpec ebxSourceTableSpec = EBXSourceTableSpec
                            .newBuilder(adaptationTable, session)
                            .setIncludeComputedValuesOption(false)
                            .build();
                    EBXSourceTable ebxSourceTable = EBXSourceTable.newInstance(ebxSourceTableSpec);
                    
  2. Get an instance of CSVTargetTable:

                    CSVTargetTableSpec csvTargetTableSpec = CSVTargetTableSpec.newBuilder(outputFile)
                            .setFirstRowHeader(true)
                            .setFieldLabels(ebxSourceTable.getLabels())
                            .build();
                    CSVTargetTable csvTargetTable = CSVTargetTable.newInstance(csvTargetTableSpec);
                    
  3. Get an instance of TableMapping with FieldMatcher:

                    TableMapping tableMapping = TableMapping.of(ebxSourceTable, csvTargetTable);
                    List ebxFields = ebxSourceTable.getTable().getFields();
                    List csvFields = csvTargetTable.getTable().getFields();
                    tableMapping.mapFieldsWithMatcher(ebxFields, csvFields, FieldMatcher.getMatcherByLabelIgnoreCase());
                    
  4. Get an instance of DataIntegrationSpec:

                    MappingSpec mappingSpec = MappingSpec.of(tableMapping);
                    DataIntegrationSpec dataIntegrationSpec = new DataIntegrationSpec(session, mappingSpec);
                    
  5. Execute a DataIntegrationSpec and get result:

                    DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(dataIntegrationSpec);
                    

Example code for Import Excel use case:

  1. Get an instance of ExcelSourceTable:

                    ExcelSourceTableSpec excelSourceTableSpec = ExcelSourceTableSpec
                            .newBuilder(fileToImport)
                            .setFirstRowHeader(true)
                            .setSheetName("Employee")
                            .build();
                    ExcelSourceTable excelSourceTable = ExcelSourceTable.newInstance(excelSourceTableSpec);
                    
  2. Get an instance of EBXTargetTable:

                    EBXTargetTableSpec targetTableSpec = EBXTargetTableSpec
                            .newBuilder(adaptationTable, session)
                            .setWriteMode(EBXWriteMode.UPDATE_OR_INSERT)
                            .setNullOrEmptyPrimaryKeyAllowed(false)
                            .build();
                    EBXTargetTable ebxTargetTable = EBXTargetTable.newInstance(targetTableSpec);
                    
  3. Get an instance of TableMapping with mapping manually :

                    TableMapping tableMapping = TableMapping.of(excelSourceTable, ebxTargetTable);
                    List csvFields = excelSourceTable.getTable().getFields();
                    List ebxFields = ebxTargetTable.getTable().getFields();
                    for (int i = 0; i < ebxFields.size(); i++)
                    {
                            tableMapping.mapFields(csvFields.get(i), ebxFields.get(i));
                    }
                    
  4. Get an instance of DataIntegrationSpec:

                    MappingSpec mappingSpec = MappingSpec.of(tableMapping);
                    DataIntegrationSpec dataIntegrationSpec = new DataIntegrationSpec(session, mappingSpec);
                    
  5. Execute a DataIntegrationSpec and get result:

                    DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(dataIntegrationSpec);
                    

Example code for Data Transfer use case:

  1. Get an instance of EBXSourceTable:

                    EBXSourceTableSpec ebxSourceTableSpec = EBXSourceTableSpec
                            .newBuilder(adaptationTable, session)
                            .setForeignKeyHierarchyIncluded(false) // when both sides are EBX, foreign keys should be configured as normal fields, not a hierarchies
                            .build();
                    EBXSourceTable ebxSourceTable = EBXSourceTable.newInstance(ebxSourceTableSpec);
                    
  2. Get an instance of EBXTargetTable:

                    EBXTargetTableSpec targetTableSpec = EBXTargetTableSpec
                            .newBuilder(adaptationTable, session)
                            .setWriteMode(EBXWriteMode.UPDATE_OR_INSERT)
                            .setNullOrEmptyPrimaryKeyAllowed(false)
                            .setForeignKeyHierarchyIncluded(false) // when both sides are EBX, foreign keys should be configured as normal fields, not a hierarchies
                            .build();
                    EBXTargetTable ebxTargetTable = EBXTargetTable.newInstance(targetTableSpec);
                    
  3. Get an instance of TableMapping with FieldMatcher:

                    TableMapping tableMapping = TableMapping.of(excelSourceTable, ebxTargetTable);
                    List sourceFields = ebxSourceTable.getTable().getFields();
                    List targetFields = ebxTargetTable.getTable().getFields();
                    tableMapping.mapFieldsWithMatcher(sourceFields, targetFields, FieldMatcher.getMatcherByLabelIgnoreCase());
                    
  4. Get an instance of DataIntegrationSpec:

                    MappingSpec mappingSpec = MappingSpec.of(tableMapping);
                    DataIntegrationSpec dataIntegrationSpec = new DataIntegrationSpec(session, mappingSpec);
                    
  5. Execute a DataIntegrationSpec and get result:

                    DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(dataIntegrationSpec);
                    

Example code for Export CSV with user defined template:

  1. Get an instance of CSVExportTemplateSpec:

                    CSVExportTemplateSpec templateSpec = new CSVExportTemplateSpec(
                            "7c67ed6a-3106-47b0-9bf8-0440e6238657", //this's template uuid, you can get from admin page.
                            outputFile,
                            session);
                    
  2. Execute a DataIntegrationSpec and get result:

                    DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(templateSpec);
                    
Skip navigation links

EBX® Add-ons Version 5.3.0.

Copyright TIBCO Software Inc. 2001-2022. All rights reserved.
All third party product and company names and third party marks mentioned in this document are the property of their respective owners and are mentioned for identification.