# mutate_step_expiration

Name mutate_step_expiration
Type callback
Version 1.0
Since 2020-01-01

# Prologue

Callback transforms active step expiration. Every item from sliding is applied on variable or active step expiration. Finally configured steps expiration is overwritten with result.

# Configuration

At least one of variable or sliding is required.

events:

	# Event's name
	on_step_start:

		# Callback's name
		mutate_step_expiration:
			config:

					# Optional | Default - null
					variable: variable_with_date_name

					# Optional | Default - []
					sliding: ['+5 days', '+ 2 hours']

					# Optional | Default - current step
					steps: ['nextStepID', 'lastStepID']
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# Example

There are several ways the callback can be used:

  • variable = null, sliding = ['+5 days', '+ 2 hours']

Step expiration (for example 20/10/2015 14:00) will be updated to 25/10/2015 16:00.

  • sliding = [], variable has value (for example a string "first day of month" or a timestamp "123456789")

Step expiration will be set to the value in variable.

  • variable has value, sliding = ['+5 days', '+ 2 hours']

We take value from variable and apply sliding to it like in the first example. Step expiration will be set to the result.