Available functions

Page contains content of all embedded functions. Functions can be used e.g. for:

  • initial processing parameters (e.g.  form action)
  • creating call conditions (e.g. validators)

In each of the function parameters a constant, variable ( $variable_id ) or other function can be used ( #function_name() ) eg:

#round( #sum( [$var1, $var2] ), 2)

General use

General functions used for different sort of data.

Name

Description

Function variants

 eq

Checks if given values are equal.

eq(v1, v2) : boolean

v1

First value (any)

 v2

Second value (any)

Result:

True if both values are equal

// equal
eq( 1, 1.00 )
eq( "text", "text" )
 
// not equal
eq( 1, 1.01 )
eq( "text", "text" )

ieq 

 Checks if given parameters are equal. Ignores case size in case of text.

ieq(v1, v2) : boolean

v1 (string)

First value (any)

v2 (string)

Second value (any)

Result:

True if both given texts are equal ignoring the case size of text.

equal
ieq( "text", "text" )
 
// not equal
ieq( "text", "text" )

 empty

Checks if given value is empty or have one empty element.

empty(value) : boolean

value

Any type value is checked.

Result:

True if value is empty or have one empty element.

// empty
empty(null)
empty( "" )
empty( [] )
empty( $var1 )
empty( [""] )
empty( [null] )  
// not empty
empty( "text" )
empty( [1, 2] )

anyEq

Checks if any value from the list is equal to given value.

anyEq(v1[], v2) : boolean

v1[]

Any table with values.

v2

Any same type value like value from v1 table.

Result:

True if any value from v1 table equals v2

Example

// true
anyEq([1,2],1)
anyEq([3,2,1],1)
anyEq([1],1)
 
// false
anyEq([3,2,1],5)

Text

Functions for working with text

Name

Description

Function variants

concat

 Concatenates given text fragments.

concat(strings) : string

strings (string[])

An array containing text fragments.

Result:

Text created from combination of the given fragments

// returns "text"
concat(["te", "xt"])

join

Combines the given text fragments using the given separator.

Update from version 3.2.48 - added support for new parameter types (numbers, logical values, dates, dates with time)

join(fragments, [separator] ) : string

fragments (object[])

Table containing text fragments / numbers / logical values / dates / dates with time

separator (string)

The character by which all fragments will be combined. Default " " (space).

Result:

The text was created by combining the given fragments with a separator

// returns "Jan Kowalski"
join(["Jan", "Kowalski"])
 
// returns "1;2;3"
join([1, 2, 3], ";")
 
// returns ";"
join(["", ""], ";");
 
// returns "2;;3"
join([2,null,3], ";");

capitalize

Changes first character of given text to capital letter.

capitalize(text) : string

text (string)

Initial text

Result:

Text with first character in capital letter.

// returns "Text"
capitalize("text")

lowerCase

Replaces all characters in the given text with lowercase letters.

lowerCase(text) : string

text (string)

Initial text

Result:

Text saved in lowercase letters.

// returns "text"
lowerCase("TEXT")

upperCase

Replaces all characters in the given text with uppercase letters.

upperCase(text) : string

text (string)

Initial text

Result:

Text saved in uppercase letters.

// returns "Tekst"
lowerCase("tekst")

substring

Returns the text created by extracting a part of the given text according to the parameters.

substring(text, start, [length]) : string

text (string)

Initial text

start (integer)

Initial index

length (integer) [opcjonalny]

The length of the extracted sub-text (by default to the end of the initial text).

Result:

Text that is a part of the initial text.

// returns "ext"
substring("text", 1)
 
// returns "ex"
substring("text", 1, 2)

matchesRegexp

Checks whether the given text matches the given regular expression.

matchesRegex(text, regexp) : boolean

text (string)

Checks the text.

regexp (string)

Regular expression that the text must meet.

Result:

True if the given text matches the given regular expression.

// matches
matchesRegexp("text", "t.*")
 
// not matches
matchesRegexp("text", "t")

replace

Replaces all occurrences of the given text in the initial text.

replace(text, pattern, replacement) : string

text (string)

Initial text

pattern(string)

Pattern

replacement (string)

Replacement

Result:

Text with all occurrences of the pattern replaced in the initial text.

// returns "Today is 2016-01-01"
replace("Today is date_",
"_date_", #currentDate())

replaceRegexp

Replaces all occurrences of the text that match the given regular expression in the initial text.

replaceRegexp(text, regex, replacement) : string

text (string)

Initial text

regex(string)

Regular expression

replacement (string)

Replacement

Result:

Text with all matching occurring regular expression instances replaced in the initial text.

// returns "XbcXe"
replaceRegexp("abcde", "[ad]", "X")

trim

Removes all whitespaces from the beginning and end of the given text.

trim(text) : string

text (string)

Initial text

Result:

Initial text with removed whitespaces from the beginning and the end of the given text.

// returns "sample text"
trim(" sample text  ")

emptyString

Returns an empty string.

emptyString() : string

Result:

Text in the form: ""

// returns empty string
emptyString()

format

Formats the number by the given separators and the number of decimal places.

format(value, decimalLen, decimalSeparator, thousandSeparator) : string

value (float/integer)

Numerical value to be formatted.

decimalLen (integer)

Number of decimal places

decimalSeparator (string)

Decimal separator

thousandSeparator (string)

Thousand separator (in the case of an empty string, the separator will not appear)

Result:

Formatted numerical value in text form.

// returns "9 999,1230"
format(9999.123, 4, ",", " ")
 
// returns "9,999.1230"
format( 9999.123, 4, ".", "," )
 
// returns "10000"
format(10000.123, 0, ",", "")
 
// returns "149,13"
format(149.125, 2, ",", " ")

formatText

Formats a string of characters by the given schema

formatText(schema, parameters, [customRegex]) : string

schema (string)

A schema in which consecutive characters # (or given as an optional customRegex parameter) will be replaced by subsequent characters from parameters.

parameters (string[])

Text parameters whose subsequent characters will be entered into the schema.

customRegex (string)

Parameter that changes the "#" character in the schema by default, to any other

Result:

A character string formatted according to the schema

// returns AAA-BBB-123
formatText("###-BBB-###", ["AA", "A123"])
 
// returns #1234BB
formatText("#ZZZZZZ", ["1234BB"], "Z")

substringLast

Returns the last n characters of the string

substringLast(s, nChars) : string

s(string)

The initial text value.

nChars(integer)

Number of characters.

Result:

A string of defined length or shorter if the original string is shorter than the desired number of returned characters (then the function returns the original string).

// returns cd
substringLast("abcd", 2)
 
// returns ab
substringLast("ab", 3)

length

 

Returns the lenght of the given text

length(text) : integer

text(string)

Text

Result:

Text lenght

Example

// returns 0
length(null)
length("")
 
// returns 11
length("text - text")

indexOf

Returns the occurrence number of the character string in the given text. Searches from the beginning to the end of the given text.

If not found, then returns -1;

First position in the text have index 0

indexOf(text,searchText) : integer

indexOf(text,searchText,start) : integer

text(string)

Text to be searched

searchText(string)

Search string

start(integer)

Initial position - position in the text from which the search should start

Result:

Text lenght

Example

// returns 3 
indexOf("Alice have a cat, cat have alice and all ends with a happy end”.”al")
// returns 2
indexOf("Alice have a cat, cat have alice and all ends with a happy end.","al",30)
 

lastIndexOf

Returns the occurrence number of the character string in the given text. Searches from the beginning to the end of the given text.

If not found, then returns -1;

First position in the text have index 0

lastIndexOf(text,searchText) : integer

lastIndexOf(text,searchText,start) : integer

text(string)

Text to be searched

searchText(string)

Search string

start(integer)

Initial position - position in the text from which the search should start

Result:

Text lenght

 

Example

// returns 30
lastIndexOf("Alice have a cat, cat have alice and all ends with a happy end.","al")
 
// returns 1
lastIndexOf("Alice have a cat, cat have alice and all ends with a happy end.","al",10)
 

split

Separates text into arrays with the given pattern (text or regular expression) 

split(text,regexp):string[]

text(string)

Initial text

regex(string)

Pattern (regular expression or text)

 

Example

// returns ["Ala has a cat" , "cat has ale"]
split("ala has a cat, cat has ale",",")
 
// returns ["Ala" , "cat, cats" , "ale"]
split("Ala has cat, cat has ale","has")
// returns ["Ala", "Ewa", "Marta"]
split("Ala12423423Ewa1234Marta","\d+")
 

newLine

Inserts a newline character

newLine() : string

Result:

Text in the form: "\r\n"

 

// returns newline character
newLine()

Mathematical

Functions for performing mathematical operations.

Name

Description

Function variants

abs

Calculates the absolute value from the given number.

abs(value) : integer|float

value (|integer|float)

Any number

Result:

Absolute value from the given value

//returns 1.23
sum( -1.23 )

calc

Calculates the result of a mathematical operation.

calc(num1, operator, num2) : integer|float

num1 (integer|float)

Any number

operator (string)

Operator:

  • +: addition
  • -: subtraction
  • *: multiplication
  • /: division

num2 (integer|float)

Any number

Result:

Result of operation in accordance with the given operator

// addition
expr( 2, '+', 2 )
// subtraction
expr( 2, '-', 2 )
// multiplication
expr( 2, '*', 2 )
// division
expr( 2, '/', 2 )

le

Checks whether the number is less than or equal to the specified number.

le(num1, num2) : boolean

num1 (integer|float)

Any number

num2 (integer|float)

Any number

Result:

True if number num1 is less or equal than the number num2.

// 'false'
le(11, 10)
// 'true'
le(10, 10)
// 'true'
le(9, 10)

lt

Checks whether the number is less than the specified number.

lt(num1, num2) : boolean

num1 (integer|float)

Any number

num2 (integer|float)

Any number

Result:

True if number num1 is less than number num2.

// 'false'
lt(11, 10)
// 'false'
lt(10, 10)
// 'true'
lt(9, 10)

ge

Checks whether the number is greater than or equal to the specified number.

ge(num1, num2) : boolean

num1 (integer|float)

Any number

num2 (integer|float)

Any number

Result:

True if number num1 is greater than or equal to the number num2.

// 'true'
ge(11, 10)
// 'true'
ge(10, 10)
// 'false'
ge(9, 10)

gt

Checks whether the number is greater than the specified number.

gt(num1, num2) : boolean

num1 (integer|float)

Any number

num2 (integer|float)

Any number

Result:

True if the number num1 is greater than the number num2.

// 'true'
gt(11, 10)
// 'false'
gt(10, 10)
// 'false'
gt(9, 10)

ceil

Rounding up. Returns the smallest integer greater than or equal to the specified number.

ceil(value) : integer

value (float)

Rounded number

Result:

The smallest integer greater than or equal to the specified number.

//returns 3
ceil( 3 )
ceil( 2.11 )

floor

Rounding down. Returns the largest integer less than or equal to the specified number.

floor(value) : integer

value (float)

Rounded number

Result:

The smallest integer less than or equal to the specified number.

//returns 2
ceil( 2 )
ceil( 2.65 )

round

Rounds a number to the given number of decimal places.

round(value, [places]) : float

value (float)

Rounded number

places (integer) [opcjonalny]

The number of decimal places to which it rounds off. By default, rounding to the integer part (0).

Result:

The number is rounded to the given number of decimal places

//returns 12
round( 12.236 )
 
//returns 12.24
round( 12.236, 2 )

min

Returns the smallest of the given numbers.

min(numbers) : integer|float

numbers (integer[]|float[])

Array of numbers

Result:

Returns the smallest of the given numbers.

//returns 1
min( [1, 10, 5] )

max

Returns the largest of the given numbers.

max(numbers) : integer|float

numbers (integer[]|float[])

Array of numbers

Result:

Returns the largest of the given numbers.

//returns 10
min( [1, 10, 5] )

sum

Returns the sum of all given numbers.

sum(numbers) : float

numbers (integer[]|float[])

Array of numbers

Result:

Returns the sum of all given numbers.

//returns 6
sum( [1, 10, -5] )

anyLe

Checks whether any number from the array is less than or equal to the specified number.

anyLe(num1[], num2) : boolean

num1[] (integer|float)

Any array of numbers

num2 (integer|float)

The number of the same type as the numbers in the table num1

Result:

True weather any number from num1 is less than or equal to the number num2.

// returns true
anyLe([1,2,3],1)
anyLe([0,2,3],1)
 
// returns false
anyLe([2,2,3],1)

anyLt

Checks whether any number from the array is less than the specified number.

anyLt(num1[], num2) : boolean

num1[] (integer|float)

Any array of numbers

num2 (integer|float)

The number of the same type as the numbers in the table num1

Result:

True weather any number from num1 is less than the number num2.

// returns true
anyLt([0,2,3],1)
 
// returns false
anyLt([1,2,3],1)
anyLt([2,2,3],1)

anyGe

Checks whether any number from the array is greater than or equal to the specified number.

anyGe(num1[], num2) : boolean

num1[] (integer|float)

Any array of numbers

num2 (integer|float)

The number of the same type as the numbers in the table num1

Result:

True weather any number from num1 is greater than or equal to the number num2.

// returns true
anyGe([1,2,3],1)
anyGe([2,2,3],1)
 
// returns false
anyLt([0,0,-1],1)

anyGt

Checks whether any number from the array is greater than the specified number.

anyGt(num1[], num2) : boolean

num1[] (integer|float)

Any array of numbers

num2 (integer|float)

The number of the same type as the numbers in the table num1

Result:

True weather any number from num1 is greater than number num2.

// returns true
anyLt([1,0,3],1)
// returns false
anyLt([1,0,1],1)
anyLt([0,0,-2],1)

Logical

Logical operators are useful primarily in the conditions of launching an action, validator, etc. 

Complex conditions can be created thanks to those operators, e.g. the condition value of the variable 'var1' is equal to 'yes' or the value of variable 'var1' is equal to 'no' and simultaneously the value of the variable 'var2' is equal to 'yes':

#or( #eq( $var1, "yes" ), #and( #eq( $var1, "no” ), #eq( $var2, "yes" ) ) )

Name

Description

Function variants

not

Returns the negation of the passed parameter.

not(value) : boolean

value (boolean)

Logical value

Result:

Returns the negation of the passed parameter.

//returns false
not( true )

and

The logical ratio returns true if all passed parameters are true.

and(values) : boolean

values (boolean[])

Array of logical values

Result:

Returns the logical ratio of all passed values

//returns true
and( true, true )
 
//returns false
and( false, true )
 
//returns false
and( false, false )

or

The logical sum returns true if at least one of the passed parameters is true.

or(values) : boolean

values (boolean[])

Array of logical values

Result:

Returns the logical sum of all passed values.

//returns true
or( true, true )
 
//returns true
or( false, true )
 
//returns false
or( false, false )

Date and time

Functions for date and time processing.

Name

Description

Function variants

currentYear (CUF-Components 1.0.1)

Returns the current year

currentYear() : integer

 

Result:

 

Full year e.g. 2017.

calculateDaysDifference (CUF-Components 1.0.2)

Calculates the difference in days between two dates.

 

 calculateDaysDifference() : integer

 

firstDate (date)

 

First date

 

secondDate (date)

 

Second date

 

includeFreeDays (boolean)

 

Including holidays. If we include holidays, the difference will be greater by the number of days off between dates (including those dates).

This function takes into account the system parameter "CustomHolidays". This parameter contains a list of additional free days separated by a semicolon ( ; ). The dates can be entered in full (2018-05-02) or abbreviated form (05-02). for example: 2018-05-02;05-04

 

Result:

 

Number of days resulting from a two-sided closed interval determined by two dates. Since the interval is closed on both sides, if two adjacent days fulfilling the criterion are given, the function returns the value 2.

currentDate

Returns the current date.

currentDate() : date

Result:

Current date.

//returns current date.
//np. 2016-01-01
currentDate()

currentDateTime

Returns the current date and time.

currentDateTime() : datetime

Result:

Current date and time.

//returns current date and time.
//np. 2016-01-01 12:30:45
currentDateTime()

formatDate

Formats the given date to a text form according to the given format.

formatDate(date, format) : string

date (date|datetime)

Formatted date.

format (string)

Date format. Embedded formats are available:

  • datetime np. 2015-12-31 12:33:44
  • date np. 2015-12-31
  • time np. 12:33:44
  • year np. 1991
  • month np. 06
  • day np. 12

Result:

Current date and time.

// 2015-12-31 12:33:44
 
//returns "2015-12-31"
formatDate(#currentDateTime(), "date")

calcDate

Calculates the date based on the parameters provided. Allows you to add / subtract from the given date years, months, days, etc.

calcDate(date, interval, unit) : date

date (date)

Base date

interval(integer)

The period of time that will be added / removed from the given date

unit (string)

Time unit, one of:

  • y or year - year
  • m or month - month
  • w or week - week
  • d or day - day

Result:

Calculated date

// 2015-12-31
 
//returns 2015-12-32
calcDate(#currentDate(), 1, "day");
 
//returns 2014-12-32
calcDate(#currentDate(), -1, "y");

calcDateTime

Calculates the date and time based on the parameters provided. Allows you to add / subtract from the given date years, months, days, hours, minutes etc.

calcDateTime(date, interval, unit) : datetime

date (datetime)

Base date

interval(integer)

The period of time that will be added / subtracted from the given date

unit (string)

Time unit, one of:

  • y or year - year
  • m or month - month
  • w or week - week
  • d or day - day
  • h lub hour - hour
  • i lub minute - minute
  • s lub second - second

Result:

Calculated date

// 2015-12-31 12:33:44
 
//returns 2015-12-32 12:33:44
calcDate(#currentDateTime(), 1, "day");
 
//returns 2014-12-32 12:33:44
calcDate(#currentDateTime(), -1, "y");

le

Checks whether the date transferred in the first parameter is less than or equal to the date transferred in the second parameter

le(date1, date2) : boolean

date1 (date/datetime)

First date to be compared

date2 (date/datetime)

Second date to be compared

Result:

True or false

 

 

// data1 is LocalDate object with value "2016-12-24"
// data2 is LocalDate object with value "2016-12-24"
// returns true
le(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDate object with value "2016-12-24T12:35:22"
// returns true
le(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDate object with value "2016-12-24T12:35:23"
// returns true
le(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDate object with value "2016-12-24T12:35:21"
// returns false
le(data1, data2)

 

lt

Checks whether the date transferred in the first parameter is less than the date passed in the second parameter

lt(date1, date2) : boolean

date1 (date/datetime)

First date to be compared

date2 (date/datetime)

Second date to be compared

Result:

True or false

// data1 is LocalDate object with value "2016-12-24"
// data2 is LocalDate object with value "2016-12-24"
// returns false
lt(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:22"
// returns false
lt(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:23"
// returns true
lt(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:21"
// returns false
lt(data1, data2)

ge

Checks whether the date transferred in the first parameter is greater than or equal to the date transferred in the second parameter

ge(date1, date2) : boolean

date1 (date/datetime)

First date to be compared

date2 (date/datetime)

Second date to be compared

Result:

True or false

// data1 is LocalDate object with value "2016-12-24"
// data2 is LocalDate object with value "2016-12-24"
// returns true
ge(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:22"
// returns true
ge(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:23"
// returns false
ge(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:21"
// returns true
ge(data1, data2)

gt

Checks whether the date given in the first parameter is greater than the date given in the second parameter

gt(date1, date2) : boolean

date1 (date/datetime)

First date to be compared

date2 (date/datetime)

Second date to be compared

Result:

True or false

// data1 is LocalDate object with value "2016-12-24"
// data2 is LocalDate object with value "2016-12-24"
// returns false
gt(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:22"
// returns false
gt(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:23"
// returns false
gt(data1, data2)
 
// data1 is LocalDateTime object with value "2016-12-24T12:35:22"
// data2 is LocalDateTime object with value "2016-12-24T12:35:21"
// returns true
gt(data1, data2)

Table actions

Functions that perform basic activities on the tables

Name

Description

Function variants

item

Returns the element of the array with the given index.

item(index, array) : object

index (integer)

Item index

array (object[])

Array of any type

Result:

Element from the given index

//returns  "b"
 item(1, ["a", "b"]);

length

Returns the length of the array. In case of checking if table has 0 length, we should use emptyArray function, because length returns wrong value for arrays of 0 length.

length(array) : integer

array (object[])

Array of any type

Result:

Table lenght

 //returns 2 
length(["a", "b"]);

formatArray

Formats the number by the given separators and the number of decimal places for each value in the table.

format(value[], decimalLen, decimalSeparator, thousandSeparator) : string[]

value (float[]/integer[])

An array of numeric values to format

decimalLen (integer)

Number of decimal places

decimalSeparator (string)

Fractional separator

thousandSeparator (string)

Thousand separator (in the case of an empty string, the separator will not appear)

Result:

The formatted numerical value in the form of a text table 

// returns ["9 999,1230","1 234,0000", "4 234,1234"]
format([9999.123 , 1234 , 4321.12345], 4, ",", " ")
 
// returns ["9,999.1230"]
format( [9999.123], 4, ".", "," )
 
// returns ["10000"]
format([10000.123], 0, ",", "")
 
// returns ["149,13"]
format([149.125], 2, ",", " ")

formatTextArray

Formats a string of characters by the given schema for each value in the array.

 

formatText(schema[], parameters, [customRegex]) : string[]

schema (string[])

An array of schemas, in which consecutive characters # (or given as an optional parameter customRegex) will be replaced by consecutive characters from parameters.

parameters (string[])

Text parameters whose subsequent characters will be entered into the schema.

customRegex (string)

Parameter that changes the "#" character in the schema by default, to any other

Result:

An array of strings formatted according to the schema 

// returns ["AAA-BBB-123","ACAFA123"]
formatText(["###-BBB-###","#C#F####"], ["AA", "A123"])
 
// returns ["#1234BB","12034##BB"]
formatText("#ZZZZZZ",ZZ0ZZ##ZZ ["1234BB"], "Z")

intersect

(since CUF-Components 1.0.30 )

A common part of two tables. Returns elements that are in both the first and the second table, without repetition.

intersect(arr1, arr2) : object[]

arr1 (string[] | integer[] | float[] | date[])

First value array

arr2 (string[] | integer[] | float[] | date[])

Second value array

Result:

Value array (common part of tables) of the type depending on the selected parameters. 

// returns ["aaa"]
intersect(["aaa", "ccc"], ["aaa", "bbb"])
 
// returns [5]
intersect([null, 4, 5], [5, 1])
 
// returns []
intersect([true], [false, null])

except

(since CUF-Components 1.0.30 )

The difference between two tables. Returns items that are in the first, but not in the second array, without repetition.

except(arr1, arr2) : object[]

arr1 (string[] | integer[] | float[] | date[])

First value array

arr2 (string[] | integer[] | float[] | date[])

Second value array

Result:

Table of values (difference of tables) with a type depending on the selected parameters. 

// returns ["ccc"]
except(["aaa", "ccc"], ["aaa", "bbb"])
 
// returns [null, 4]
except([null, 4, 5], [5, 1])
 
// returns [true]
except([true], [false, null])

union

(since CUF-Components 1.0.30 )

The sum of two tables. Returns elements that are in the first or second array, without repetition.

union(arr1, arr2) : object[]

arr1 (string[] | integer[] | float[] | date[])

First value array

arr2 (string[] | integer[] | float[] | date[])

Second value array

Result:

Array of values (sum of tables) with a type depending on the selected parameters.

 

// returns ["aaa", "ccc", "bbb"]
union(["aaa", "ccc"], ["aaa", "bbb"])
 
// returns [null, 4, 5, 1]
union([null, 4, 5], [5, 1])
 
// returns [true, false, null]
union([true], [false, null])

symmetricDifference

(since CUF-Components 1.0.30 )

The symmetric difference of two tables. Returns elements that are not simultaneously in the first and second table, without repetition.

symmetricDifference(arr1, arr2) : object[]

arr1 (string[] | integer[] | float[] | date[])

First value array

arr2 (string[] | integer[] | float[] | date[])

Second value array

Result:

Table of values (symmetrical difference of tables) with a type depending on the selected parameters.

 

// returns ["ccc", "bbb"]
symmetricDifference(["aaa", "ccc"], ["aaa", "bbb"])
 
// returns [null, 4, 1]
symmetricDifference([null, 4, 5], [5, 1])
 
// returns [true, false, null]
symmetricDifference([true], [false, null])

unionAll

(since CUF-Components 1.0.30 )

The sum of two tables. Creates a new table by merging two arrays passed in the parameter.

unionAll(arr1, arr2) : object[]

arr1 (string[] | integer[] | float[] | date[])

First value array

arr2 (string[] | integer[] | float[] | date[])

Second value array

Result:

Table of values (sum of tables) with a type depending on the selected parameters.

 

// returns ["aaa","ccc", "aaa", "bbb"]
unionAll(["aaa", "ccc"], ["aaa", "bbb"])
 
// returns [null, 4, 5, 5, 1]
unionAll([null, 4, 5], [5, 1])
 
// returns [true, false, null]
unionAll([true], [false, null])

distinct

(since CUF-Components 1.0.30 )

A function that returns an array of values without repetition from the table passed in the parameter.

distinct(array) : object[]

array (string[] | integer[] | float[] | date[])

Value array

Result:

An array with values of a type depending on the type passed in the parameter

 

// returns ["aaa", "bbb"]
distinct(["aaa", "bbb", "aaa"]) 
 
// returns [null, 4, 5]
distinct([null, 4, 5, null, 4)
 
// returns [true, false]
distinct([true, true, true, false, false])

Type conversion

Features that allow conversion of types

Name

Description

Function variants

toString

Converts the given value to its default text form. It is possible to convert from:

  • logical value (boolean)
    • true = "true"
    • false = "false"
  • integer (integer)
    • 123 = "123"
  • floating point number
    • 123.12 = "123.12"
  • date - formats the date using the default format "yyyy-MM-dd"
    • 2016-01-01 = "2016-01-01"
  • date and time (datetime) - formats the date using the default format "yyyy-MM-dd HH:mm:ss"
    • 2016-01-01 12:11:22 = "2016-01-01 12:11:22"

toString(value) : string

value (boolean|integer|float|date|datetime)

Converted value

Result:

Text representing the value

//returns "false"
toString(false);

toStringArray

Converts a given table of values to an array of text values. The conversion rules are the same as for the toString function.

 toStringArray(array) : string[]

array (boolean[]|integer[]|float[]|date[]|datetime[])

Converted value array

Result:

Text array

//returns ["false", "true"]
toStringArray([false, true]);

toBoolean

Converts the given value to a boolean value. It is possible to convert from:

  • text value (string)
    • "true" = true
    • "false" = false
  • integer (integer)
    • 0 = false rest true
  • floating point number (float)
    • 0.0 = false rest true

toBoolean(value) : boolean

value (string|integer|float)

Value to be converted

Result:

Logical value

//returns true
toBoolean("true");

toBooleanArray

Converts a given table of values into a Boolean array. The conversion rules are the same as for the toBoolean function.

toBooleanArray(array) : boolean[]

array (string[]|integer[]|float[])

Converted value array

Result:

Array of logical values

//returns [false, true]
toBooleanArray([0, 1]);

toInteger

Converts the given value to an integer. It is possible to convert from:

  • logical value (boolean)
    • true = 1
    • false = 0
  • text value (string)
    • "123" = 123
  • floating point number (float) – rounding to the nearest integer
    • 123.56 = 124

toInteger(value) : integer

value (boolean|string|float)

Converted value

Result:

Integer

//returns 123
toInteger("123");

toIntegerArray

Converts a given table of values to an array of integers. The conversion rules are the same as in toInteger function.

toIntegerArray(array) : integer[]

array (boolean[]|string[]|float[])

Converted value array

Result:

Array of integers

//returns [1, 2]
toIntegerArray(["1", "2"]);

toFloat

Converts the given value to a floating-point number. It is possible to convert from:

  • Logical value (boolean)
    • true = 1.0
    • false = 0.0
  • Text value (string)
    • "123.123" = 123.123
  • Integer (integer)
    • 123 = 123.0

toFloat(value) : float

value (boolean|string|integer)

Converted value

Result:

Floating point number

//returns 123.123
toFloat("123.123");

toFloatArray

Converts a given table of values to a floating-point number table. The conversion rules are the same as for the toFloat function.

 

toFloatArray(array) : float[]

array (boolean[]|string[]|integer[])

Converted value array

Result:

Array of floating-point numbers

//returns [1.0, 2.3]
toFloatArray(["1", "2.3"]);

toDate

Converts string value to date

toDate(value) : date

value (string) - String value

Result:

Date from string value

// returns LocalDate object with date 1991-06-12

toDate("1991-06-12");

// returns null

toDate("");

toDate(null);

toDateArray

Converts array of string values to array of date values

toDateArray(value) : date[]

values (string[]) - Array of string values

Result:

Date array from string array

// returns array of LocalDate values

toDateArray(["1991-06-12", "1991-06-13"] );

// returns emptyArray

toDateArray([])

toDateTime

Converts string value to datetime

toDateTime(value) : datetime

value (string) - String value

Result:

Datetime from string value

// returns LocalDateTime object with date 1991-06-12 11:09:22

toDateTime("1991-06-12 11:09:22");

// returns null

toDateTime("");

toDateTime(null);

toDateTimeArray

Converts array of string values to array of datetime values

toDateTimeArray(value) : datetime[]

values (string[]) - Array of string values

Result:

Datetime array from string array

// returns array of LocalDateTime values

toDateTimeArray(["1991-06-12 11:09:12", "1991-06-13 11:09:11"] );

// returns emptyArray

toDateTimeArray([])

Contextual

Functions that use contexts to read data related to the currently performed action. Example is a function that returns the login of the currently logged in user.

 

Name

Description

Function variants

currentUser

 

 

Returns information about the current user. The parameterless option returns the login, whereas the variant with the parameter returns the given one of the following attributes:

  • username: login
  • firstname: name
  • lastname: surname
  • fullname: full name (name + surname)
  • email: email address
  • number: user number

currentUser() : string

Result:

Current user’s login.

// e.g. "admin"
currentUser()

currentUser(property) : string

property (string)

Name of the user’s attribute being returned.

Result:

Value of the given attribute of the current user

// e.g. "admin@suncode.pl"
currentUser("email")

currentUserGroups

 

Returns the list of group names of the current user.

 

currentUserGroups() : string[]

Result:

An array of group names to which the user belongs

// e.g. ["employee", "admin"]
currentUserGroups()

currentUserInGroup

Checks whether the current user belongs to the group with the given name.

currentUserInGroup(group) : boolean

group (string)

Group name

Result:

true if the user belongs to the given group

// true if belongs to group
currentUserGroups("employee")

currentUserPositions

Returns the symbols of all current user positions.

currentUserPositions() : string[]

Result:

Array of user positions

// e.g. ["p01", "d02"]
currentUserPositions()

currentUserPositionNames

Returns the names of all positions of the current user.

currentUserPositionNames() : string[]

Result:

Array of user positions

// e.g. ["Employee", "Approver"]
currentUserPositionNames() 

currentUserHasPosition

Checks whether the current user has a position with the given symbol.

currentUserHasPosition(symbol) : boolean

symbol (string)

Position symbol

Result:

true if user is assigned to the given position

 // true if user assigned to position
currentUserHasPostition("p01")

currentUserUnits

Returns the symbols of all organizational units of the current user.

currentUserUnits() : string[]

Result:

Array of symbols of the organizational units to which the user belongs

 // e.g. ["HR", "it"]
currentUserUnits()

currentUserUnitNames

Returns the names of all organizational units of the current user.

currentUserUnitNames() : string[]

Result:

Array of names of the organizational units to which the user belongs

 // e.g. ["HR department", "IT department"]
currentUserUnitNames()

currentUserInUnit

Checks whether the current user belongs to the organizational unit with the given symbol.

currentUserInUnit(symbol) : boolean

symbol (string)

Organizational unit symbol

Result:

true if the user belongs to the given organizational unit

// true if the user belongs to the unit
currentUserInUnit("it")

currentUserHigherPositions

Returns the symbols of all parent positions of the current user.

currentUserHigherPostitions() : string[]

Result:

Array of symbols of the user’s parent positions

 // e.g. ["kp"]
currentUserHigherPositions()

currentUserHigherPositionNames

Returns the names of all parent positions of the current user.

currentUserHigherPostitionNames() : string[]

Result:

Array of names of the user’s parent positions

// e.g. ["Production manager"]
currentUserHigherPositionNames() 

currentUserSupervisors

Returns the logins of all direct supervisors (from parent positions) of the current user.

currentUserSupervisors() : string[]

Result:

Array of logins of all direct supervisors of the current user

// e.g. ["akowalski"]
currentUserSupervisors() 

currentUserHasSupervisor

Checks whether the person with the given login is the current user's supervisor.

currentUserSupervisors(username) : boolean

username (string)

User login

Result:

true if the given user is the direct supervisor of the current user

// true if "akowalski" is
// supervisor of user
currentUserHasSupervisor("akowalski")

Conditional

Functions returning a given parameter after fulfilling a given condition

Name

Description

Function variants

ifFn

 

 

Conditional function (if) - returns the given parameter depending on the condition

parameters Object1 and Object2 must be the same type

available types:

  • integer
  • float
  • string
  • date
  • datetime
  • integer[]
  • float[]
  • string[]
  • date[]
  • datetime[]

ifFn( Boolean , Object1 , Object2 ) : Object

 

Boolean – condition of the function

Object1 – returns when the condition is true

Object2 - returns when the condition is false

 

Result:

 

The result is the Object1 or Object2 parameter depending on the fulfilled condition

// returns 2
ifFn(true,2,3);
// returns "NO"
ifFn(false,"YES", "NO");
// returns ["a","b"]
ifFn(false,["AA","BB","CC"], ["a","b"]);

Translation

 Functions for retrieving translations.

Name

Description

Function variants

translate

 

 

Returns the translation for the specified key. If the translation is not found, the given key is returned. Servers (scope = SERVER), client translators and translations from plugins are taken into account.

translate(text) : string

text (string)

String to be translated.

Result:

Translated string found from all available translators.

// e.g. "Yes", if user has
// Polish language set
translate("yes")

translate(text, translatorName) : string

text (string)

String to be translated.

translatorName (string)

Name of the translator

Result:

Translated string found in the given translator.

// e.g. "Faktury", if a client translator was created
// or the translation has been added to the plugin
// with this id
translate("invoices", "customTranslatorName")

translate(text, args, translatorName) : string

text (string)

String to be translated.

args (string[])

Parameters passed to the translator. Substituted for tags {0}, {1} etc.

translatorName (string)

Name of the translator

Result:

Translated string found in the given translator with the substituted parameters

// e.g. for translator name "customTranslatorName" and key
// invoice=Faktura no {0} from {1}
translate("invoice", ["123", "1000"], "customTranslatorName")
// result "Faktura no 123 from 1000”

It is preferred to use the function with the given name of the translator, because it clearly indicates the translation from among all translators loaded in the system.

User

Name

Description

Function variants

usersFromGroup (since CUF-Components 1.0.16 )

A server function that returns users from a given group and (optionally) an organizational unit

usersFromGroup(groupName) : string[]

groupName (string)

Group name

Result:

Array of user logins

usersFromGroup(groupName, ou) : string[]

groupName (string)

Group name

ou (string)

Organizational unit symbol

Result:

Array of user logins

usersWithRole (since CUF-Components 1.0.16)

 

A server function that returns users from a given role and (optionally) an organizational unit

usersWithRole(roleId)

roleId (string)

Role

usersWithRole(roleId, ou)

roleId (string)

Role

ou (string)

Organizational unit symbol

userSuperiors ( od CUF-Components 1.0.29 )

A server function that returns supervisors to the user. The array of values is returned, not the text.

userSuperiors(userName) : string[]

userName (string)

User name

usersFromOU

(since CUF-Components 1.0.29 )

A server function that downloads user logins from an organizational unit with the given name

usersFromOU(ou)

ou (string)

Organizational unit name

Result:

Table with user logins

usersFromOUSymbol

(since CUF-Components 1.0.29)

A server function that retrieves user logins from an organizational unit with the given symbol

usersFromOUSymbol(ousymbol)

ouSymbol

Organizational unit symbol

Result:

Table with user logins

usersWithPosition

(since CUF-Components 1.0.29)

A server function that retrieves user logins with a position with the given name

usersWithPosition(position)

postition

Position name

Result:

Table with user logins

usersWithPositionSymbol

(since CUF-Components 1.0.29)

A server function that retrieves user logins with a position with the given symbol

usersWithPositionSymbol(positionSymbol)

postitionSymbol

Position symbol

Result:

Table with user logins

Strona zawiera spis wszystkich wbudowanych funkcji. Funkcje te można wykorzystywać m.in. do:

  • wstępnego przetwarzania parametrów (np. akcji formularza)
  • tworzenia warunków wywołania (np. walidatory)

W parametrach każdej z funkcji możemy użyć stałej, zmiennej ( $id_zmiennej ) lub innej funkcji ( #nazwa_funkcji() ) np:

#round( #sum( [$var1, $var2] ), 2)

Ogólnego przeznaczenia

Funkcje ogólne działające na danych różnego typu.

NazwaOpisWarianty funkcji

 eq

 Sprawdza czy podane wartości są sobie równe.

eq(v1, v2) : boolean

v1

Dowolna pierwsza wartość

 v2

Dowolna druga wartość

Wynik:

True jeżeli podane wartości są sobie równe

// równe
eq( 1, 1.00 )
eq( "tekst", "tekst" )
 
// nie równe
eq( 1, 1.01 )
eq( "tekst", "Tekst" )

ieq 

 Sprawdza równość podanych parametrów. Ignoruje wielkość liter w przypadku tekstu.

ieq(v1, v2) : boolean

v1 (string)

Porównywany tekst

v2 (string)

Porównywany tekst

Wynik:

True jeżeli podane teksty są sobie równe bez uwzględnienia wielkości liter

równe
ieq( "tekst", "tekst" )
 
// nie równe
ieq( "tekst", "Tekst" )

 empty

Sprawdza, czy podana wartość jest pusta, bądź posiada jeden pusty element.

empty(value) : boolean

value

Sprawdzana wartość dowolnego typu

Wynik:

True jeżeli wartość jest pusta lub posiada jeden pusty element

// puste
empty( null ) 
empty( "" )
empty( [] )
empty( $var1 )
empty( [""] )
empty( [null] )  
// nie puste
empty( "tekst" )
empty( [1, 2] )

anyEq

Sprawdza. czy jakakolwiek wartość z listy jest równa podanej wartości

anyEq(v1[], v2) : boolean

v1[]

Dowolna tablica wartości

v2

Wartość tego samego typu co wartości z tabeli v1

Wynik:

True jeżeli którakolwiek z wartości w v1 jest równa v2

// prawda
anyEq([1,2],1)
anyEq([3,2,1],1)
anyEq([1],1)

// fałsz
anyEq([3,2,1],5)

Tekstowe

 Funkcje do pracy z tekstem.

NazwaOpisWarianty funkcji

concat

 Łączy podane fragmenty tekstu.

concat(strings) : string

strings (string[])

Tablica zawierająca fragmenty tekstu

Wynik:

Tekst powstały z połączenia podanych fragmentów

// zwróci "tekst"
concat(["te", "kst"])

join

Łączy podane fragmenty tekstu używając podanego separatora.

Aktualizacja od wersji 3.2.48 - dodano obsługę nowych typów parametrów (liczby, wartości logiczne, daty, daty z czasem)

join(fragments, [separator] ) : string

fragments (object[])

Tablica zawierająca fragmenty tekstu/liczby/wartości logiczne/daty/daty z czasem

separator (string)

Znak którym zostaną połączone wszystkie fragmenty. Domyślnie " " (spacja).

Wynik:

Tekst powstały z połączenia podanych fragmentów separatorem

// zwróci "Jan Kowalski"
join(["Jan", "Kowalski"])
 
// zwróci "1;2;3"
join([1, 2, 3], ";")

// zwroci ";"
join(["", ""], ";");

// zwróci "2;;3"
join([2,null,3], ";");

capitalize

Zamienia pierwszą znak podanego tekstu na wielką literę.

capitalize(text) : string

text (string)

Tekst wejściowy

Wynik:

Tekst z pierwszą dużą literą

// zwróci "Tekst"
capitalize("tekst")

lowerCase

Zamienia wszystkie znaki w podanym tekście na małe litery.

lowerCase(text) : string

text (string)

Tekst wejściowy

Wynik:

Tekst zapisany tylko małymi literami

// zwróci "tekst"
lowerCase("TEKST")

upperCase

Zamienia wszystkie znaki w podanym tekście na duże litery.

upperCase(text) : string

text (string)

Tekst wejściowy

Wynik:

Tekst zapisany tylko dużymi literami

// zwróci "Tekst"
lowerCase("tekst")

substring

Zwraca tekst powstały z wydzielenia części podanego tekstu zgodnie z parametrami.

substring(text, start, [length]) : string

text (string)

Tekst wejściowy

start (integer)

Index startowy

length (integer) [opcjonalny]

Długość wydzielonego podtekstu (domyślnie do końca tekstu wejściowego).

Wynik:

Tekst stanowiący część tekstu wejściowego.

// zwróci "ekst"
substring("tekst", 1)
 
// zwróci "ek"
substring("tekst", 1, 2)

matchesRegexp

Sprawdza, czy podany tekst jest zgodny z podanym wyrażeniem regularnym.

matchesRegex(text, regexp) : boolean

text (string)

Sprawdzany tekst

regexp (string)

Wyrażenie regularne które musi spełniać tekst.

Wynik:

True jeżeli podany tekst pasuje do podanego wyrażenia regularnego.

// spełnia
matchesRegexp("tekst", "t.*")
 
// nie spełnia
matchesRegexp("tekst", "t")

replace

Zamienia wszystkie wystąpienia podanego tekstu w tekście wejściowym.

replace(text, pattern, replacement) : string

text (string)

Tekst wejściowy

pattern(string)

Wzorzec

replacement (string)

Zamiennik

Wynik:

Tekst z zamienionymi wszystkimi wystąpieniami wzorca w tekście wejściowym.

// zwraca "Dzisiaj jest 2016-01-01"
replace("Dzisiaj jest _data_",
"_data_", #currentDate())

replaceRegexp

Zamienia wszystkie wystąpienia tekstu spełniającego podane wyrażenie regularne w tekście wejściowym.

replaceRegexp(text, regex, replacement) : string

text (string)

Tekst wejściowy

regex(string)

Wyrażenie regularne

replacement (string)

Zamiennik

Wynik:

Tekst z zamienionymi wszystkimi spełniającymi przekazane wyrażenie regularne wystąpieniami w tekście wejściowym.

// zwraca "XbcXe"
replaceRegexp("abcde", "[ad]", "X")

trim

Usuwa wszystkie białe znaki z początku i końca podanego tekstu.

trim(text) : string

text (string)

Tekst wejściowy

Wynik:

Tekst wejściowy z usuniętymi białymi znakami z początku i końca

// zwraca "przykładowy tekst"
trim(" przykładowy tekst  ")

emptyString

Zwraca pusty łańcuch znaków

emptyString() : string

Wynik:

Tekst w postaci: ""

// zwraca pusty łańcuch znaków
emptyString()

format

Formatuje liczbę wg. podanych separatorów i liczby miejsc po przecinku.

format(value, decimalLen, decimalSeparator, thousandSeparator) : string

value (float/integer)

Wartość liczbowa do sformatowania

decimalLen (integer)

Liczba miejsc po przecinku

decimalSeparator (string)

Separator ułamkowy

thousandSeparator (string)

Separator tysięczny (w przypadku pustego łańcucha znaków separator nie pojawi się)

Wynik:

Sformatowana wartość liczbowa w postaci tekstowej

// zwraca "9 999,1230"
format(9999.123, 4, ",", " ")

// zwraca "9,999.1230"
format( 9999.123, 4, ".", "," )

// zwraca "10000"
format(10000.123, 0, ",", "")

// zwraca "149,13"
format(149.125, 2, ",", " ")


formatText

Formatuje ciąg znaków wg. podanego schematu

formatText(schema, parameters, [customRegex]) : string

schema (string)

Schemat, w którym kolejne znaki #(lub podane jako opcjonalny parametr customRegex) zostaną zastąpione przez kolejne znaki z parameters.

parameters (string[])

Parametry tekstowe, których kolejne znaki zostaną wpisane do schematu

customRegex (string)

Parametr, który zmienia domyślnie podmieniany znak "#" w schemacie, na inny, dowolny

Wynik:

Łańcuch znaków sformatowany według schematu

// zwraca AAA-BBB-123
formatText("###-BBB-###", ["AA", "A123"])

// zwraca #1234BB
formatText("#ZZZZZZ", ["1234BB"], "Z")

substringLast

Zwraca n ostatnich znaków ciągu znaków

substringLast(s, nChars) : string

s(string)

Oryginalna wartość tekstowa.

nChars(integer)

Ilość znaków.

Wynik:

Ciąg znaków o zdefiniowanej długości lub krótszy, jeżeli oryginalny ciąg jest krótszy niż pożądana liczba zwróconych znaków (wtedy funkcja zwraca oryginalny ciąg).

// zwraca cd
substringLast("abcd", 2)

// zwraca ab
substringLast("ab", 3)

length

 

Zwraca długość podanego tekstu

length(text) : integer

text(string)

Tekst

Wynik:

Długość tekstu

// zwraca 0
length(null)
length("")

// zwraca 11
length("text - text")

indexOf

Zwraca nr wystąpienia ciągu znaku w podanym tekście. Szuka od początku do końca podanego tekstu.

Gdy nie znajdzie zwraca -1;

Pierwsza pozycja w tekście ma index 0

indexOf(text,searchText) : integer

indexOf(text,searchText,start) : integer

text(string)

Tekst do przeszukania

searchText(string)

Szukany ciąg znaków

start(integer)

Pozycja początkowa - pozycja w tekście od której ma zacząc przeszukiwać

Wynik:

Długość tekstu

 

// zwraca 7
indexOf("Ala ma kota, kot ma ale, i wszytko kończy się happy endem.","ko")
// zwraca 13
indexOf("Ala ma kota, kot ma ale, i wszytko kończy się happy endem.","ko",10)
 

lastIndexOf

Zwraca nr wystąpienia ciągu znaku w podanym tekście. Szuka od końca do początku podanego tekstu.

Gdy nie znajdzie zwraca -1;

Pierwsza pozycja w tekście ma index 0

lastIndexOf(text,searchText) : integer

lastIndexOf(text,searchText,start) : integer

text(string)

Tekst do przeszukania

searchText(string)

Szukany ciąg znaków

start(integer)

Pozycja początkowa - pozycja w tekście od której ma zacząc przeszukiwać

Wynik:

Długość tekstu

 

// zwraca 35
lastIndexOf("Ala ma kota, kot ma ale, i wszytko kończy się happy endem.","ko")

// zwraca 7
lastIndexOf("Ala ma kota, kot ma ale, i wszytko kończy się happy endem.","ko",10)
 

split

Rozdziela tekst na tablice za pomocą podanego wzorca (tekst lub wyrażenie regularne)

 

split(text,regexp):string[]

text(string)

Tekst wejściowy

regex(string)

Wzorzec (wyrażenie regularne lub tekst)

 

// zwraca ["Ala ma kota" , "kot ma ale"]
split("Ala ma kota, kot ma ale",",")

// zwraca ["Ala" , "kota, kot" , "ale"]
split("Ala ma kota, kot ma ale","ma")
// zwraca ["Ala", "Ewa", "Marta"]
split("Ala12423423Ewa1234Marta","\d+")
 

newLine

Wstawia znak nowego wiersza

newLine() : string

Wynik:

Tekst w postaci: "\r\n"

 

// zwraca znak nowego wiersza
newLine()

Matematyczne

Funkcje do wykonywania działań matematycznych.

NazwaOpisWarianty funkcji

abs

Oblicza wartość bezwzględną z podanej liczby.

abs(value) : integer|float

value (|integer|float)

Dowolna liczba

Wynik:

Wartość bezwzględna z podanej liczby

//zwraca 1.23
sum( -1.23 )

calc

Oblicza wynik działania matematycznego.calc(num1, operator, num2) : integer|float

num1 (integer|float)

Dowolna liczba

operator (string)

Operator:

  • +: dodawanie
  • -: odejmowanie
  • *: mnożenie
  • /: dzielenie

num2 (integer|float)

Dowolna liczba

Wynik:

Wynik działania zgodny z podanym operatorem

// dodawanie
expr( 2, '+', 2 )
// odejmowanie
expr( 2, '-', 2 )
// mnożenie
expr( 2, '*', 2 )
// dzielenie
expr( 2, '/', 2 )

le

Sprawdza czy liczba jest mniejsza lub równa podanej liczbie.le(num1, num2) : boolean

num1 (integer|float)

Dowolna liczba

num2 (integer|float)

Dowolna liczba

Wynik:

True jeżeli liczba num1 jest mniejsza od lub równa liczbie num2.

// 'false'
le(11, 10)
// 'true'
le(10, 10)
// 'true'
le(9, 10)

lt

Sprawdza czy liczba jest mniejsza od podanej liczby.lt(num1, num2) : boolean

num1 (integer|float)

Dowolna liczba

num2 (integer|float)

Dowolna liczba

Wynik:

True jeżeli liczba num1 jest mniejsza od liczby num2.

// 'false'
lt(11, 10)
// 'false'
lt(10, 10)
// 'true'
lt(9, 10)

ge

Sprawdza czy liczba jest większa lub równa podanej liczbie.ge(num1, num2) : boolean

num1 (integer|float)

Dowolna liczba

num2 (integer|float)

Dowolna liczba

Wynik:

True jeżeli liczba num1 jest większa od lub równa liczbie num2.

// 'true'
ge(11, 10)
// 'true'
ge(10, 10)
// 'false'
ge(9, 10)

gt

Sprawdza czy liczba jest większa od podanej liczby.gt(num1, num2) : boolean

num1 (integer|float)

Dowolna liczba

num2 (integer|float)

Dowolna liczba

Wynik:

True jeżeli liczba num1 jest większa od liczby num2.

// 'true'
gt(11, 10)
// 'false'
gt(10, 10)
// 'false'
gt(9, 10)

ceil

Zaokrąglanie w górę. Zwraca najmniejszą liczbę całkowitą większą od lub równą podanej liczbie.ceil(value) : integer

value (float)

Zaokrąglana liczba

Wynik:

Najmniejsza liczba całkowita większa lub równa podanej liczbie.

//zwraca 3
ceil( 3 )
ceil( 2.11 )

floor

Zaokrąglanie w dół. Zwraca największą liczbę całkowitą mniejszą od lub równą podanej liczbie.floor(value) : integer

value (float)

Zaokrąglana liczba

Wynik:

Najmniejsza liczba całkowita mniejsza od lub równa podanej liczbie.

//zwraca 2
ceil( 2 )
ceil( 2.65 )

round

Zaokrągla liczbę do podanej liczby miejsc po przecinku.round(value, [places]) : float

value (float)

Zaokrąglana liczba

places (integer) [opcjonalny]

Liczba miejsc po przecinku do których zaokrąglamy. Domyślnie zaokrąglanie do części całkowitej (0) .

Wynik:

Liczba zaokrąglona do podanej liczby miejsc po przecinku

//zwraca 12
round( 12.236 )
 
//zwraca 12.24
round( 12.236, 2 )

min

Zwraca najmniejszą z podanych liczb.min(numbers) : integer|float

numbers (integer[]|float[])

Tablica liczb

Wynik:

Zwraca najmniejszą z podanych liczb.

//zwraca 1
min( [1, 10, 5] )

max

Zwraca największą z podanych liczb.max(numbers) : integer|float

numbers (integer[]|float[])

Tablica liczb

Wynik:

Zwraca największą z podanych liczb.

//zwraca 10
min( [1, 10, 5] )

sum

Zwraca sumę z wszystkich podanych liczb.

 

 

sum(numbers) : float

numbers (integer[]|float[])

Tablica liczb

Wynik:

Zwraca sumę wszystkich podanych liczb.

//zwraca 6
sum( [1, 10, -5] )

anyLe

Sprawdza czy jakakolwiek liczba z tablicy jest mniejsza lub równa podanej liczbie.

anyLe(num1[], num2) : boolean

num1[] (integer|float)

Dowolna tabela liczb

num2 (integer|float)

Liczba tego samego typu co liczby w tabeli num1

Wynik:

True jeżeli jakakolwiek liczba z num1 jest mniejsza lub równa liczbie num2.

// zwraca true
anyLe([1,2,3],1)
anyLe([0,2,3],1)

// zwraca false
anyLe([2,2,3],1)

anyLt

Sprawdza czy jakakolwiek liczba z tablicy jest mniejsza od podanej liczby.anyLt(num1[], num2) : boolean

num1[] (integer|float)

Dowolna tabela liczb

num2 (integer|float)

Liczba tego samego typu co liczby w tabeli num1

Wynik:

True jeżeli jakakolwiek liczba z num1 jest mniejsza od num2.

// zwraca true
anyLt([0,2,3],1)

// zwraca false
anyLt([1,2,3],1)
anyLt([2,2,3],1)

anyGe

Sprawdza czy jakakolwiek liczba z tablicy jest większa lub równa podanej liczbie.anyGe(num1[], num2) : boolean

num1[] (integer|float)

Dowolna tabela liczb

num2 (integer|float)

Liczba tego samego typu co liczby w tabeli num1

Wynik:

True jeżeli jakakolwiek liczba z num1 jest większa lub równa liczbie num2.

// zwraca true
anyGe([1,2,3],1)
anyGe([2,2,3],1)

// zwraca false
anyLt([0,0,-1],1)

anyGt

Sprawdza czy jakakolwiek liczba z tablicy jest większa od podanej liczby.anyGt(num1[], num2) : boolean

num1[] (integer|float)

Dowolna tabela liczb

num2 (integer|float)

Liczba tego samego typu co liczby w tabeli num1

Wynik:

True jeżeli jakakolwiek liczba z num1 jest większa od num2.

// zwraca true
anyLt([1,0,3],1)
// zwraca false
anyLt([1,0,1],1)
anyLt([0,0,-2],1)

Logiczne

Operatory logiczne są przydatne przede wszystkim w warunkach uruchomienia akcji, walidatora itp.

 

Możemy dzięki nim tworzyć skomplikowane warunki np. warunek wartość zmiennej 'var1' jest równa 'tak' lub wartość zmiennej 'var1' jest równa 'nie' i jednocześnie wartość zmiennej 'var2' jest równa 'tak':

#or( #eq( $var1, "tak" ), #and( #eq( $var1, "nie" ), #eq( $var2, "tak" ) ) )

NazwaLokalizacjaDostępność w komponentachOpisWarianty funkcji

not

System Plusworkflow

 Zwraca negację przekazanego parametru.

not(value) : boolean

value (boolean)

Wartość logiczna

Wynik:

Zwraca negację przekazanej wartości.

//zwraca false
not( true )

and

System Plusworkflow

 Iloczyn logiczny, zwraca true jeżeli wszystkie przekazane parametry są prawdziwe.

and(values) : boolean

values (boolean[])

Tablica wartości logicznych

Wynik:

Zwraca iloczyn logiczny wszystkich przekazanych wartości

//zwraca true
and( true, true )
 
//zwraca false
and( false, true )
 
//zwraca false
and( false, false )

or

System Plusworkflow

 Suma logiczna, zwraca true jeżeli co najmniej jeden z przekazanych parametrów jest prawdziwy.

or(values) : boolean

values (boolean[])

Tablica wartości logicznych

Wynik:

Zwraca sumę logiczną wszystkich przekazanych wartości

//zwraca true
or( true, true )
 
//zwraca true
or( false, true )
 
//zwraca false
or( false, false )

Data i czas

Funkcje do przetwarzania daty i czasu.

NazwaLokalizacjaDostępność w komponentachOpisWarianty funkcji

currentYear

CUF components od wersji 1.0.1Wszystkie komponentyZwraca aktualny rok.

currentYear() : integer

Wynik: 

Pełny rok, np. 2017.

calculateDaysDifference

CUF components od wersji 1.0.2Wszystkie komponenty

Oblicza różnicę w dniach między dwoma datami.

 

calculateDaysDifference() : integer

firstDate : date

Data pierwsza.

secondDate : date

Data druga.

includeFreeDays : boolean

Uwzględnienie dni wolnych. Jeśli uwzględnimy dni wolne, różnica będzie większa o liczbę dni wolnych wypadających między datami (uwzględniając te daty).

Funkcja ta bięże pod uwagę systemowy parametr "CustomHolidays" . Parametr ten zawiera liste dodatkowych dni wolnych odzielonych średnikiem ( ; ). Daty mogą byc wpisane w formie pełnej (2018-05-02) lub skróconej (05-02). np: 2018-05-02;05-04 

Wynik:

Ilość dni wynikająca z obustronnie domkniętego przedziału wyznaczanego przez dwie daty. Jako że przedział jest domknięty obustronnie, w przypadku podania dwóch sąsiednich dni spełniających kryterium, funkcja zwróci wartość 2.

currentDate

System PlusworkflowWszystkie komponenty Zwraca aktualną datę.

currentDate() : date

Wynik:

Aktualna data.

//zwraca aktualną datę
//np. 2016-01-01
currentDate()

currentDateTime

System PlusworkflowWszystkie komponentyZwraca aktualną datę z czasem.

currentDateTime() : datetime

Wynik:

Aktualna data wraz z czasem.

//zwraca aktualną datę z czasem
//np. 2016-01-01 12:30:45
currentDateTime()

formatDate

System PlusworkflowWszystkie komponenty

Formatuje podaną datę do postaci tekstowej zgodnie z podanym formatem.

formatDate(date, format) : string

date : date|datetime

Formatowana data

format : string

Format daty. Dostępne są formaty wbudowane:

  • datetime np. 2015-12-31 12:33:44
  • date np. 2015-12-31
  • time np. 12:33:44
  • year np. 1991
  • month np. 06
  • day np. 12

Wynik:

Aktualna data wraz z czasem.

// 2015-12-31 12:33:44
 
//zwraca "2015-12-31"
formatDate(#currentDateTime(), "date")

calcDate

System PlusworkflowWszystkie komponenty

Oblicza datę na podstawie przekazanych parametrów. Umożliwia dodawanie/odejmowanie od podanej daty lat, miesięcy, dni etc.

calcDate(date, interval, unit) : date

date : date

Data bazowa

interval : integer

Okres czasu który zostanie dodany/odjęty od podanej daty

unit : string

Jednostka czasu, jedna z:

  • y lub year - rok
  • m lub month - miesiąc
  • w lub week - tydzień
  • d lub day - dzień

Wynik:

Obliczona data

// 2015-12-31
 
//zwraca 2015-12-32
calcDate(#currentDate(), 1, "day");
 
//zwraca 2014-12-32
calcDate(#currentDate(), -1, "y");

calcDateTime

System PlusworkflowWszystkie komponentyOblicza datę i czas na podstawie przekazanych parametrów. Umożliwia dodawanie/odejmowanie od podanej daty lat, miesięcy, dni, godzin, minut etc.

calcDateTime(date, interval, unit) : datetime

date : datetime

Data bazowa

interval : integer

Okres czasu który zostanie dodany/odjęty od podanej daty

unit : string

Jednostka czasu, jedna z:

  • y lub year - rok
  • m lub month - miesiąc
  • w lub week - tydzień
  • d lub day - dzień
  • h lub hour - godzina
  • i lub minute - minuta
  • s lub second - sekunda

Wynik:

Obliczona data

// 2015-12-31 12:33:44
 
//zwraca 2015-12-32 12:33:44
calcDate(#currentDateTime(), 1, "day");
 
//zwraca 2014-12-32 12:33:44
calcDate(#currentDateTime(), -1, "y");

le

System PlusworkflowWszystkie komponentySprawdza czy data przekazana w pierwszym parametrze jest mniejsza lub równa od daty przekazanej w drugim parametrze

le(date1, date2) : boolean

date1 : date/datetime

Pierwsza data do porównania

date2 : date/datetime

Druga data do porównania

Wynik:

Prawda lub fałsz

// data1 to obiekt LocalDate o wartości "2016-12-24"
// data2 to obiekt LocalDate o wartości "2016-12-24"
// zwraca true
le(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDate o wartości "2016-12-24T12:35:22"
// zwraca true
le(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDate o wartości "2016-12-24T12:35:23"
// zwraca true
le(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDate o wartości "2016-12-24T12:35:21"
// zwraca false
le(data1, data2)


 

lt

System PlusworkflowWszystkie komponentySprawdza czy data przekazana w pierwszym parametrze jest mniejsza od daty przekazanej w drugim parametrze

lt(date1, date2) : boolean

date1 : date/datetime

Pierwsza data do porównania

date2 : date/datetime

Druga data do porównania

Wynik:

Prawda lub fałsz

// data1 to obiekt LocalDate o wartości "2016-12-24"
// data2 to obiekt LocalDate o wartości "2016-12-24"
// zwraca false
lt(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// zwraca false
lt(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:23"
// zwraca true
lt(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:21"
// zwraca false
lt(data1, data2)

ge

System PlusworkflowWszystkie komponentySprawdza czy data przekazana w pierwszym parametrze jest większa lub równa od daty przekazanej w drugim parametrze

ge(date1, date2) : boolean

date1 : date/datetime

Pierwsza data do porównania

date2 : date/datetime

Druga data do porównania

Wynik:

Prawda lub fałsz

// data1 to obiekt LocalDate o wartości "2016-12-24"
// data2 to obiekt LocalDate o wartości "2016-12-24"
// zwraca true
ge(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// zwraca true
ge(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:23"
// zwraca false
ge(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:21"
// zwraca true
ge(data1, data2)

gt

System PlusworkflowWszystkie komponentySprawdza czy data przekazana w pierwszym parametrze jest wieksza od daty przekazanej w drugim parametrze

gt(date1, date2) : boolean

date1 : date/datetime

Pierwsza data do porównania

date2 : date/datetime

Druga data do porównania

Wynik:

Prawda lub fałsz

// data1 to obiekt LocalDate o wartości "2016-12-24"
// data2 to obiekt LocalDate o wartości "2016-12-24"
// zwraca false
gt(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// zwraca false
gt(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:23"
// zwraca false
gt(data1, data2)

// data1 to obiekt LocalDateTime o wartości "2016-12-24T12:35:22"
// data2 to obiekt LocalDateTime o wartości "2016-12-24T12:35:21"
// zwraca true
gt(data1, data2)

Działania na tablicach

Funkcje realizujące podstawowe działania na tablicach

Nazwa

LokalizacjaDostępność funkcji w komponentach

Opis

Warianty funkcji

item

System PlusworkflowWszystkie komponenty

Zwraca element tablicy o podanym indeksie. 

item(index, array) : object

index : integer

Indeks elementu

array : object[]

Tablica dowolnego typu

Wynik:

Element z podanego indeksu

//zwraca  "b"
 item(1, ["a", "b"]);

length

System PlusworkflowWszystkie komponenty

 Zwraca długość tablicy. W przypadku sprawdzania, czy długość tablicy wynosi 0 należy używać funkcji emptyArray, ponieważ length zwraca niepoprawny wynik dla tablic o długości 0.

length(array) : integer

array : object[]

Tablica dowolnego typu

Wynik:

Długość tablicy

 //zwraca 2 
length(["a", "b"]);

formatArray

System PlusworkflowWszystkie komponentyFormatuje liczbę wg. podanych separatorów i liczby miejsc po przecinku dla każdej wartości w tablicy.

format(value[], decimalLen, decimalSeparator, thousandSeparator) : string[]

value : float[]/integer[]

Tablica wartości liczbowych do sformatowania

decimalLen : integer

Liczba miejsc po przecinku

decimalSeparator : string

Separator ułamkowy

thousandSeparator : string

Separator tysięczny (w przypadku pustego łańcucha znaków separator nie pojawi się)

Wynik:

Sformatowana wartość liczbowa w postaci tablicy tekstowej

// zwraca ["9 999,1230","1 234,0000", "4 234,1234"]
format([9999.123 , 1234 , 4321.12345], 4, ",", " ")

// zwraca ["9,999.1230"]
format( [9999.123], 4, ".", "," )

// zwraca ["10000"]
format([10000.123], 0, ",", "")

// zwraca ["149,13"]
format([149.125], 2, ",", " ")

formatTextArray

System PlusworkflowWszystkie komponentyFormatuje ciąg znaków wg. podanego schematu dla każdej wartości w tablicy.

formatText(schema[], parameters, [customRegex]) : string[]

schema : string[]

Tablica schematów, w którym kolejne znaki #(lub podane jako opcjonalny parametr customRegex) zostaną zastąpione przez kolejne znaki z parameters.

parameters : string[]

Parametry tekstowe, których kolejne znaki zostaną wpisane do schematu

customRegex : string

Parametr, który zmienia domyślnie podmieniany znak "#" w schemacie, na inny, dowolny

Wynik:

Tablica łańcuchów znaków sformatowany według schematu

// zwraca ["AAA-BBB-123","ACAFA123"]
formatText(["###-BBB-###","#C#F####"], ["AA", "A123"])

// zwraca ["#1234BB","12034##BB"]
formatText("#ZZZZZZ",ZZ0ZZ##ZZ ["1234BB"], "Z")

intersect

Cuf-components od wersji 1.0.30Wszystkie komponenty

Wspólna część dwóch tablic. Zwraca elementy, które znajdują się zarówno w pierwszej, jak i w drugiej tablicy, bez powtórzeń.

intersect(arr1, arr2) : object[]

arr1 : string[] | integer[] | float[] | date[]

Pierwsza tablica wartości

arr2 : string[] | integer[] | float[] | date[]

Druga tablica wartości

Wynik:

Tablica wartości (wspólna część tablic) o typie zależnym od wybranych parametrów.

 

// Zwraca ["aaa"]
intersect(["aaa", "ccc"], ["aaa", "bbb"])

// Zwraca [5]
intersect([null, 4, 5], [5, 1])

// Zwraca []
intersect([true], [false, null])

except

Cuf-components od wersji 1.0.30Wszystkie komponenty

Różnica dwóch tablic. Zwraca elementy, które znajdują się w pierwszej, ale nie znajdują w drugiej tablicy, bez powtórzeń.

except(arr1, arr2) : object[]

arr1 : string[] | integer[] | float[] | date[]

Pierwsza tablica wartości

arr2 : string[] | integer[] | float[] | date[]

Druga tablica wartości

Wynik:

Tablica wartości (różnica tablic) o typie zależnym od wybranych parametrów.

 

// Zwraca ["ccc"]
except(["aaa", "ccc"], ["aaa", "bbb"])

// Zwraca [null, 4]
except([null, 4, 5], [5, 1])

// Zwraca [true]
except([true], [false, null])

union

Cuf-components od wersji 1.0.30Wszystkie komponenty

Suma dwóch tablic. Zwraca elementy, które znajdują się w pierwszej lub w drugiej tablicy, bez powtórzeń.

union(arr1, arr2) : object[]

arr1 : string[] | integer[] | float[] | date[]

Pierwsza tablica wartości

arr2 : string[] | integer[] | float[] | date[]

Druga tablica wartości

Wynik:

Tablica wartości (suma tablic) o typie zależnym od wybranych parametrów.

 

// Zwraca ["aaa", "ccc", "bbb"]
union(["aaa", "ccc"], ["aaa", "bbb"])

// Zwraca [null, 4, 5, 1]
union([null, 4, 5], [5, 1])

// Zwraca [true, false, null]
union([true], [false, null])

symmetricDifference

Cuf-components od wersji 1.0.30Wszystkie komponenty

Różnica symetryczna dwóch tablic. Zwraca elementy, które nie znajdują się jednocześnie w pierwszej i drugiej tablicy, bez powtórzeń.

symmetricDifference(arr1, arr2) : object[]

arr1 : string[] | integer[] | float[] | date[]

Pierwsza tablica wartości

arr2 : string[] | integer[] | float[] | date[]

Druga tablica wartości

Wynik:

Tablica wartości (różnica symetryczna tablic) o typie zależnym od wybranych parametrów.

 

// Zwraca ["ccc", "bbb"]
symmetricDifference(["aaa", "ccc"], ["aaa", "bbb"])

// Zwraca [null, 4, 1]
symmetricDifference([null, 4, 5], [5, 1])

// Zwraca [true, false, null]
symmetricDifference([true], [false, null])

unionAll

Cuf-components od wersji 1.0.30Wszystkie komponenty

Suma dwóch tablic. Tworzy nową tablicę scalając dwie tablice przekazane w parametrze.

unionAll(arr1, arr2) : object[]

arr1 : string[] | integer[] | float[] | date[]

Pierwsza tablica wartości

arr2 : string[] | integer[] | float[] | date[]

Druga tablica wartości

Wynik:

Tablica wartości (suma tablic) o typie zależnym od wybranych parametrów.

 

// Zwraca ["aaa","ccc", "aaa", "bbb"]
unionAll(["aaa", "ccc"], ["aaa", "bbb"])

// Zwraca [null, 4, 5, 5, 1]
unionAll([null, 4, 5], [5, 1])

// Zwraca [true, false, null]
unionAll([true], [false, null])

distinct

Cuf-components od wersji 1.0.30Wszystkie komponenty

Funkcja zwracająca tablicę wartości bez powtórzeń z tabeli przekazanej w parametrze.

distinct(array) : object[]

array :string[] | integer[] | float[] | date[]

Tablica wartości

Wynik:

Tablica z wartościami o typie zależnym od typu przekazanego w parametrze

 

// Zwraca ["aaa", "bbb"]
distinct(["aaa", "bbb", "aaa"]) 

// Zwraca [null, 4, 5]
distinct([null, 4, 5, null, 4)

// Zwraca [true, false]
distinct([true, true, true, false, false])

filter

 

Cuf-components od wersji 1.0.55Wszystkie komponenty

Funkcja filtrująca elementy tablicy wg podanych kryteriów. Pozostawia te wartości, które spełnią wszystkie z filtrów. Filtr może być pojedyńczy lub tablicowy.

Filtry pojedyncze porównują wartości z pola Kolumny do filtrowania z wartością w polu Wartości filtrujące.

Filtry tablicowe porównują wartości z pola Kolumny do filtrowania z odpowiadającymi im (pod względem kolejności) wartościami podanymi w polu Kolumny filtrujące.

filter(array, singleVariables, singleFilterTypes, singleFilter, multiVariables, multiFilterTypes multiFilter) : string[] | integer[] | float[] | date[]

array : string[] | integer[] | float[] | date[]

Tablica wartości

singleVariables : variable[]
Kolumny do filtrowania (dla pojedyńczych wartości)

singleFilterTypes : string[]

Rodzaj filtrowania

singleFilter : string[]

Wartości filtrujące

multiVariables : variable[]

Kolumny do filtrowania (dla wartości tabelarycznych)

multiFilterTypes : string[]

Rodzaj filtrowania

multiFilter : variable[]

Kolumny filtrujące

Konwersja typów

Funkcje umożliwiające konwersję typów

NazwaLokalizacjaDostępność funkcji w komponentachOpisWarianty funkcji

toString

System Plusworkflow

Wszystkie komponenty

Konwertuje podaną wartość do jej domyślnej postaci tekstowej. Możliwa jest konwersja z:

  • wartości logicznej (boolean)
    • true = "true"
    • false = "false"
  • liczby całkowitej (integer)
    • 123 = "123"
  • liczby zmiennoprzecinkowej
    • 123.12 = "123.12"
  • datyformatuje datę używając domyślnego formatu "yyyy-MM-dd"
    • 2016-01-01 = "2016-01-01"
  • daty i czasu (datetime) - formatuje datę używając domyślnego formatu "yyyy-MM-dd HH:mm:ss"
    • 2016-01-01 12:11:22 = "2016-01-01 12:11:22"

toString(value) : string

value : boolean|integer|float|date|datetime

Konwertowana wartość

Wynik:

Tekst reprezentujący wartość

//zwraca "false"
toString(false);

toStringArray

System Plusworkflow

Wszystkie komponentyKonwertuje podaną tablicę wartości do tablicy wartości tekstowych. Zasady konwersji są takie same jak w przypadku funkcji toString.

toStringArray(array) : string[]

array : variable|boolean[]|integer[]|float[]|date[]|datetime[]

Konwertowana tablica wartości

Wynik:

Tablica wartości tekstowych

//zwraca ["false", "true"]
toStringArray([false, true]);

toBoolean

System Plusworkflow

Wszystkie komponenty Konwertuje podaną wartość do wartości logicznej. Możliwa jest konwersja z:
  • wartości tekstowej (string)
    • "true" = true
    • "false" = false
  • liczby całkowitej (integer)
    • 0 = false reszta true
  • liczby zmiennoprzecinkowej (float)
    • 0.0 = false reszta true

toBoolean(value) : boolean

value : string|integer|float

Konwertowana wartość

Wynik:

Wartość logiczna

//zwraca true
toBoolean("true");

toBooleanArray

System Plusworkflow

Wszystkie komponentyKonwertuje podaną tablicę wartości do tablicy wartości logicznych. Zasady konwersji są takie same jak w przypadku funkcji toBoolean.

toBooleanArray(array) : boolean[]

 array : string[]|integer[]|float[]

Konwertowana tablica wartości

Wynik:

Tablica wartości logicznych

//zwraca [false, true]
toBooleanArray([0, 1]);

toInteger

System Plusworkflow

Wszystkie komponenty

Konwertuje podaną wartość do liczby całkowitej. Możliwa jest konwersja z:

  • wartości logicznej (boolean)

    • true = 1

    • false = 0

  • wartości tekstowej (string)

    • "123" = 123

  • liczby zmiennoprzecinkowej (float) - zaokrąglanie do najbliższej liczby całkowitej

    • 123.56 = 124

toInteger(value) : integer

value : boolean|string|float

Konwertowana wartość

Wynik:

Liczba całkowita

//zwraca 123
toInteger("123");

toIntegerArray

System Plusworkflow

Wszystkie komponentyKonwertuje podaną tablicę wartości do tablicy liczb całkowitych. Zasady konwersji są takie same jak w przypadku funkcji toInteger.

toIntegerArray(array) : integer[]

array : variable|boolean[]|string[]|float[]

Konwertowana tablica wartości

Wynik:

Tablica liczb całkowitych

//zwraca [1, 2]
toIntegerArray(["1", "2"]);

toFloat

System Plusworkflow

Wszystkie komponenty

Konwertuje podaną wartość do liczby zmiennoprzecinkowej. Możliwa jest konwersja z:

  • wartości logicznej (boolean)

    • true = 1.0

    • false = 0.0

  • wartości tekstowej (string)

    • "123.123" = 123.123

  • liczby całkowitej (integer)

    • 123 = 123.0

toFloat(value) : float

 value : boolean|string|integer

Konwertowana wartość

Wynik:

Liczba zmiennoprzecinkowa

//zwraca 123.123
toFloat("123.123");

toFloatArray

System Plusworkflow

Wszystkie komponentyKonwertuje podaną tablicę wartości do tablicy liczb zmiennoprzecinkowych. Zasady konwersji są takie same jak w przypadku funkcji toFloat.

toFloatArray(array) : float[]

array : boolean[]|string[]|integer[] | variable

Konwertowana tablica wartości

Wynik:

Tablica liczb zmiennoprzecinkowych

//zwraca [1.0, 2.3]
toFloatArray(["1", "2.3"]);

toDate

System PlusworkflowWszystkie komponenty

Konwertuje podaną wartość tekstową do daty. Formaty przyjmowane przez funkcję:

"Y-M-d", "Y.M.d", "d-M-Y", "d.M.Y"

toDate(value) : date

value : string

Wartość tekstowa

Wynik:

Data uzyskana z tekstu

// zwraca obiekt LocalDate z datą 1991-06-12
toDate("1991-06-12");
// zwraca null
toDate("");
toDate(null);

toDateArray

System PlusworkflowWszystkie komponentyKonwertuje podaną tablicę wartości tekstowych do tablicy wartości datowych. Zasady konwersji są takie same jak w przypadku funkcji toDate.

toDateArray(values) : date[]

values - string[] | variable

Tablica wartości tekstowych / zmiennych

Wynik:

Tablica dat uzyskana z tablicy wartości tekstowych

// Zwraca tablice obiektów LocalDate
toDateArray(["1991-06-12", "1991-06-13"] );
// zwraca pustą tablicę
toDateArray([])

toDateTime

System PlusworkflowWszystkie komponenty

Konwertuje podaną wartość tekstową do daty z czasem. Formaty przyjmowane przez funkcję:

"Y-M-d", "Y.M.d", "d-M-Y", "d.M.Y",
"Y-M-d H:m:s", "Y.M.d H:m:s", "d-M-Y H:m:s", "d.M.Y H:m:s"


toDateTime(value) : datetime

value - string

Wartość tekstowa

Wynik:

Data i czas z wartości tekstowej

// zwraca obiekt LocalDateTime z datą 1991-06-12 11:09:22
toDateTime("1991-06-12 11:09:22");
// zwraca null
toDateTime("");
toDateTime(null);

toDateTimeArray

System PlusworkflowWszystkie komponentyKonwertuje podaną tablicę wartości tekstowych do tablicy wartości datowych z czasem. Zasady konwersji są takie same jak w przypadku funkcji toDateTime.

toDateTimeArray(values) : datetime[]

values - string[]

Tablica wartości tekstowych

Wynik:

Tablica wartości z datą i czasem stworzona z tablicy wartości tekstowych

// zwraca tablicę wartości LocalDateTime
toDateTimeArray(["1991-06-12 11:09:12", "1991-06-13 11:09:11"] );
// zwraca pustą tablicę
toDateTimeArray([])

Funkcje kontekstowe

Funkcje wykorzystujące konteksty do odczytu danych związanych z aktualnie wykonywaną akcją.

NazwaLokalizacjaDostępność w komponentachOpisWarianty funkcji

currentUser

 

 

System PlusworkflowWszystkie komponenty

Zwraca login aktualnego użytkownika.

currentUser() : string

Wynik:

Login aktualnego użytkownika.

// np. "admin"
currentUser()


currentUser

System PlusworkflowWszystkie komponenty Zwraca informacje o aktualnym użytkowniku - podaną właściwość jedną z:
  • username: login
  • firstname: imię
  • lastname: nazwisko
  • fullname: pełna nazwa (imię + nazwisko)
  • email: adres email
  • number: numer użytkownika

currentUser(property) : string

property : string

Nazwa zwracanej właściwości użytkownika

Wynik:

Wartość podanej właściwości aktualnego użytkownika

// np. "admin@suncode.pl"
currentUser("email")

currentUserGroups

System PlusworkflowWszystkie komponenty

Zwraca listę nazw grup aktualnego użytkownika.

currentUserGroups() : string[]

Wynik:

Tablica nazw grup do których należy użytkownik

// np. ["pracownik", "administrator"]
currentUserGroups()

currentUserInGroup

System Plusworkflow

Wszystkie komponenty

Sprawdza, czy aktualny użytkownik należy do grupy o podanej nazwie.

currentUserInGroup(group) : boolean

group : string

Nazwa grupy

Wynik:

true jeżeli użytkownik należy do podanej grupy

// true jeżeli należy do grupy
currentUserGroups("pracownik")

currentUserPositions

System PlusworkflowWszystkie komponentyZwraca symbole wszystkich stanowisk aktualnego użytkownika.

currentUserPositions() : string[]

Wynik:

Tablica symboli stanowisk użytkownika

// np. ["p01", "d02"]
currentUserPositions()

currentUserPositionNames

System PlusworkflowWszystkie komponentyZwraca nazwy wszystkich stanowisk aktualnego użytkownika.

currentUserPositionNames() : string[]

Wynik:

Tablica nazw stanowisk użytkownika

// np. ["Pracownik1", "Akceptujący"]
currentUserPositionNames() 

currentUserHasPosition

System Plusworkflow

Wszystkie komponenty

Sprawdza, czy aktualny użytkownik posiada stanowisko o podanym symbolu.

currentUserHasPosition(symbol) : boolean

symbol : string

Symbol stanowiska

Wynik:

true jeżeli użytkownik jest przypisany do podanego stanowiska

 // true jeżeli jest przypisany do stanowiska
currentUserHasPostition("p01")

currentUserUnits

System PlusworkflowWszystkie komponentyZwraca symbole wszystkich jednostek organizacyjnych aktualnego użytkownika.

currentUserUnits() : string[]

Wynik:

Tablica symboli jednostek organizacyjnych do których należy użytkownik

 // np. ["kadry", "it"]
currentUserUnits()

currentUserUnitNames

System PlusworkflowWszystkie komponentyZwraca nazwy wszystkich jednostek organizacyjnych aktualnego użytkownika.

currentUserUnitNames() : string[]

Wynik:

Tablica nazw jednostek organizacyjnych do których należy użytkownik

 // np. ["Kadry", "Dział IT"]
currentUserUnitNames()

currentUserInUnit

System Plusworkflow

Wszystkie komponenty

Sprawdza, czy aktualny użytkownik należy do jednostki organizacyjnej o podanym symbolu.

currentUserInUnit(symbol) : boolean

symbol : string

Symbol jednostki organizacyjnej

Wynik:

true jeżeli użytkownik należy do podanej jednostki organizacyjnej

// true jeżeli należy do jednostki
currentUserInUnit("it")

currentUserHigherPositions

System PlusworkflowWszystkie komponentyZwraca symbole wszystkich stanowisk nadrzędnych aktualnego użytkownika.

currentUserHigherPostitions() : string[]

Wynik:

Tablica symboli stanowisk nadrzędnych użytkownika

 // np. ["kp"]
currentUserHigherPositions()

currentUserHigherPositionNames

System PlusworkflowWszystkie komponentyZwraca nazwy wszystkich stanowisk nadrzędnych aktualnego użytkownika.

currentUserHigherPostitionNames() : string[]

Wynik:

Tablica nazw stanowisk nadrzędnych użytkownika

// np. ["Kierownik Produkcji"]
currentUserHigherPositionNames() 

currentUserSupervisors

System PlusworkflowWszystkie komponentyZwraca loginy wszystkich bezpośrednich przełożonych (z nadrzędnych stanowisk) aktualnego użytkownika.

currentUserSupervisors() : string[]

Wynik:

Tablica loginów wszystkich bezpośrednich przełożonych aktualnego użytkownika

// np. ["akowalski"]
currentUserSupervisors() 

currentUserHasSupervisor

System Plusworkflow

Wszystkie komponenty

Sprawdza, czy osoba o podanym loginie jest przełożonym aktualnego użytkownika.

currentUserSupervisors(username) : boolean

username : string

Login użytkownika

Wynik:

true jeżeli podany użytkownik jest bezpośrednim przełożonym aktualnego użytkownika

// true jeżeli "akowalski" jest
// przełożonym użytkownika
currentUserHasSupervisor("akowalski")

Funkcje warunkowe

Funkcje zawracające dany parametr po spełnieniu określonego warunku

NazwaLokalizacjaDostępność funkcji w komponentachOpisWarianty funkcji

ifFn

 

 

System PlusworkflowWszystkie komponenty

Funkcja warunkowa (if) - zwraca dany parametr w zależności od warunku

parametry trueParam i falseParam muszą być tego samego typu.

ifFn( condition , trueParam , falseParam ) : integer/float/string/date/datetime/boolean/integer[]/float[]/string[]/date[]/datetime[]/boolean[]

condition : boolean

Warunek funkcji

trueParam : integer/float/string/date/datetime/boolean/integer[]/float[]/string[]/date[]/datetime[]/boolean[]

Wartość zwracana, gdy warunek prawdziwy

falseParam : integer/float/string/date/datetime/boolean/integer[]/float[]/string[]/date[]/datetime[]/boolean[]

Wartość zwracana, gdy warunek nie prawdziwy

Wynik:

Wynikiem jest parametr trueParam lub falseParam w zależności od spełnienia warunku

// zwraca 2
ifFn(true,2,3);
// zwraca "NIE"
ifFn(false,"TAK", "NIE");
// zwraca ["a","b"]
ifFn(false,["AA","BB","CC"], ["a","b"]);


ifFnString

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od warunku

ifFnString( condition , trueParam , falseParam ) : string

condition : boolean

Warunek funkcji

trueParam : string

Wartość zwracana, gdy warunek prawdziwy

falseParam : string

Wartość zwracana, gdy warunek nie prawdziwy

Wynik:

Wartość tekstowa, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnStringArray

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnStringArray( condition , trueParam , falseParam ) : string[]

condition : boolean

Warunek funkcji

trueParam : string[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Tablica wartości tekstowych

falseParam : string[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Tablica wartości tekstowych

Wynik:

Tablica wartości tekstowych, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnInteger

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnInteger( condition , trueParam , falseParam ) : integer

condition : boolean

Warunek funkcji

trueParam : integer

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Całkowity

falseParam : integer

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Całkowity

Wynik:

Wartość całkowita, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnIntegerArray

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnIntegerArray( condition , trueParam , falseParam ) : integer[]

condition : boolean

Warunek funkcji

trueParam : integer[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Tablica wartości całkowitych

falseParam : integer[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Tablica wartości całkowitych

Wynik:

Tablica wartości całkowitych, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnFloat

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnFloat( condition , trueParam , falseParam ) : float

condition : boolean

Warunek funkcji

trueParam : float

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Zmiennoprzecinkowy

falseParam : float

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Zmiennoprzecinkowy

Wynik:

Wartość zmiennoprzecinkowa, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnFloatArray

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnIntegerArray( condition , trueParam , falseParam ) : float[]

condition : boolean

Warunek funkcji

trueParam : float[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Tablica wartości zmiennoprzecinkowych

falseParam : float[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Tablica wartości zmiennoprzecinkowych

Wynik:

Tablica wartości zmiennoprzecinkowych, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnDate

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnDate( condition , trueParam , falseParam ) : date

condition : boolean

Warunek funkcji

trueParam : date

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Datowy

falseParam : date

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Datowy

Wynik:

Wartość datowa, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnDateArray

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnDateArray( condition , trueParam , falseParam ) : date[]

condition : boolean

Warunek funkcji

trueParam : date[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Tablica wartości datowych

falseParam : date[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Tablica wartości datowych

Wynik:

Tablica wartości datowych, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnDateTime

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnDateTime( condition , trueParam , falseParam ) : datetime

condition : boolean

Warunek funkcji

trueParam : datetime

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Datowy z czasem

falseParam : datetime

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Datowy z czasem

Wynik:

Wartość datowa z czasem, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnDateTimeArray

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnDateTimeArray( condition , trueParam , falseParam ) : datetime[]

condition : boolean

Warunek funkcji

trueParam : datetime[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Tablica wartości datowych z czasem

falseParam : datetime[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Tablica wartości datowych z czasem

Wynik:

Tablica wartości datowych z czasem, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnBoolean

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnBoolean( condition , trueParam , falseParam ) : boolean

condition : boolean

Warunek funkcji

trueParam : boolean

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Logiczny

falseParam : boolean

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Logiczny

Wynik:

Wartość logiczny, będąca wynikiem jednej z funkcji przekazanych w parametrze

ifFnBooleanArray

System PlusworkflowWszystkie komponentyFunkcja zwraca wartość pierwszej lub drugiej funkcji - w zależności od wyniku funkcji warunkowej

ifFnBooleanArray( condition , trueParam , falseParam ) : boolean[]

condition : boolean

Warunek funkcji

trueParam : boolean[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca prawdę. Musi zwracać typ Tablica wartości logicznych

falseParam : boolean[]

Funkcja, której wynik jest zwracany w przypadku, gdy warunek zwraca fałsz. Musi zwracać typ Tablica wartości logicznych

Wynik:

Tablica wartości logicznych, będąca wynikiem jednej z funkcji przekazanych w parametrze

Tłumaczenia

 Funkcje umożliwiające pobieranie tłumaczeń.

NazwaLokalizacjaDostępność funkcji w komponentachOpisWarianty funkcji

translate

 

 

System PlusworkflowWszystkie komponenty

Zwraca tłumaczenie dla podanego klucza. Jeżeli tłumaczenie nie zostanie odnalezione, zwracany jest podany klucz. Pod uwagę brane są serwerowe (scope = SERVER) klienckie translatory oraz tłumaczenia z wtyczek.

translate(text) : string

text : string

Klucz do przetłumaczenia

Wynik: 

Przetłumaczony klucz wyszukany ze wszystkich dostępnych translatorów.

 

// np. "Tak", jeżeli użytkownik ma
// ustawiony język polski
translate("yes")


translate


 
System PlusworkflowWszystkie komponentyZwraca tłumaczenie dla podanego klucza. Jeżeli tłumaczenie nie zostanie odnalezione, zwracany jest podany klucz. Pod uwagę brane są serwerowe (scope = SERVER) klienckie translatory oraz tłumaczenia z wtyczek.

translate(text, translatorName) : string

text : string

Klucz do przetłumaczenia

translatorName : string

Nazwa translatora

Wynik:

Przetłumaczony klucz wyszukany w podanym translatorze.

// np. "Faktury", jeżeli stworzony został kliencki
// translator lub tłumaczenie zostało dodane do wtyczki
// o takim id
translate("invoices", "customTranslatorName")

translate

System PlusworkflowWszystkie komponentyZwraca tłumaczenie dla podanego klucza. Jeżeli tłumaczenie nie zostanie odnalezione, zwracany jest podany klucz. Pod uwagę brane są serwerowe (scope = SERVER) klienckie translatory oraz tłumaczenia z wtyczek.

translate(text, args, translatorName) : string

text : string

Klucz do przetłumaczenia

args : string[]

Parametry przekazywane do translatora. Podstawiane za znaczniki {0}, {1} itd.

translatorName : string

Nazwa translatora

Wynik:

Przetłumaczony klucz wyszukany w podanym translatorze z podstawionymi parametrami

// np. dla translatora o nazwie "customTranslatorName" i klucza
// invoice=Faktura nr {0} z {1}
translate("invoice", ["123", "1000"], "customTranslatorName")
// wynik "Faktura nr 123 z 1000

Preferowane jest użycie funkcji z podaną nazwą translatora, gdyż jednoznacznie wskazuje ona na tłumaczenie spośród wszystkich translatorów załadowanych w systemie.

Użytkownik

NazwaLokalizacjaDostępność funkcji w komponentachOpisWarianty funkcji

userSuperiors

CUF components 1.0.29Tylko komponenty serweroweFunkcja serwerowa zwracająca przełożonych użytkownika. Zwracana jest tablica wartości, a nie tekst.

userSuperiors(userName) : string[]

userName : string

Nazwa użytkownika

usersFromOU

CUF components 1.0.29Tylko komponenty serwerowe

Funkcja serwerowa pobierająca loginy użytkowników z jednostki organizacyjnej o podanej nazwie

 

usersFromOU(ou) : string[]

ou : string

Nazwa jednostki organizacyjnej

Wynik:

Tablica z loginami użytkowników

usersFromOU

CUF components 1.0.29Tylko komponenty serwerowe

Funkcja serwerowa pobierająca loginy użytkowników z jednostki organizacyjnej o podanej nazwie i (opcjonalnie) użytkowników z jednostek podrzędnych do niej.

usersFromOU(ouName, includeSubUnits ) : string[]

ouName : string

Nazwa jednostki organizacyjnej

includeSubUnits : boolean

Dodaj użytkowników z jednostek podrzędnych

Wynik:

Tablica z loginami użytkowników

usersFromOUSymbol

 

CUF components 1.0.29Tylko komponenty serwerowe

Funkcja serwerowa pobierająca loginy użytkowników z jednostki organizacyjnej o podanym symbolu

usersFromOUSymbol(ousymbol) : string[]

ouSymbol : string

Symbol jednostki organizacyjnej

Wynik:

Tablica z loginami użytkowników

usersFromOUSymbol

 

CUF components 1.0.29Tylko komponenty serwerowe

Funkcja serwerowa pobierająca loginy użytkowników z jednostki organizacyjnej o podanym symbolu i (opcjonalnie) użytkowników z jednostek podrzędnych do niej.

usersFromOUSymbol(ousymbol, includeSubUnits) : string[]

ouSymbol : string

Symbol jednostki organizacyjnej

includeSubUnits : boolean

Dodaj użytkowników z jednostek podrzędnych

Wynik:

Tablica z loginami użytkowników

usersWithPosition

CUF components 1.0.29 do 1.0.53Tylko komponenty serwerowe

(została zastąpiona przez userWithPosition)

Funkcja serwerowa pobierająca loginy użytkowników ze stanowiskiem o podanym symbolu

usersWithPosition(position) : string[]

postition : string

Nazwa stanowiska

Wynik:

Tablica z loginami użytkowników

usersWithPositionSymbol

CUF components 1.0.29 do 1.0.53Tylko komponenty serwerowe

(została zastąpiona przez userWithPosition)

Funkcja serwerowa pobierająca loginy użytkowników ze stanowiskiem o podanej nazwie

usersWithPositionSymbol(position) : string[]

postitionSymbol : string

Symbol stanowiska

Wynik:

Tablica z loginami użytkowników

userWithPosition

CUF components 1.0.53Tylko komponenty serwerowe

Funkcja serwerowa pobierająca login użytkownika ze stanowiskiem o podanej nazwie

userWithPosition(position) : string

postition : string

Nazwa stanowiska

Wynik:

Login użytkownika

userWithPositionSymbol

CUF components 1.0.53Tylko komponenty serwerowe

Funkcja serwerowa pobierająca login użytkownika ze stanowiskiem o podanym symbolu

userWithPositionSymbol(positionSymbol) : string

postitionSymbol : string

Symbol stanowiska

Wynik:

Login użytkownika

usersWithPositions

CUF components 1.0.54Tylko komponenty serwerowe

Funkcja serwerowa pobierająca loginy użytkowników ze stanowiskami o podanych nazwach

usersWithPositions(positions) : string[]

postition : string[]

Nazwy stanowisk

Wynik:

Loginy użytkowników

usersWithPositionsSymbols

CUF components 1.0.54Tylko komponenty serwerowe

Funkcja serwerowa pobierająca loginy użytkowników ze stanowiskami o podanych symbolach

userWithPositionSymbol(positionsSymbols) : string[]

postitionsSymbols : string[]

Symbole stanowisk

Wynik:

Loginy użytkowników

Dokumenty

NazwaLokalizacjaDostępność funkcji w komponentachOpisWarianty funkcji

numberOfDocuments

CUF components 1.0.X

Tylko komponenty serwerowe

Zwraca liczbę dokumentów podpiętych do aktualnego procesu

numberOfDocuments() : integer

Wynik:

Liczba dokumentów

numberOfDocuments

CUF components 1.0.X

Tylko komponenty serwerowe

Zwraca liczbę dokumentów podpiętych do aktualnego procesu z podanej klasy dokumentów

numberOfDocuments(className) : integer

className : string

Nazwa klasy dokumentów

Wynik:

Liczba dokumentów