Skip to main content

Overview

This config works in the same way as the SourceFileNameCreator config, the important difference is that this config can save a new field in the file.

Example

Here is a JSON representation of a config.

    "NAME" : {
"TYPE": "SOURCE_FILE_NAME_EXTRACTOR",
"POST_PROCESSING_FIELD_NAME": "PAGE_ID_REFERENCE",
"PARAMETERS": {
"ORDER": {"FIELD NAME": "PART NUMBER"},
"ORDER": {"FIELD NAME": "PART NUMBER"},
"ORDER": {"FIELD NAME": "PART NUMBER"}
}
}

Definition of Terms

  • NAME: This is just a reference to distinguish it from other POST PROCESSING configs.
  • TYPE: Must be "SOURCE_FILE_NAME_EXTRACTOR"
  • POST_PROCESSING_FIELD_NAME: The name of the field that will be appended to the file.
  • PARAMETERS: A set of JSON objects specifying the fields and processing instructions.
    • ORDER: The order that this element will be used to create the value to be appended.
    • FIELD NAME: Tells DecaSIM which field in the source DESIGN 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 (spaces) and this integer represents the index of the component that DecaSIM will use. This uses zero-based counting. For example, if the field (e.g DATE) specified contains the value 2025 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 these configs we can create a new field in the OPTIMIZED FILE. The new field will be labelled PAGE_ID_REFERENCE

"HumanReadableReference": {
"TYPE": "SOURCE_FILE_NAME_EXTRACTOR",
"POST_PROCESSING_FIELD_NAME": "PAGE_ID_REFERENCE",
"PARAMETERS": {
"1": {
"FILE_SOURCE_PREFIX": "0"
},
"2": {
"COUNTRY_CODE": "0"
},
"3": {
"FILE_SOURCE_PREFIX": "1"
},
"4": {
"FILE_SOURCE_PREFIX": "2"
},
"5": {
"USE_VALUE": "PAG"
},
"6": {
"COUNTRY_PAGE": "0"
}
}
}

We can replace the PART NUMBER in the config with the actual value as extracted from the field from this data table below, or specified using the USE_VALUE keyword.

FILE_SOURCE_PREFIXCOUNTRY_CODECOUNTRY_PAGE
AB C08 2025GE12
CD C08 2025CX13
EF C08 2025FR14

When the config is processed these are the values it retrieves for the first row of data in the table:

ORDERINSTRUCTIONVALUE
1"FILE_SOURCE_PREFIX": "0"AB
2"COUNTRY_CODE": "0"GE
3"FILE_SOURCE_PREFIX": "1"C08
4"FILE_SOURCE_PREFIX": "2"2025
5"USE_VALUE": "PAG"PAG
6"COUNTRY_PAGE": "0"12

The values are then joined using a _ separator to produce the value AB_GE_C08_2025_PAG_12 that will be inserted into the field PAGE_ID_REFERENCE specified in the config.

For all three rows in our example data, this table shows what the values will be.

FILE_SOURCE_PREFIXCOUNTRY_CODECOUNTRY_PAGEPAGE_ID_REFERENCE
AB C08 2025GE12AB_GE_C08_2025_PAG_12
CD C08 2025CX13CD_CX_C08_2025_PAG_13
EF C08 2025FR14EF_FR_C08_2025_PAG_14