Package com.orchestranetworks.addon.dint.transformation.aggregate

Provides classes and interfaces for creating an aggregate transformation.

Example code for IntegerAggregate transformation:

  1. Create a mapping that allows to aggregate three integer fields 'salary' and 'bonus' and 'allowance', after that map to 'total_income':

                    TableMapping<CSVField, EBXField> tableMapping = TableMapping.of(sourceTable, targetTable);
                    CSVTable csvTable = sourceTable.getTable();
                    EBXTable ebxTable = targetTable.getTable();
                    
                    tableMapping.fromSourceFieldStep(csvTable.get("salary"))
                            .aggregate(IntegerAggregate.getInstance())
                            .withField(csvTable.get("bonus"))
                            .withField(csvTable.get("allowance"))
                            .toField(ebxTable.get(Path.parse("/total_income")));
                    

Example code for StringConcat transformation:

  1. Create a mapping that allows to concatenate two string fields 'first_name' and 'last_name', after that map to 'full_name':

                    TableMapping<CSVField, EBXField> tableMapping = TableMapping.of(sourceTable, targetTable);
                    CSVTable csvTable = sourceTable.getTable();
                    EBXTable ebxTable = targetTable.getTable();
                            
                    tableMapping.fromConstantStep("Mr/Ms.").aggregate(StringConcat.getInstance())
                            .withField(csvTable.get("first_name"))
                            .withField(csvTable.get("last_name"))
                            .param(StringConcat.SEPARATOR, " ")
                            .toField(ebxTable.get(Path.parse("/full_name")));