Source FileName Creator
A core part of the APPEND PROCESS
is to retrieve offer data and append it as new columns in the DESIGN FILE
. Since the source of promotion/offer data will vary from campaign to campaign, DecaSIM
use files rather than a DB to store data, the APPEND PROCESS
needs a method to dynamically build PROMO FILE
names to search based on data.
There are two prebuilt configs that make this happen: SourceFileName
and ProductCodeFileName
. The basic configuration for each of these is shown here:
"Config Keyword": {
"ORDER": {"FIELD NAME": "PART NUMBER"},
"ORDER": {"FIELD NAME": "PART NUMBER"},
"ORDER": {"FIELD NAME": "PART NUMBER"}
}
Definition of Terms
- Config Keyword: either
SourceFileName
orProductCodeFileName
- ORDER: Integer, starting with 1, that represents the position in the name that is being build by this config for that part.
- FIELD NAME: Tells
DecaSIM
which field in the sourceDESIGN FILE
will provide this part of the filename this config creates. Instead of specifying a FIELD NAME, the config also accepts the keyword USE_VALUE. In this instance, replace the PART NUMBER with the string value to be inserted at that position in the filename being built. - PART NUMBER: We split the value contained in the FIELD NAME by
DecaSIM
will use. This uses zero-based counting. For example, if the field (e.gDATE
) specified contains the value2025 12 25
then three elements will be created when this field is read:- 0th component: 2025
- 1st component: 12
- 2nd component: 25
Worked Example
Using this config for ProductCodeFileName
the APPEND PROCESS
will construct a filename using five pieces of data from
three different fields in the DESIGN FILE
:
- FILE_SOURCE_PREFIX: This field will provide data for the 1st, 3rd and 4th part of the filename.
- COUNTRY_CODE: This field will provide data for the 2nd part of the filename.
- SOURCE_TYPE: This field will provide data for the 5th part of the filename.
"ProductCodeFileName": {
"1": {"FILE_SOURCE_PREFIX": "0"},
"2": {"COUNTRY_CODE": "0"},
"3": {"FILE_SOURCE_PREFIX": "1"},
"4": {"FILE_SOURCE_PREFIX": "2"},
"5": {"SOURCE_TYPE": "0"}
}
To show how this config creates the file name, we will replace the PART NUMBER with the fieldvalue for the first row of data in this table:
FILE_SOURCE_PREFIX | COUNTRY_CODE | SOURCE_TYPE |
---|---|---|
AB C08 2025 | GE | EVO |
CD C08 2025 | CX | EVO |
EF C08 2025 | FR | EXT |
When we process the value in field FILE_SOURCE_PREFIX
we split it by
to produce three values - if there are no spaces then we can specify 0
to use the first and only part. The values extracted for each row of config look like this:
"ProductCodeFileName": {
"1": {"FILE_SOURCE_PREFIX": "AB"},
"2": {"COUNTRY_CODE": "GE"},
"3": {"FILE_SOURCE_PREFIX": "C08"},
"4": {"FILE_SOURCE_PREFIX": "2025"},
"5": {"SOURCE_TYPE": "EVO"}
}
This config then joins these parts together using the _
(Can be configured) to produce a filename: AB_GE_C08_2025_EVO
. For the remaining fields in the table we get the following values:
FILE_SOURCE_PREFIX | COUNTRY_CODE | SOURCE_TYPE | ProductCodeFileName |
---|---|---|---|
AB C08 2025 | GE | EVO | AB_GE_C08_2025_EVO |
CD C08 2025 | CX | EVO | CD_CX_C08_2025_EVO |
EF C08 2025 | FR | EXT | EF_FR_C08_2025_EXT |
When using SourceFileNameExtractor
these filenames are then used for extracting promotion/offer data whereas ProductCodeFileName
is used to specify the file that contains product code data. The same format is also used by the POST PROCESSING
config SOURCE_FILENAME_EXTRACTOR