Business process setup guide (BPMS)
PDF
This documentation is valid for Creatio version 7.7.0. We recommend using the newest version of Creatio documentation.

[Formula] process item

With the [Formula] process item, you can use the calculation results as parameter values of other items (Fig. 164).

Fig. 164 [Formula] items

scr_process_designer_script_task_formula.png 

For example, you can determine the start time of the next task based on the duration of the preceding tasks.

The logic of the [Formula] item is also used to define conditions for moving down the conditional flows.

Parameters

Process item parameters are specified in the card (Fig. 165) that opens when an item is added to a process. You can also open this card by double-clicking the corresponding process item.

Fig. 165 [Formula] item parameter card

scr_process_designer_script_task_formula_crd.png 

[Caption] – Enter the caption of the process item that will be displayed in the diagram.

[Set parameter value] – Specify the parameter whose value will contain the calculation result. For example, specify the [Duration] parameter of the [Task] process item if the formula is used to calculate the duration of a task. You can select a parameter whose value is a number, date and/or time, as well as text and boolean parameters.

Attention!

The resulting data type will correspond the data type of the parameter specified in the [Set parameter value] field.

When adding the [Formula] process item, you can only specify the parameters that already exist in the process. Each [Formula] process item performs calculations for one parameter only.

A formula is constructed in the text field of the card. Use the [Operator], [Function], [Parameter] and [Value] buttons to construct a formula.

Attention!

Use the [Function], [Parameter] and [Value] buttons to enter all functions, parameters and values of a formula. Manual input of functions, parameters and values (with the exception of numeric data) will result in the process behaving incorrectly.

Operator

The [Operator] menu contains the list of mathematical operators that can be used to construct a formula. This list includes the adding, subtracting, multiplying, and dividing operators. Also, there is the [()] operator that is used to insert parentheses that determine operation precedence in a formula.

Note

If you select any part of formula text and add the [()] operator, this text will be automatically enclosed in parentheses.

Function

The [Function] menu contains the list of base mathematical functions. A function is performed for an expression, number or several numbers enclosed in parentheses.

Note

If you select any part of formula text and add a function, this text will be automatically enclosed in parentheses of this function.

[RoundUp()] – Round to the greater integer number. If decimals are not equal to zero, the integer number will be increased by 1. For example, “1,1” will be rounded to “2”.

[RoundOff()] – Round to the nearest integer number. For example, “1,4” will be rounded to “1”, and “1,5” – to “2”.

[RoundDown()] – Round to the smaller integer number. For example, “1,9” will be rounded to “1”.

[RemainderAfterDivision()] – Determine the remainder after dividing one number by another. In parentheses, enter a dividend and divider separated by a comma. For example, “1” will be the result of the “RemainderAfterDivision(5, 2)” function.

[Minimum()], [Maximum()] – Select the minimum and maximum values accordingly. In parentheses, enter compared numbers separated by commas. For example, “1” will be the result of the “Minimum(1, 2, 3)” function.

[Module()] – Obtain the module of a number. Use this function if the calculated number cannot be negative. For example, a module can be used when calculating the difference between durations of two tasks.

[Average()] – Calculate the average of several numbers. In parentheses, enter the needed numbers separated by commas. For example, “2” will be the result of the “Average(1, 2, 3)” function.

Functions can be performed for definite numbers as well as for variables or expressions. When working with expressions, you can set the calculation order by using parentheses. For example, “RoundOff(Average([#Task 1.Duration#], [#Task 2.Duration#]) * 1,2)”.

[Day()] – Select a day of month from the data with the “Date/Time” or “Date” type. Use the [Value] menu to specify the date value in the parenthesis or the [Parameter] button to specify the value of the process parameter or process item parameter. For example, “18” will be the result of the “Day([#Date Value.18/04/013#])” function.

[Month()] – Select a month from the data with the “Date/Time” or “Date” type. Use the [Value] menu to specify the date value in the parenthesis or the [Parameter] button to specify the value of the process parameter or process item parameter. For example, the number of the current month will be result of the “Month([#System Variable.Current Date Value#])” function.

[DayOfWeek()] – Select a number for a day of the week from the data with the “Date/Time” or “Date” type. For example, “1” will be the result of the “DayOfWeek([#Date value.18/04/013#])” function as this date falls on Monday.

[Time()] – Select the value of time from the data with the “Date/Time” or “Time” type. For example, the current time value will be the result of the “Time([#System Variable.Current Date and Time Value#])” function.

[DayIsInRangeOfDate()] – Check whether the specified date falls within the specified period. For example, the “[DayIsInRangeOfDate([#System Variable.Current Date Value#],[#Date Value.18.04.2013#],5,3)]” function checks whether the current date falls within the range from April 13 to April 21, 2013. The boolean value is the result of the function.

Parameters

Use the [Parameter] button to add process parameters and items to a formula. For example, the duration of a task that was previously performed in a process can be used in calculations. When you click this button, a standard window opens for parameter selection. You can select a parameter whose value is a number, date and/or time and also text and boolean parameters.

A parameter added to a formula is presented as a variable. For example, when performing calculations, the actual numeric value of the “Duration” parameter of the “Perform task” item is used instead of the “[#PerformTask.Duration#]” variable.

Value

With the help of the [Value] menu you can use the values of system settings and system variables in a formula. For example, you can use the current document number or current date in a formula.

The button menu contains the following sections:

[Date/Time] – Add a static value for the date and/or time to a formula.

[System setting] – Add a value of a system setting to the formula.

[Lookup value] – Add a record of any system object to the formula as a value of the “lookup” field.

[System variable] – Add a value of a system variable to the formula, for example, the current date.