Skip to main content
Version: 2027 R1

Business rules

Business rules are used to create universal expressions and conditions that control the behavior of processes. They are built in a visual editor from blocks – operations, functions, variables, parameters, and values entered directly – and are a convenient alternative to SQL expressions. A rule always returns a value of a specific type, e.g. text, a number, a logical value, a date, or a list of users.

Unlike form rules, which are executed in the user's browser and control the appearance and behavior of the form, business rules are evaluated by the system while the workflow runs, e.g. when checking an action execution condition or selecting a path. A rule defined once can be used in many places in the configuration – including other rules. If a rule needs to be changed, it is enough to modify it where it is defined – the change will apply to all places where the rule is used.

Where rules are defined​

Business rules can be defined at two levels:

  • globally – in the Global definitions section – the rules are available in all processes,
  • in a process – in the Definitions node of the selected process – the rules are available only within that process.

Global rules​

To go to the list of global business rules, select the Global definitions section in the icon bar of the side panel, and then the Business rules item. A new rule is added with the Add global business rule button.

List of global business rules in the Global definitions section

Rules whose configuration cannot yet be edited in Designer Studio are marked on the list with a warning icon. Hovering over the icon displays the message Configuration available only in Legacy Designer Studio – such a rule can be viewed and edited only in the Legacy Designer Studio application. This currently applies to global business rules – both existing and newly added ones. In Designer Studio, you can still add, group, delete them and check where they are used.

Process rules​

To go to the list of business rules of a process, expand the process in the application tree, select the Definitions node (or the Definitions tab in the process view), and then the Business rules item. The number of rules defined in the process is displayed next to the Business rules item. A new rule is added with the Add business rule button.

List of process business rules on the Definitions tab

Rule list​

The business rule list looks the same at the global level and at the process level. Above the list, there are:

ElementDescription
SearchFilters the rule list by name.
Add business rule / Add global business ruleCreates a new rule named New business rule (at the global level: New global business rule). A process rule is opened in the rule editor right away.
Add groupCreates a new rule group (see Rule groups).

The list contains the Name and Documentation columns – the second column shows the description entered in the Documentation field of the rule configuration. Rules and groups that contain unpublished changes are marked with a blue dot.

Clicking a rule row opens the Rule configuration panel on the right side of the screen, and the Open configuration in full view icon next to the rule name opens the rule editor. The rule row menu (⋮ icon) contains the following commands:

CommandDescription
Open configuration in full viewOpens the rule in the rule editor.
Open configuration in the side panelOpens the Rule configuration panel.
Show usagesDisplays the Usage list in the left panel, i.e. the places in the configuration where the rule is used (see Rule usages).
Add business ruleAdds a new business rule (at the global level: Add global business rule).
Move to groupMoves the rule to the selected group. The <No group> option removes the rule from a group. The command is available when at least one group exists on the list.
Delete business ruleDeletes the rule.

For rules available only in Legacy Designer Studio, the Open configuration in full view icon and command are not displayed, and the Rule configuration panel only shows a message that the rule must be edited in Legacy Designer Studio.

Rule groups​

Business rules can be grouped to make them easier to manage when there are many definitions. To create a group, click the Add group button – a New group item appears on the list, and a panel opens on the right where you can rename the group (by clicking its name) and enter its Description.

To place a rule in a group, select the Move to group command from the rule menu and choose the group. A new rule can be created directly in a group with the Add business rule (Add global business rule) command from the group menu. The group menu also contains the Open configuration in the side panel and Delete group commands. Rules belonging to a group are displayed on the list nested under its name. Groups are also visible in the tree of the Functions tab in rule editors, which makes it easier to find the required rule.

Rule configuration​

The Rule configuration panel opens after clicking a rule on the list, with the Open configuration in the side panel command from the rule menu, or with the Configuration button in the rule editor.

Rule configuration panel with the Documentation and Return type fields

The panel header displays the rule name – clicking the name lets you change it. Below, there is the rule GUID (the Copy content to the clipboard button copies its full value) and the Show usages button. The Basic tab contains the following fields:

FieldDescription
DocumentationRule description displayed in the Documentation column of the rule list. The Translations button lets you define its translations.
Return typeType of the value returned by the rule (see Return type).
DefinitionPreview of the rule content. The field is displayed in the panel opened from the rule list. The Open the expression editor button in the upper-right corner of the field opens the rule in the rule editor.

The Open configuration in full view button in the panel header opens the rule in the rule editor, and the Close button closes the panel.

Return type​

The return type of a rule should match the place where the rule will be used – e.g. a rule calculating a date should have the Date type, and a rule used as a condition – the Yes/No type. The return type determines where the rule is available: in configuration places that expect a specific data type, you can use a rule that returns that type.

TypeDescription
Text valueAny string of characters. Default type of a new rule.
Decimal valueA numeric value, e.g. an amount or a calculation result.
Yes/NoA logical value – POSITIVE (TRUE, 1) or NEGATIVE (FALSE, 0). Used, among others, in action execution conditions and when selecting a path based on form field values in flow control steps.
DateA date or a date with time.
User listA list of users or groups in the ID#Name format, where the identifier can be a login or an e-mail address (the name is optional). Used, among others, to specify the people for whom an element is to be visible or available.

Where possible, the system converts values between types automatically. However, when the rule is executed, the system checks whether the returned value matches the set type – if it does not, an error is returned. Setting the correct type therefore makes it easier to diagnose configuration errors.

Rule editor​

Business rules are built in the rule editor, which opens in the Designer Studio workspace after a new process rule is added, after selecting the Open configuration in full view command, or after clicking the Open the expression editor button in the Definition field. Above the editing area, there is the Return button and the name of the edited rule (e.g. Rule: Requires supervisor approval), and on the right – a side panel with the elements that can be inserted into the rule.

Business rule editor with an IF THEN ELSE rule, a parameter, and the testing bar

The editor is shared by many places in the Designer Studio configuration – a general description of how it works and of the available variables can be found in the Variables chapter.

Building a rule​

A rule is built from blocks. To insert an element, click a place in the editing area, and then double-click the element in the side panel or drag it to the editing area. As indicated by the hint displayed in the empty editing area, the Ctrl + Space key combination displays a list of suggestions, and typing the @ character lets you search for objects. Constant values, e.g. numbers, can be typed directly in the selected place of the rule.

Functions that require arguments are inserted together with empty argument slots. For example, the IF THEN function from the Conditional choice group inserts an IF [condition] THEN [value] row and an ELSE [value] row. Next to the condition row, there are buttons that move the row up or down, add another condition row, and delete the row. Conditions are checked one by one until one of them is met – the value from the THEN section of that row is then returned. If none of the conditions is met, the rule returns the value from the ELSE section.

Inserted elements are visually distinguished – numbers are displayed in blue, and rule parameters as yellow blocks. A block selected in the editing area can be deleted with the Delete or Backspace key.

When entering constant values, keep the following rules in mind:

  • numbers are entered without a thousands separator, and the decimal part is separated with a period,
  • text does not need to be enclosed in apostrophes,
  • dates should preferably be entered in the ISO 8601 format (e.g. 2026-11-02),
  • logical values can be entered as true/false or with the POSITIVE/NEGATIVE functions.

Comparison operations (=, <>, >, >=, <, <=), logical operations (AND, OR, NOT), and the condition of the IF THEN function require a logical value. If a value of a different type is used in such a place, it is converted according to the following rules:

ValueConversion result
Text true or 1 (case-insensitive)POSITIVE
Text false or 0 (case-insensitive)NEGATIVE
Any other textNEGATIVE
Number 1 / 0POSITIVE / NEGATIVE
Any other number or a dateRule execution error

The editor also provides:

  • the Close the side panel / Open the side panel button in the upper-right corner of the editing area – hides and shows the side panel again,
  • the Configuration button – opens the Rule configuration panel,
  • the Testing button in the lower-left corner – displays the rule testing bar (see Testing a rule),
  • the Fit to screen, Zoom out, and Zoom in buttons in the lower-right corner – let you control the zoom level of the editing area. As the info icon hint explains, the zoom can also be adjusted with the Ctrl + Scroll keyboard shortcut.
info

Additional information on building rules with the keyboard can be found in the article Writing business/form rules without using a mouse available on the technical blog.

Contextual help​

Hovering over a function or operation block in the editing area displays contextual help with the element name and a description of what it does.

Contextual help for the POSITIVE function displayed when hovering over the block

Side panel​

The elements that can be inserted into a rule are grouped on the tabs of the side panel. There is a Search field above the element tree.

TabContent
OperationsArithmetic and logical operations and comparisons (see the table below).
FunctionsProcess business rules, global business rules, integration functions, and built-in functions (see Business rule functions).
ValuesVariables – System fields, Form fields, Global constants, Process constants, Context variables, and Performance indicators. The Context variables group includes, among others, Current user, Current date, Document entry points, Paths, and Form display modes. A detailed description of the variables can be found in the Variables chapter.
ObjectsIdentifiers of configuration objects, e.g. form fields, steps, or paths.
ParametersRule parameters (see Rule parameters).

The Operations tab contains the following elements:

GroupElementDescription
Arithmetic operations+, -, *, /Addition, subtraction, multiplication, and division. Adding two text values joins them together.
Logic operationsAND, OR, NOTConjunction, disjunction, and negation of conditions.
ANY TRUEReturns POSITIVE if at least one of the given conditions is met – replaces combining many OR operators.
ALL TRUEReturns POSITIVE if all of the given conditions are met – replaces combining many AND operators.
Comparisons=Equal.
<>Not equal.
>, >=Greater than, greater than or equal.
<, <=Less than, less than or equal.
EMPTYNo value.
Functions tab of the side panel with the list of function groups

The Functions tab lets you use other, previously defined rules in a rule – simply expand the Process business rules or Global business rules group and insert the selected rule. Rules with parameters are marked in the tree with the (...) characters. This way, complex logic can be defined once and called in many places.

Rule parameters​

Parameters let you create universal rules that can be reused in different scenarios. A parameter is defined once in the rule, and wherever the rule is used, an appropriate value is passed to it, e.g. the value of a form field.

Parameters are defined on the Parameters tab of the side panel, in the Local variables section. The Add button opens the New parameter window:

New parameter window with the Name, Type, and Description fields and the Encode special characters option
FieldDescription
NameParameter name displayed on the parameter list and on the parameter block in the rule.
TypeType of the value passed to the parameter: Text value, Decimal value, Yes/No, Date, or User list.
DescriptionParameter description that helps to use it correctly.
Encode special charactersAs the info icon hint explains, any unsafe characters in the parameter value are escaped before being used in a query to prevent its logic from being changed (e.g. the apostrophe ' is replaced with '').

Defined parameters are displayed in the Local variables section together with a type icon, and their number is shown next to the section. The parameter menu (⋮ icon) contains the Edit, Delete, and Show usages commands. To use a parameter, double-click it on the list – in the rule, it is displayed as a yellow block.

Testing a rule​

You can check how a rule works without running the entire process. The Testing button in the lower-left corner of the editor displays a bar with the following elements:

ElementDescription
Element IDID of the workflow element in the context of which the rule will be tested.
TestExecutes the rule with variable values taken from the specified workflow element and displays the returned value.
PreviewDisplays the expression with variable values substituted from the specified workflow element.

The Test and Preview buttons become available after an element ID is entered. The arrow on the right side of the bar collapses it.

Using business rules​

A defined rule can be used in any place in Designer Studio where an expression is built, provided that the type returned by the rule matches the type expected in that place. Business rules are used, among others, to:

  • calculate default values of form fields,
  • specify action execution conditions,
  • select a path based on form field values in flow control steps,
  • restrict the visibility and availability of paths and form fields,
  • build other, more complex rules.

To use a rule, go to the Functions tab in the expression editor, expand the Process business rules or Global business rules group, and insert the rule. If the rule has parameters, pass values to them after inserting it.

Example

In a purchase requisition process, the supervisor's opinion is to be required only when the order value exceeds a specific threshold. To achieve this:

  1. A Requires supervisor approval rule with the Yes/No return type was defined in the process.
  2. An Amount to approve parameter of the Decimal value type was added to the rule.
  3. The rule content was built with the IF THEN function: if the parameter value is greater than the threshold (e.g. 10000), the rule returns POSITIVE, otherwise – NEGATIVE. The threshold does not have to be hard-coded – it can be calculated by a separate rule or taken from a process constant.
  4. The rule was used in the condition that controls whether the Supervisor opinion form field is required, passing the value of the form field holding the total order value to the parameter.

This way, the same rule can be used in different places of the process with different parameter values.

Rule usages​

The Show usages command (available in the rule menu on the list and in the Rule configuration panel) displays the Usage list in the left panel of Designer Studio – a list of the configuration places where the rule is used, together with the object type and the application it belongs to. The list can be searched with the Search field and narrowed down with the Add filter option. Before changing or deleting a rule, it is worth checking where it is used.

Business rule functions​

In addition to the defined rules, the Functions tab of the side panel contains the Integrations group and the Functions group with built-in functions divided into folders.

Integrations​

FunctionDescription
SQL COMMANDLets you define a part of the rule as an SQL query in which variables can be used.
DATA SOURCE VALUERetrieves a value from a specific column of a data source.
SDK EXECUTIONLets you use an SDK extension in the rule.

Conditional choice​

FunctionDescription
IF THENCreates a logical condition with the IF, THEN, and ELSE sections.
POSITIVECondition met (YES, TRUE, 1).
NEGATIVECondition not met (NO, FALSE, 0).
PATHSelects a path of the given process.

Item list​

These functions are available only in process business rules (they are not available in global business rules).

FunctionDescription
ITEM LIST COUNTReturns the number of rows of an item list.
HAS ANY ROWSReturns TRUE if the item list contains at least one row, otherwise FALSE.
SELECT VALUESReturns the values from the specified item list column.

AI rules​

FunctionDescription
AI ANALYSIS RULE COUNT FOR INSTANCECounts the AI rules applied to the workflow element.
AI ANALYSIS BROKEN RULE COUNT FOR INSTANCECounts the AI rules broken on the given workflow element.
AI ANALYSIS SCORE FOR INSTANCEReturns the AI analysis score for the workflow element.
AI TEXT SUMMARYPrepares a summary of a text of a specified length (number of words). Uses an external AI model and requires an additional license.
AI SENTIMENT ANALYSISPerforms a sentiment analysis of a text and returns one value from the given rating scale (by default: -1 – negative, 0 – neutral, 1 – positive). Uses an external AI model and requires an additional license.
AI PROMPTPasses a prompt and system instructions to an LLM and returns the result as text. Uses an external AI model and requires an additional license.

Users​

FunctionDescription
CURRENT USER IS ONE OFChecks whether the current user belongs to a specified group of people – returns TRUE or FALSE.
USER IS ONE OFChecks whether the given user, user list, or group is on the given list or in the given group of users.
USERSReturns a list of users as a collection of ID#Name values separated by semicolons.
GROUP MEMBERSReturns all members of a group (including subgroups) as a collection of ID#Name values separated by semicolons.
SUBSTITUTES OFReturns a collection of current substitutes in task delegation mode for the specified user.

Number​

FunctionDescription
ROUNDRounds a numeric value with the given precision, e.g. ROUND [1.25] [1] returns 1.3, ROUND [1.25] [0] returns 1, and ROUND [11.25] [-1] returns 10.

Text​

FunctionDescription
TO UPPERConverts text to uppercase, e.g. contract → CONTRACT.
TO LOWERConverts text to lowercase, e.g. CONTRACT → contract.
TEXT LENReturns the length of a text (number of characters).
SUBSTRINGReturns a part of a text based on the start character index and the number of characters. The first character has index 1.
STRING REPLACEReplaces the specified phrase in a text with another one.
INDEX OFReturns the position of the first occurrence of a string in a text.
CONCATJoins text values into one text.
TRIMRemoves white space from the beginning and end of a text.
LIKEChecks whether a text matches the given pattern – returns TRUE if it does.
CONTAINSChecks whether a text contains a specific fragment (case-insensitive).
STARTS WITHChecks whether a text starts with a specific fragment (case-insensitive).
SPLITSplits a text into parts using the given separator. The result is a collection of elements separated by semicolons.
REMOVE HTML TAGSRemoves all HTML tags from a text.
TEXTLets you enter a text with the option to define translations.
tip

Using the CONCAT function inside the LIKE function lets you create advanced filtering conditions for data sources, e.g. in the configuration of Choice field form fields. Additional information on filtering data sources with the CONCAT and LIKE functions can be found in the article Using CONCAT inside the LIKE function to filter data sources available on the technical blog.

Date and time​

FunctionDescription
NOWReturns the current date and time.
TODAYReturns the current date – the returned time always points to 00:00:00.
DATE DIFFCalculates the difference between two dates in the selected unit (second, minute, hour, day, business day, week, month, year) and returns it as a number.
ADD DATEAdds a specified number of seconds, minutes, hours, days, months, or years to a date or subtracts it (to subtract, enter a negative number).
DATE PARTReturns an integer representing the second, minute, hour, day, day of week, month, or year of the given date.
MONDAY – SUNDAYReturn the name of the corresponding day of the week in English.
IS BUSINESS DAYChecks whether the given date is a business day according to the business days calendar.

Element collections​

FunctionDescription
GET IDsReturns only the identifiers, separated by semicolons, from an ID#Name collection, e.g. 144#Shock absorber;14#Radiator → 144;14.
GET NAMEsReturns only the names, separated by semicolons, from an ID#Name collection, e.g. 144#Shock absorber;14#Radiator → Shock absorber;Radiator.
IS INChecks whether an element is in a collection (or in one of several collections). Elements are compared as case-insensitive strings, taking white space into account.
COLLECTIONCombines many element collections into one.
GET AT INDEXReturns the element at the specified position of a collection.
SUMReturns the sum of the values of a number collection.
AVGReturns the arithmetic mean of the values of a number collection.
MAXReturns the largest value of a number collection.
MINReturns the smallest value of a number collection.
COUNTReturns the number of elements in a collection.
DISTINCTReturns the unique values of a collection.

Conversions​

FunctionDescription
DECIMAL TO TEXTConverts a floating-point value to text.
TEXT TO DECIMALConverts text to a floating-point value.
TEXT TO DATEConverts text to a date. Lets you convert a date written in a non-standard format – both the date and its format must be given as text.
FORMAT DATEFormats a date according to the given pattern.

Files​

FunctionDescription
ATTACHMENTS COUNTReturns the number of attachments related to the element.
CONTENT AS BASE64Returns the attachment content in Base64 format.
CONTENT TYPEReturns the MIME type of the attachment.
FILE NAMEReturns the file name of the attachment.
GET ATTACHMENTSReturns the IDs of one or more attachments of the element.
PICTURELoads a file and returns it in Base64 format.
GET PHOTO GEOLOCATIONRetrieves the location from the photo metadata in the 'Latitude, Longitude' format. Collection values are separated by semicolons.
info

Additional information on business rules can be found on the KB technical blog in the following articles: