# Callbacks

One of the core parts of Floweye is its system of panels and callbacks.

Purpose of callbacks is execute in a predefined moment a predefined operation. Callback is PHP code, which is executed just once during its cycle.

Callbacks are often hooked to system of events.

# Configuration

Individual callbacks can be enabled/disabled with option enabled evaluated by Lattenizer. If omitted callback is always enabled.

# Built-in Callbacks

Take a look at all built-in callbacks.

# Example

In this example we define a callback, which will set value of variable name during process instantiation and will set value of variable surname during transition to step with name step4

process:
	name: Example process name
	description: Callbacks example

# Callbacks which are defined in root of template are connected with
events:

	# Event name
	on_process_start:

		# Callback name
		mutate_variable:
			extra:
				# Fired only if name is not equal to "My name"
				enabled: 'name !== "My name"'

			config:

				# Callback configuration
				variables:

					# During process start will be into variable 'name' set value 'My name'
					name: My name


steps:
	step4:
		title: step4
		type: MANUAL

		# Callbacks defined in process step are connected to events of process step
		events:

			# Event name
			on_step_start:

				# Callback name
				mutate_variable:
					config:

						# Callback configuration
						variables:

							# During step initialization will be into variable 'surname' set value 'My surname'
							surname: My surname
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45