ETransL Technical: Load and Validate the Template Workbook
Quick overview
The template workbook is the document that drives the ETransL engine. It is possible to have different templates processing the same transaction file.
ETransL computing engine will, for each row in the transaction file, process the template, commencing at column B onwards until it encounters the first blank column.
This module will:
- size arrays for the different parameters that will be read from the template file
- validate that all the columns in the template are valid
- populate the arrays with the read data.
Flow Diagram
Solution walk through
- Determine the total number of columns that are make up the Template Workbook. The starting position is user defined.
- Create arrays to store the different parameters that make up a single template column. The following arrays will be created:
- Title - Each column must have a unique title. This is because an operation may reference another column and the title is the way these can be uniquely identified.
- Operation - This describes the action ETransL will perform on the data. The following instructions are catered for:
- SK - Skip - this is the only operation that doesn't take any other parameter
- CO - Constant value
- TX - TEXT Formatting
- MC - Multiple Choice conversion
- CF - Cell reference to transaction file
- CM - Data read from cell in transaction file
- IC - Incremental Counter
- RW - Transaction file row reference
- MetaData - varies depending on the operation
- Length - The length of the processed output
- Padding - The direction and character(s) to be used to pad the output to the desired length (or crop it if longer)
- Output - Whether the result should be included in the transformation file
- Data - The data that will be evaluation. How information included here is handled will vary depending on the operation.
- For each column
- If the trimmed Title is either blank or has already been used, log the error and stop further processing
- If the Operation is invalid log the error and stop further processing
- If the Operation is not SK,
- If Output (case insensitive) is neither Y nor N, log a warning and set it to Y
- If the first character of Padding (case insensitive) is neither L nor R, log a warning and set it to R
- If Length is not a number or if it is less than zero, log the error and stop further processing
- If Operation is MC or TX and Data is blank, log the error and stop further processing
- If Operation is MC or TX and MetaData is blank, log the error and stop further processing
- If Operation is MC and MetaData does not match the expected search / replace format, log the error and stop further processing
Join the effort ,;, Use the tool ,;, Spread the word
Project Source and more @: https://www.github.com/chribonn/ETransL
Comments
Post a Comment