# 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 which accepts LPL expression. If omitted callback is always enabled.

# Built-in Callbacks

Take a look at all built-in callbacks.

Callback Description
adminus_crm_fetch_contracts Gets contract ids from given input variable, load their data from CRM and fills received data to output variable.
adminus_crm_fetch_customers Gets customers ids from given input variable, load their data from CRM and fills received data to output variable.
adminus_crm_upload_files Gets files ids and customer id from given input variables, load their data and update/upload files in CRM.
adminus_nms_fetch_areas Gets areas ids from given input variable, load their data from NMS and fills received data to output variable.
adminus_nms_fetch_devices Gets devices ids from given input variable, load their data from NMS and fills received data to output variable.
adminus_nsm_fetch_pops Gets pops ids from given input variable, load their data from NMS and fills received data to output variable.
ares_subject_search Tries to fetch subject details by its companyID from ARES API and stores data in defined variable.
async Async callback sets time when async step will be sent to next step.
dbd_debt_check Fetches DBD result from remote API for given subject and saves it to result json variable.
discussion_writer Inserts new comment to process discussion.
email Email callback is a complex tool to send emails with up-to-date process data.
exchange_rate Exchange rate callback downloads current exchange rates for given currency and saves it to a process variable.
juicyfx_pdf_generate Generates PDF files from given source.
mutate_process_tags Add or remove template tags to process.
mutate_role_resolver Add user(s) to role or set (override) user(s) in role using processing variables.
mutate_step_expiration Callback transforms active step expiration.
mutate_step_readers Add user(s) to step readers or set (override) step reader(s) using processing variables.
mutate_step_resolver Sets user as step resolver using processing variables.
mutate_variable Callback is similar to QuickActions panel. It sets specific values to variables.
mutate_variable_expression Callback is similar to QuickActions panel. It sets expression result to variable.
mutate_variable_lattenizer Parses lattenizer template and sets result to a variable.
mutate_variable_user_group Sets IDs of all users from user group to variable.
planning This callback adds planning functionality to given step.
process_starter Useful callback to start as many processes as you wish.
random_step_resolver Randomly chooses resolver for active step from given role.
reset_step_resolver Resets active step's resolver to nobody.
rest Performs a HTTP request to given URL with given data.
ruian_fetch_address Tries to fetch address details by RUIAN code from API and adds those address fields to defined variable.
ruian_fetch_gps Tries to address details by RUIAN code and adds address fields to defined variable.
unassign_step_readers Resets selected step's readers to nobody.
unassign_step_resolver Resets selected step's resolvers to nobody.
wall_writer Wall Writer inserts messages into process wall with selected severity.

# 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