Choosing a generation

In table from icebox tasks and in row level from icebox tasks the icebox generation which to be inserted into target database must be defined. There are three ways to specify the generation:

Icebox generation selection

The icebox generation could be selected in three different ways:

  • Relative Generation

  • Specific Generation

  • Expression based generation

Relative Generation

In the relative generation mode it is possible to select the generation in two ways:

Absolute generation

To choose a generation for inserting tables which should not change when new generations are provided, the generation can be specified by absolute generation. An incremental generation number starting at 1 is given to each generation of the corresponding to icebox task. Choosing the generation by its absolute generation number allows XDM to insert this generation with every task execution, even if there are newer generations.

If the chosen generation does not exist any more due to the retention in the to icebox task, the from icebox task will fail in Tailoring step. In this case, you have to edit the task to select a new generation.
Relative generation

To choose a generation for inserting tables which changes if new generations are provided (e.g. the last or second last generation), the generation can be specified by relative generation. Choosing the generation by its relative generation number allows XDM to restore a different generation with every task execution, depending on the existing generations. For example, when the generation number of the from icebox task is set to 0, the task will always insert the saved data from the last generation of the corresponding to icebox task, by setting it to -1 the task will insert the saved data from the second last. The inserting generation will change automatically, if a new generation is created by the corresponding to icebox task. The chosen generation will be determined when executing the task and will differ from previous runs if new generations are created between the two runs.

If the chosen generation does not exist yet, the from icebox task will fail in Tailoring step. In this case, you have to edit the task to increase the relative generation.
When choosing relative generation, be aware of the retention limit of the corresponding to icebox task. For example, if the retention limit is set to 3, only relative generation 0, -1 and -2 will lead to generations. All other generations are removed due to the retention in the to icebox task.

Specific generation

The specific mode shows all existing generations of the selected to icebox task template in a drop-down.

Expression based generation

In the expression mode it is possible to get the desired backup with the help of spring expression language. In the expression, the user can use all properties of the generation, the to icebox task and from icebox task. The respective objects can be used in the expression as follows.

  • #backup

  • #restoreTaskTemplate

  • #backupTaskTemplate

It is also possible to link several criteria with and and or. If more than one generation matches the criteria, the last generated generation is selected.

When checking on a timestamp property, the matching value must be converted using the method parseToLocalDateTime('<Time>').

If the chosen generation does not exist yet, the from icebox task will fail in Tailoring step. In this case, you have to edit the task to change the expression based generation.

Example

If in the to icebox task a custom parameter with the name contractNumber exists, this parameter is saved in the generated generation. If this to icebox task was executed with the contractNumbers '0815', '1508' and '1307', we also have three generations with have set the contractNumber parameter to one of these values.

When you now want to execute the corresponding from icebox task with the generation with the contractNumber '1508' the expression is like this:

#backup.contractNumber == '1508'

You can also select a generation that is created within a certain time period. The following example selects the last generation created between 22 October 2020 and 10 November 2020.

#backup.createdOn > parseToLocalDateTime('2020-10-22T23:59:59.99') and #backup.createdOn < parseToLocalDateTime('2020-11-10T00:00:00.00')

For more details refer to the icebox generation selection description in the reference.

Setting retention for Icebox generations

Retention defines the maximum number of icebox generations that are stored for the tasks based on this template:

  • Using value -1 will store all newly created generations and will not delete any existing generations.

  • Using a fixed number will drop the oldest generation if the retention number is exceeded.

    The retention limit is useful if the disk space for generations is limited. If the retention number is reduced, any surplus generations will be removed automatically during the next task execution.
    It is possible to set the retention for every task individually by overriding the retention value of the task template in the task.

For more details refer to the retention description in the reference.