# 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.

Callback Description
adminus_crm_fetch_contracts Load contracts by their IDs from Adminus CRM
adminus_crm_fetch_customers Load customers by their IDs from Adminus CRM
adminus_crm_upload_files Upload files into CRM
adminus_nms_fetch_areas Load areas by their IDs from Adminus NMS
adminus_nms_fetch_devices Load devices by their IDs from Adminus NMS
adminus_nsm_fetch_pops Load pops by their IDs from Adminus NMS
ares_subject_search Load subject details by its ID from ARES
async Schedule time when async step will be sent to next step
browserless_pdf Generate PDF file from HTML code
contact_reset Reset contact collection
contact_set Create/Edit/Assign contacts collection
dbd_debt_check Load data by their ID from DBD
discussion_writer Insert new comment to process discussion
email Send emails from process
exchange_rate Load current exchange rates for given currency
mutate_role_resolver Add user(s) to role or set (override) user(s) in role using processing variables
mutate_step_expiration Modify step expiration
mutate_step_readers Add user(s) to step readers or set (override) step reader(s) using processing variables
mutate_step_resolver Set user as step resolver
mutate_variable Set variable values
mutate_variable_user_group Store IDs of all users from user group to variable
planning Add planning functionality to given step
process_list Process list allows assigning processes to variable. Use `spec: processes` variable to access process references in lattenizer instead of process ids.
process_starter Start new processes (subprocesses)
random_step_resolver Randomly choose resolver for active step from given `role`
reset_step_resolver Reset active step resolver to nobody
rest Perform a HTTP request and store response into variable
ruian_fetch_address Load address details by RUIAN code from RUIAN
unassign_step_readers Reset selected steps readers to nobody
unassign_step_resolver Reset selected steps resolver to nobody
wall_writer Insert message into process wall

# 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