From 5853d0ff5bf52444383e259ed320fcd44111d59f Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Mon, 23 Oct 2023 11:31:04 +0200 Subject: [PATCH 1/4] deps: add marked --- package-lock.json | 19 +++++++++++++++++++ package.json | 1 + 2 files changed, 20 insertions(+) diff --git a/package-lock.json b/package-lock.json index 9c4940f..e2d4304 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "karma-mocha": "^2.0.1", "karma-sinon-chai": "^2.0.2", "karma-webpack": "^5.0.0", + "marked": "^9.1.2", "mocha": "^10.0.0", "mocha-test-container-support": "^0.2.0", "npm-run-all": "^4.1.5", @@ -4672,6 +4673,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/marked": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.2.tgz", + "integrity": "sha512-qoKMJqK0w6vkLk8+KnKZAH6neUZSNaQqVZ/h2yZ9S7CbLuFHyS2viB0jnqcWF9UKjwsAbMrQtnQhdmdvOVOw9w==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 16" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -10924,6 +10937,12 @@ "semver": "^6.0.0" } }, + "marked": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.2.tgz", + "integrity": "sha512-qoKMJqK0w6vkLk8+KnKZAH6neUZSNaQqVZ/h2yZ9S7CbLuFHyS2viB0jnqcWF9UKjwsAbMrQtnQhdmdvOVOw9w==", + "dev": true + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", diff --git a/package.json b/package.json index 7f64959..5093a31 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "karma-mocha": "^2.0.1", "karma-sinon-chai": "^2.0.2", "karma-webpack": "^5.0.0", + "marked": "^9.1.2", "mocha": "^10.0.0", "mocha-test-container-support": "^0.2.0", "npm-run-all": "^4.1.5", From 2819088a368099e413314400186b1cd5e0ea09c2 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Mon, 23 Oct 2023 11:31:26 +0200 Subject: [PATCH 2/4] feat(builtins): mark Camunda Extensions --- scripts/compileBuiltins.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/compileBuiltins.js b/scripts/compileBuiltins.js index f217ed8..1f45f38 100644 --- a/scripts/compileBuiltins.js +++ b/scripts/compileBuiltins.js @@ -3,7 +3,7 @@ const { marked } = require('marked'); const fs = require('node:fs/promises'); // paths relative to CWD -const MARKDOWN_SRC = './camunda-platform-docs/versioned_docs/version-8.0/components/modeler/feel/builtin-functions/*.md'; +const MARKDOWN_SRC = './camunda-platform-docs/docs/components/modeler/feel/builtin-functions/*.md'; const JSON_DEST = './src/autocompletion/builtins.json'; glob(MARKDOWN_SRC, function(err, files) { @@ -17,7 +17,9 @@ glob(MARKDOWN_SRC, function(err, files) { return rawDescriptors.flatMap(string => { const name = string.split('\n')[0]; - const description = marked.parse(string.split('\n').slice(1).join('\n')); + let description = marked.parse(string.split('\n').slice(1).join('\n')); + + description = description.replace('', 'Camunda Extension'); // e.g. "and() / all()" if (name.includes('/')) { From 490989c80f576fd898b57e6d91600a86247de6d0 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Mon, 23 Oct 2023 11:36:54 +0200 Subject: [PATCH 3/4] feat: update builtins list --- src/autocompletion/builtins.json | 476 ++++++++++++++-------- test/spec/CodeEditor.spec.js | 2 +- test/spec/autocompletion/builtIns.spec.js | 4 +- 3 files changed, 313 insertions(+), 169 deletions(-) diff --git a/src/autocompletion/builtins.json b/src/autocompletion/builtins.json index 7ee8ead..303f80a 100644 --- a/src/autocompletion/builtins.json +++ b/src/autocompletion/builtins.json @@ -1,338 +1,482 @@ [ { - "name": "not()", - "description": "
    \n
  • parameters:
      \n
    • negand: boolean
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
not(true)\n// false\n
\n" + "name": "not(negand)", + "description": "

Returns the logical negation of the given value.

\n

Function signature

\n
not(negand: boolean): boolean\n
\n

Examples

\n
not(true)\n// false\n\nnot(null)\n// null\n
\n" }, { - "name": "is defined()", - "description": "

Checks if a given value is defined. A value is defined if it exists, and it is an instance of one of the FEEL data types including null.

\n

The function can be used to check if a variable or a context entry (e.g. a property of a variable) exists. It allows differentiating between a null variable and a value that doesn't exist.

\n
    \n
  • parameters:
      \n
    • value: any
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
is defined(1)\n// true\n\nis defined(null)\n// true\n\nis defined(x)\n// false - if no variable "x" exists\n\nis defined(x.y)\n// false - if no variable "x" exists or it doesn't have a property "y"\n
\n" + "name": "is defined(value)", + "description": "

Camunda Extension

\n

Checks if a given value is not null. If the value is null then the function returns false.\nOtherwise, the function returns true.

\n

Function signature

\n
is defined(value: Any): boolean\n
\n

Examples

\n
is defined(1)\n// true\n\nis defined(null)\n// false\n\nis defined(x)\n// false - if no variable "x" exists\n\nis defined(x.y)\n// false - if no variable "x" exists or it doesn't have a property "y"\n
\n

:::caution Breaking change

\n

This function worked differently in previous versions. It returned true if the value was null.\nSince this version, the function returns false if the value is null.

\n

:::

\n" }, { - "name": "get value()", - "description": "

Returns the value of the context entry with the given key.

\n
    \n
  • parameters:
      \n
    • context: context
    • \n
    • key: string
    • \n
    \n
  • \n
  • result: any
  • \n
\n
get value({foo: 123}, "foo")\n// 123\n
\n" + "name": "get or else(value, default)", + "description": "

Camunda Extension

\n

Return the provided value parameter if not null, otherwise return the default parameter

\n

Function signature

\n
get or else(value: Any, default: Any): Any\n
\n

Examples

\n
get or else("this", "default")\n// "this"\n\nget or else(null, "default")\n// "default"\n\nget or else(null, null)\n// null\n
\n" }, { - "name": "get entries()", - "description": "

Returns the entries of the context as a list of key-value-pairs.

\n
    \n
  • parameters:
      \n
    • context: context
    • \n
    \n
  • \n
  • result: list of context which contains two entries for "key" and "value"
  • \n
\n
get entries({foo: 123})\n// [{key: "foo", value: 123}]\n
\n" + "name": "assert(value, condition)", + "description": "

Camunda Extension

\n

Verify that the given condition is met. If the condition is true, the function returns the value.\nOtherwise, the evaluation fails with an error.

\n

Function signature

\n
assert(value: Any, condition: Any)\n
\n

Examples

\n
assert(x, x != null)\n// "value" - if x is "value"\n// error - if x is null or doesn't exist\n\nassert(x, x >= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n
\n" }, { - "name": "put()", - "description": "

Add the given key and value to a context. Returns a new context that includes the entry. It might override an existing entry of the context.

\n

Returns null if the value is not defined.

\n
    \n
  • parameters:
      \n
    • context: context
    • \n
    • key: string
    • \n
    • value: any
    • \n
    \n
  • \n
  • result: context
  • \n
\n
put({x:1}, "y", 2)\n// {x:1, y:2}\n
\n" + "name": "assert(value, condition, cause)", + "description": "

Camunda Extension

\n

Verify that the given condition is met. If the condition is true, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.

\n

Function signature

\n
assert(value: Any, condition: Any, cause: String)\n
\n

Examples

\n
assert(x, x != null, "'x' should not be null")\n// "value" - if x is "value"\n// error('x' should not be null) - if x is null or doesn't exist\n\nassert(x, x >= 0, "'x' should be positive")\n// 4 - if x is 4\n// error('x' should be positive) - if x is less than zero\n
\n" }, { - "name": "put all()", - "description": "

Union the given contexts (two or more). Returns a new context that includes all entries of the given contexts. It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts are passed in the method.

\n

Returns null if one of the values is not a context.

\n
    \n
  • parameters:
      \n
    • contexts: contexts as varargs
    • \n
    \n
  • \n
  • result: context
  • \n
\n
put all({x:1}, {y:2})\n// {x:1, y:2}\n
\n" + "name": "get value(context, key)", + "description": "

Returns the value of the context entry with the given key.

\n

Function signature

\n
get value(context: context, key: string): Any\n
\n

Examples

\n
get value({foo: 123}, "foo")\n// 123\n\nget value({a: 1}, "b")\n// null\n
\n" }, { - "name": "date()", - "description": "
    \n
  • parameters:
      \n
    • from: string / date-time
    • \n
    • or year, month, day: number
    • \n
    \n
  • \n
  • result: date
  • \n
\n
date(birthday)\n// date("2018-04-29")\n\ndate(date and time("2012-12-25T11:00:00"))\n// date("2012-12-25")\n\ndate(2012, 12, 25)\n// date("2012-12-25")\n
\n" + "name": "get value(context, keys)", + "description": "

Camunda Extension

\n

Returns the value of the context entry for a context path defined by the given keys.

\n

If keys contains the keys [k1, k2] then it returns the value at the nested entry k1.k2 of the context.

\n

If keys are empty or the nested entry defined by the keys doesn't exist in the context, it returns null.

\n

Function signature

\n
get value(context: context, keys: list<string>): Any\n
\n

Examples

\n
get value({x:1, y: {z:0}}, ["y", "z"])\n// 0\n\nget value({x: {y: {z:0}}}, ["x", "y"])\n// {z:0}\n\nget value({a: {b: 3}}, ["b"])\n// null\n
\n" }, { - "name": "time()", - "description": "
    \n
  • parameters:
      \n
    • from: string / date-time
    • \n
    • or hour, minute, second: number
        \n
      • (optional) offset: day-time-duration
      • \n
      \n
    • \n
    \n
  • \n
  • result: time
  • \n
\n
time(lunchTime)\n// time("12:00:00")\n\ntime(date and time("2012-12-25T11:00:00"))\n// time("11:00:00")\n\ntime(23, 59, 0)\n// time("23:59:00")\n\ntime(14, 30, 0, duration("PT1H"))\n// time("15:30:00")\n
\n" + "name": "get entries(context)", + "description": "

Returns the entries of the context as a list of key-value-pairs.

\n

Function signature

\n
get entries(context: context): list<context>\n
\n

The return value is a list of contexts. Each context contains two entries for "key" and "value".

\n

Examples

\n
get entries({foo: 123})\n// [{key: "foo", value: 123}]\n
\n" }, { - "name": "date and time()", - "description": "
    \n
  • parameters:
      \n
    • date: date / date-time
    • \n
    • time: time
    • \n
    • or from: string
    • \n
    \n
  • \n
  • result: date-time
  • \n
\n
date and time(date("2012-12-24"),time("T23:59:00"))\n// date and time("2012-12-24T23:59:00")\n\ndate and time(date and time("2012-12-25T11:00:00"),time("T23:59:00"))\n// date and time("2012-12-25T23:59:00")\n\ndate and time(birthday)\n// date and time("2018-04-29T009:30:00")\n
\n" + "name": "context put(context, key, value)", + "description": "

Adds a new entry with the given key and value to the context. Returns a new context that includes the entry.

\n

If an entry for the same key already exists in the context, it overrides the value.

\n

Function signature

\n
context put(context: context, key: string, value: Any): context\n
\n

Examples

\n
context put({x:1}, "y", 2)\n// {x:1, y:2}\n
\n

:::info\nThe function context put() replaced the previous function put() (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::

\n" }, { - "name": "duration()", - "description": "
    \n
  • parameters:
      \n
    • from: string
    • \n
    \n
  • \n
  • result: day-time-duration or year-month-duration
  • \n
\n
duration(weekDays)\n// duration("P5D")\n\nduration(age)\n// duration("P32Y")\n
\n" + "name": "context put(context, keys, value)", + "description": "

Adds a new entry with the given value to the context. The path of the entry is defined by the keys. Returns a new context that includes the entry.

\n

If keys contains the keys [k1, k2] then it adds the nested entry k1.k2 = value to the context.

\n

If an entry for the same keys already exists in the context, it overrides the value.

\n

If keys are empty, it returns null.

\n

Function signature

\n
context put(context: context, keys: list<string>, value: Any): context\n
\n

Examples

\n
context put({x:1}, ["y"], 2)\n// {x:1, y:2}\n\ncontext put({x:1, y: {z:0}}, ["y", "z"], 2)\n// {x:1, y: {z:2}}\n\ncontext put({x:1}, ["y", "z"], 2)\n// {x:1, y: {z:2}}\n
\n" }, { - "name": "years and months duration()", - "description": "
    \n
  • parameters:
      \n
    • from: date
    • \n
    • to: date
    • \n
    \n
  • \n
  • result: year-month-duration
  • \n
\n
years and months duration(date("2011-12-22"), date("2013-08-24"))\n// duration("P1Y8M")\n
\n" + "name": "context merge(contexts)", + "description": "

Union the given contexts. Returns a new context that includes all entries of the given contexts.

\n

If an entry for the same key already exists in a context, it overrides the value. The entries are overridden in the same order as in the list of contexts.

\n

Function signature

\n
context merge(contexts: list<context>): context\n
\n

Examples

\n
context merge([{x:1}, {y:2}])\n// {x:1, y:2}\n\ncontext merge([{x:1, y: 0}, {y:2}])\n// {x:1, y:2}\n
\n

:::info\nThe function context merge() replaced the previous function put all() (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::

\n" }, { - "name": "number()", - "description": "
    \n
  • parameters:
      \n
    • from: string
    • \n
    \n
  • \n
  • result: number
  • \n
\n
number("1500.5")\n// 1500.5\n
\n" + "name": "string(from)", + "description": "

Returns the given value as a string representation.

\n

Function signature

\n
string(from: Any): string\n
\n

Examples

\n
string(1.1)\n// "1.1"\n\nstring(date("2012-12-25"))\n// "2012-12-25"\n
\n" }, { - "name": "string()", - "description": "
    \n
  • parameters:
      \n
    • from: any
    • \n
    \n
  • \n
  • result: string
  • \n
\n
string(1.1)\n// "1.1"\n\nstring(date("2012-12-25"))\n// "2012-12-25"\n
\n" + "name": "number(from)", + "description": "

Parses the given string to a number.

\n

Function signature

\n
number(from: string): number\n
\n

Examples

\n
number("1500.5")\n// 1500.5\n
\n" }, { - "name": "context()", - "description": "

Constructs a context of the given list of key-value pairs. It is the reverse function to get entries().

\n

Each key-value pair must be a context with two entries: key and value. The entry with name key must have a value of the type string.

\n

It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.

\n

Returns null if one of the entries is not a context or if a context doesn't contain the required entries.

\n
    \n
  • parameters:
      \n
    • entries: list of contexts
    • \n
    \n
  • \n
  • result: context
  • \n
\n
context([{"key":"a", "value":1}, {"key":"b", "value":2}])\n// {a:1, b:2}\n
\n" + "name": "context(entries)", + "description": "

Constructs a context of the given list of key-value pairs. It is the reverse function to get entries().

\n

Each key-value pair must be a context with two entries: key and value. The entry with name key must have a value of the type string.

\n

It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.

\n

Returns null if one of the entries is not a context or if a context doesn't contain the required entries.

\n

Function signature

\n
context(entries: list<context>): context\n
\n

Examples

\n
context([{"key":"a", "value":1}, {"key":"b", "value":2}])\n// {a:1, b:2}\n
\n" }, { - "name": "list contains()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • element: any
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
list contains([1,2,3], 2)\n// true\n
\n" + "name": "date(from)", + "description": "

Returns a date from the given value.

\n

Function signature

\n
date(from: string): date\n
\n

Parses the given string into a date.

\n
date(from: date and time): date\n
\n

Extracts the date component from the given date and time.

\n

Examples

\n
date("2018-04-29")\n// date("2018-04-29")\n\ndate(date and time("2012-12-25T11:00:00"))\n// date("2012-12-25")\n
\n" }, { - "name": "count()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    \n
  • \n
  • result: number
  • \n
\n
count([1,2,3])\n// 3\n
\n" + "name": "date(year, month, day)", + "description": "

Returns a date from the given components.

\n

Function signature

\n
date(year: number, month: number, day: number): date\n
\n

Examples

\n
date(2012, 12, 25)\n// date("2012-12-25")\n
\n" }, { - "name": "min()", - "description": "
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
min([1,2,3])\n// 1\n\nmin(1,2,3)\n// 1\n
\n" + "name": "time(from)", + "description": "

Returns a time from the given value.

\n

Function signature

\n
time(from: string): time\n
\n

Parses the given string into a time.

\n
time(from: date and time): time\n
\n

Extracts the time component from the given date and time.

\n

Examples

\n
time("12:00:00")\n// time("12:00:00")\n\ntime(date and time("2012-12-25T11:00:00"))\n// time("11:00:00")\n
\n" }, { - "name": "max()", - "description": "
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
max([1,2,3])\n// 3\n\nmax(1,2,3)\n// 3\n
\n" + "name": "time(hour, minute, second)", + "description": "

Returns a time from the given components.

\n

Function signature

\n
time(hour: number, minute: number, second: number): time\n
\n

Examples

\n
time(23, 59, 0)\n// time("23:59:00")\n
\n" }, { - "name": "sum()", - "description": "
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
sum([1,2,3])\n// 6\n\nsum(1,2,3)\n// 6\n
\n" + "name": "time(hour, minute, second, offset)", + "description": "

Returns a time from the given components, including a timezone offset.

\n

Function signature

\n
time(hour: number, minute: number, second: number, offset: days and time duration): time\n
\n

Examples

\n
time(14, 30, 0, duration("PT1H"))\n// time("14:30:00+01:00")\n
\n" }, { - "name": "product()", - "description": "
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
product([2, 3, 4])\n// 24\n\nproduct(2, 3, 4)\n// 24\n
\n" + "name": "date and time(from)", + "description": "

Parses the given string into a date and time.

\n

Function signature

\n
date and time(from: string): date and time\n
\n

Examples

\n
date and time("2018-04-29T009:30:00")\n// date and time("2018-04-29T009:30:00")\n
\n" }, { - "name": "mean()", - "description": "

Returns the arithmetic mean (i.e. average).

\n
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
mean([1,2,3])\n// 2\n\nmean(1,2,3)\n// 2\n
\n" + "name": "date and time(date, time)", + "description": "

Returns a date and time from the given components.

\n

Function signature

\n
date and time(date: date, time: time): date and time\n
\n
date and time(date: date and time, time: time): date and time\n
\n

Returns a date and time value that consists of the date component of date combined with time.

\n

Examples

\n
date and time(date("2012-12-24"),time("T23:59:00"))\n// date and time("2012-12-24T23:59:00")\n\ndate and time(date and time("2012-12-25T11:00:00"),time("T23:59:00"))\n// date and time("2012-12-25T23:59:00")\n
\n" }, { - "name": "median()", - "description": "

Returns the median element of the list of numbers.

\n
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
median(8, 2, 5, 3, 4)\n// 4\n\nmedian([6, 1, 2, 3])\n// 2.5\n
\n" + "name": "date and time(date, timezone)", + "description": "

Camunda Extension

\n

Returns the given date and time value at the given timezone.

\n

If date has a different timezone than timezone then it adjusts the time to match the local time of timezone.

\n

Function signature

\n
date and time(date: date and time, timezone: string): date and time\n
\n

Examples

\n
date and time(@"2020-07-31T14:27:30@Europe/Berlin", "America/Los_Angeles")\n// date and time("2020-07-31T05:27:30@America/Los_Angeles")\n\ndate and time(@"2020-07-31T14:27:30", "Z")\n// date and time("2020-07-31T12:27:30Z")\n
\n" }, { - "name": "stddev()", - "description": "

Returns the standard deviation.

\n
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: number
  • \n
\n
stddev(2, 4, 7, 5)\n// 2.0816659994661326\n\nstddev([2, 4, 7, 5])\n// 2.0816659994661326\n
\n" + "name": "duration(from)", + "description": "

Parses the given string into a duration. The duration is either a days and time duration or a years and months duration.

\n

Function signature

\n
duration(from: string): days and time duration\n
\n
duration(from: string): years and months duration\n
\n

Examples

\n
duration("P5D")\n// duration("P5D")\n\nduration("P32Y")\n// duration("P32Y")\n
\n" }, { - "name": "mode()", - "description": "

Returns the mode of the list of numbers.

\n
    \n
  • parameters:
      \n
    • list: list of numbers
    • \n
    • or numbers as varargs
    • \n
    \n
  • \n
  • result: list of numbers
  • \n
\n
mode(6, 3, 9, 6, 6)\n// [6]\n\nmode([6, 1, 9, 6, 1])\n// [1, 6]\n
\n" + "name": "years and months duration(from, to)", + "description": "

Returns the years and months duration between from and to.

\n

Function signature

\n
years and months duration(from: date, to: date): years and months duration\n
\n

Examples

\n
years and months duration(date("2011-12-22"), date("2013-08-24"))\n// duration("P1Y8M")\n
\n" }, { - "name": "and()", - "description": "
    \n
  • parameters:
      \n
    • list: list of booleans
    • \n
    • or booleans as varargs
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
and([true,false])\n// false\n\nand(false,null,true)\n// false\n
\n" + "name": "list contains(list, element)", + "description": "

Returns true if the given list contains the element. Otherwise, returns false.

\n

Function signature

\n
list contains(list: list, element: Any): boolean\n
\n

Examples

\n
list contains([1,2,3], 2)\n// true\n
\n" }, { - "name": "all()", - "description": "
    \n
  • parameters:
      \n
    • list: list of booleans
    • \n
    • or booleans as varargs
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
and([true,false])\n// false\n\nand(false,null,true)\n// false\n
\n" + "name": "count(list)", + "description": "

Returns the number of elements of the given list.

\n

Function signature

\n
count(list: list): number\n
\n

Examples

\n
count([1,2,3])\n// 3\n
\n" }, { - "name": "or()", - "description": "
    \n
  • parameters:
      \n
    • list: list of booleans
    • \n
    • or booleans as varargs
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
or([false,true])\n// true\n\nor(false,null,true)\n// true\n
\n" + "name": "min(list)", + "description": "

Returns the minimum of the given list.

\n

Function signature

\n
min(list: list): Any\n
\n

All elements in list should have the same type and be comparable.

\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
min([1,2,3])\n// 1\n\nmin(1,2,3)\n// 1\n
\n" }, { - "name": "any()", - "description": "
    \n
  • parameters:
      \n
    • list: list of booleans
    • \n
    • or booleans as varargs
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
or([false,true])\n// true\n\nor(false,null,true)\n// true\n
\n" + "name": "max(list)", + "description": "

Returns the maximum of the given list.

\n

Function signature

\n
max(list: list): Any\n
\n

All elements in list should have the same type and be comparable.

\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
max([1,2,3])\n// 3\n\nmax(1,2,3)\n// 3\n
\n" }, { - "name": "sublist()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • start position: number
    • \n
    • (optional) length: number
    • \n
    \n
  • \n
  • result: list
  • \n
\n
sublist([1,2,3], 2)\n// [2,3]\n\nsublist([1,2,3], 1, 2)\n// [1,2]\n
\n" + "name": "sum(list)", + "description": "

Returns the sum of the given list of numbers.

\n

Function signature

\n
sum(list: list<number>): number\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
sum([1,2,3])\n// 6\n\nsum(1,2,3)\n// 6\n
\n" }, { - "name": "append()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • items: elements as varargs
    • \n
    \n
  • \n
  • result: list
  • \n
\n
append([1], 2, 3)\n// [1,2,3]\n
\n" + "name": "product(list)", + "description": "

Returns the product of the given list of numbers.

\n

Function signature

\n
product(list: list<number>): number\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
product([2, 3, 4])\n// 24\n\nproduct(2, 3, 4)\n// 24\n
\n" }, { - "name": "concatenate()", - "description": "
    \n
  • parameters:
      \n
    • lists: lists as varargs
    • \n
    \n
  • \n
  • result: list
  • \n
\n
concatenate([1,2],[3])\n// [1,2,3]\n\nconcatenate([1],[2],[3])\n// [1,2,3]\n
\n" + "name": "mean(list)", + "description": "

Returns the arithmetic mean (i.e. average) of the given list of numbers.

\n

Function signature

\n
mean(list: list<number>): number\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
mean([1,2,3])\n// 2\n\nmean(1,2,3)\n// 2\n
\n" }, { - "name": "insert before()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • position: number
    • \n
    • newItem: any
    • \n
    \n
  • \n
  • result: list
  • \n
\n
insert before([1,3],1,2)\n// [1,2,3]\n
\n" + "name": "median(list)", + "description": "

Returns the median element of the given list of numbers.

\n

Function signature

\n
median(list: list<number>): number\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
median(8, 2, 5, 3, 4)\n// 4\n\nmedian([6, 1, 2, 3])\n// 2.5\n
\n" }, { - "name": "remove()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • position: number
    • \n
    \n
  • \n
  • result: list
  • \n
\n
remove([1,2,3], 2)\n// [1,3]\n
\n" + "name": "stddev(list)", + "description": "

Returns the standard deviation of the given list of numbers.

\n

Function signature

\n
stddev(list: list<number>): number\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
stddev(2, 4, 7, 5)\n// 2.0816659994661326\n\nstddev([2, 4, 7, 5])\n// 2.0816659994661326\n
\n" }, { - "name": "reverse()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    \n
  • \n
  • result: list
  • \n
\n
reverse([1,2,3])\n// [3,2,1]\n
\n" + "name": "mode(list)", + "description": "

Returns the mode of the given list of numbers.

\n

Function signature

\n
mode(list: list<number>): number\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
mode(6, 3, 9, 6, 6)\n// [6]\n\nmode([6, 1, 9, 6, 1])\n// [1, 6]\n
\n" }, { - "name": "index of()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • match: any
    • \n
    \n
  • \n
  • result: list of numbers
  • \n
\n
index of([1,2,3,2],2)\n// [2,4]\n
\n" + "name": "all(list)", + "description": "

Returns false if any element of the given list is false. Otherwise, returns true.

\n

If the given list is empty, it returns true.

\n

Function signature

\n
all(list: list<boolean>): boolean\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
all([true,false])\n// false\n\nall(false,null,true)\n// false\n
\n

:::info\nThe function all() replaced the previous function and(). The previous function is deprecated and\nshould not be used anymore.\n:::

\n" }, { - "name": "union()", - "description": "
    \n
  • parameters:
      \n
    • lists: lists as varargs
    • \n
    \n
  • \n
  • result: list
  • \n
\n
union([1,2],[2,3])\n// [1,2,3]\n
\n" + "name": "any(list)", + "description": "

Returns true if any element of the given list is true. Otherwise, returns false.

\n

If the given list is empty, it returns false.

\n

Function signature

\n
any(list: list<boolean>): boolean\n
\n

The parameter list can be passed as a list or as a sequence of elements.

\n

Examples

\n
any([false,true])\n// true\n\nany(false,null,true)\n// true\n
\n

:::info\nThe function any() replaced the previous function or(). The previous function is deprecated and\nshould not be used anymore.\n:::

\n" }, { - "name": "distinct values()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    \n
  • \n
  • result: list
  • \n
\n
distinct values([1,2,3,2,1])\n// [1,2,3]\n
\n" + "name": "sublist(list, start position)", + "description": "

Returns a partial list of the given value starting at start position.

\n

Function signature

\n
sublist(list: list, start position: number): list\n
\n

The start position starts at the index 1. The last position is -1.

\n

Examples

\n
sublist([1,2,3], 2)\n// [2,3]\n
\n" }, { - "name": "flatten()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    \n
  • \n
  • result: list
  • \n
\n
flatten([[1,2],[[3]], 4])\n// [1,2,3,4]\n
\n" + "name": "sublist(list, start position, length)", + "description": "

Returns a partial list of the given value starting at start position.

\n

Function signature

\n
sublist(list: list, start position: number, length: number): list\n
\n

The start position starts at the index 1. The last position is -1.

\n

Examples

\n
sublist([1,2,3], 1, 2)\n// [1,2]\n
\n" }, { - "name": "sort()", - "description": "
    \n
  • parameters:
      \n
    • list: list
    • \n
    • precedes: function with two arguments and boolean result
    • \n
    \n
  • \n
  • result: list
  • \n
\n
sort(list: [3,1,4,5,2], precedes: function(x,y) x < y)\n// [1,2,3,4,5]\n
\n" + "name": "append(list, items)", + "description": "

Returns the given list with all items appended.

\n

Function signature

\n
append(list: list, items: Any): list\n
\n

The parameter items can be a single element or a sequence of elements.

\n

Examples

\n
append([1], 2, 3)\n// [1,2,3]\n
\n" }, { - "name": "string join()", - "description": "

This joins a list of strings into a single string. This is similar to\nJava's joining\nfunction.

\n

If an item of the list is null, the item is ignored for the result string. If an item is\nneither a string nor null, the function returns null instead of a string.

\n
    \n
  • Parameters:
      \n
    • list: The list of strings to join
    • \n
    • delimiter: (Optional) The string used between each element (default: empty string)
    • \n
    • prefix: (Optional) The string used at the beginning of the joined result (default:\nempty string)
    • \n
    • suffix: (Optional) The string used at the end of the joined result (default: empty\nstring)
    • \n
    \n
  • \n
  • Result: The joined list as a string
  • \n
\n
string join(["a","b","c"])\n// "abc"\nstring join(["a"], "X")\n// "a"\nstring join(["a","b","c"], ", ")\n// "a, b, c"\nstring join(["a","b","c"], ", ", "[", "]")\n// "[a, b, c]"\nstring join(["a",null,"c"])\n// "ac"\nstring join([])\n// ""\n
\n" + "name": "concatenate(lists)", + "description": "

Returns a list that includes all elements of the given lists.

\n

Function signature

\n
concatenate(lists: list): list\n
\n

The parameter lists is a sequence of lists.

\n

Examples

\n
concatenate([1,2],[3])\n// [1,2,3]\n\nconcatenate([1],[2],[3])\n// [1,2,3]\n
\n" }, { - "name": "decimal()", - "description": "

Round the given number at the given scale using the given rounding mode. If no rounding mode is passed in, it uses HALF_EVEN as default.

\n
    \n
  • parameters:
      \n
    • n: number
    • \n
    • scale: number
    • \n
    • (optional) mode: string - one of UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN, UNNECESSARY (default: HALF_EVEN)
    • \n
    \n
  • \n
  • result: number
  • \n
\n
decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n\ndecimal(2.5, 0, "half_up")\n// 3\n
\n" + "name": "insert before(list, position, newItem)", + "description": "

Returns the given list with newItem inserted at position.

\n

Function signature

\n
insert before(list: list, position: number, newItem: Any): list\n
\n

The position starts at the index 1. The last position is -1.

\n

Examples

\n
insert before([1,3],1,2)\n// [2,1,3]\n
\n" }, { - "name": "floor()", - "description": "
    \n
  • parameters:
      \n
    • n: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
floor(1.5)\n// 1\n\nfloor(-1.5)\n// -2\n
\n" + "name": "remove(list, position)", + "description": "

Returns the given list without the element at position.

\n

Function signature

\n
remove(list: list, position: number): list\n
\n

The position starts at the index 1. The last position is -1.

\n

Examples

\n
remove([1,2,3], 2)\n// [1,3]\n
\n" }, { - "name": "ceiling()", - "description": "

Round the given number at the given scale using the ceiling rounding mode.

\n
    \n
  • parameters:
      \n
    • n: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
ceiling(1.5)\n// 2\n\nceiling(-1.5)\n// -1\n
\n" + "name": "reverse(list)", + "description": "

Returns the given list in revered order.

\n

Function signature

\n
reverse(list: list): list\n
\n

Examples

\n
reverse([1,2,3])\n// [3,2,1]\n
\n" }, { - "name": "abs()", - "description": "

Returns the absolute value of the given numeric value.

\n
    \n
  • parameters:
      \n
    • number: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
abs(10)\n// 10\n\nabs(-10)\n// 10\n
\n" + "name": "index of(list, match)", + "description": "

Returns an ascending list of positions containing match.

\n

Function signature

\n
index of(list: list, match: Any): list<number>\n
\n

Examples

\n
index of([1,2,3,2],2)\n// [2,4]\n
\n" }, { - "name": "modulo()", - "description": "

Returns the remainder of the division of dividend by divisor.

\n
    \n
  • parameters:
      \n
    • dividend: number
    • \n
    • divisor: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
modulo(12, 5)\n// 2\n
\n" + "name": "union(list)", + "description": "

Returns a list that includes all elements of the given lists without duplicates.

\n

Function signature

\n
union(list: list): list\n
\n

The parameter list is a sequence of lists.

\n

Examples

\n
union([1,2],[2,3])\n// [1,2,3]\n
\n" }, { - "name": "sqrt()", - "description": "

Returns the square root.

\n
    \n
  • parameters:
      \n
    • number: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
sqrt(16)\n// 4\n
\n" + "name": "distinct values(list)", + "description": "

Returns the given list without duplicates.

\n

Function signature

\n
distinct values(list: list): list\n
\n

Examples

\n
distinct values([1,2,3,2,1])\n// [1,2,3]\n
\n" }, { - "name": "log()", - "description": "

Returns the natural logarithm (base e) of the number.

\n
    \n
  • parameters:
      \n
    • number: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
log(10)\n// 2.302585092994046\n
\n" + "name": "duplicate values(list)", + "description": "

Camunda Extension

\n

Returns all duplicate values of the given list.

\n

Function signature

\n
duplicate values(list: list): list\n
\n

Examples

\n
duplicate values([1,2,3,2,1])\n// [1,2]\n
\n" }, { - "name": "exp()", - "description": "

Returns the Euler’s number e raised to the power of number .

\n
    \n
  • parameters:
      \n
    • number: number
    • \n
    \n
  • \n
  • result: number
  • \n
\n
exp(5)\n// 148.4131591025766\n
\n" + "name": "flatten(list)", + "description": "

Returns a list that includes all elements of the given list without nested lists.

\n

Function signature

\n
flatten(list: list): list\n
\n

Examples

\n
flatten([[1,2],[[3]], 4])\n// [1,2,3,4]\n
\n" }, { - "name": "odd()", - "description": "

Returns true if the given numeric value is odd. Otherwise, it returns false.

\n
    \n
  • parameters:
      \n
    • number: number
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
odd(5)\n// true\n\nodd(2)\n// false\n
\n" + "name": "sort(list, precedes)", + "description": "

Returns the given list sorted by the precedes function.

\n

Function signature

\n
sort(list: list, precedes: function<(Any, Any) -> boolean>): list\n
\n

Examples

\n
sort(list: [3,1,4,5,2], precedes: function(x,y) x < y)\n// [1,2,3,4,5]\n
\n" }, { - "name": "even()", - "description": "

Returns true if the given numeric value is even. Otherwise, it returns false.

\n
    \n
  • parameters:
      \n
    • number: number
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
even(5)\n// false\n\neven(2)\n// true\n
\n" + "name": "string join(list)", + "description": "

Joins a list of strings into a single string. This is similar to\nJava's joining\nfunction.

\n

If an item of the list is null, the item is ignored for the result string. If an item is\nneither a string nor null, the function returns null instead of a string.

\n

Function signature

\n
string join(list: list<string>): string\n
\n

Examples

\n
string join(["a","b","c"])\n// "abc"\n\nstring join(["a",null,"c"])\n// "ac"\n\nstring join([])\n// ""\n
\n" }, { - "name": "before()", - "description": "
    \n
  • parameters:
      \n
    • point1, point2: any
    • \n
    • or range: range, point: any
    • \n
    • or point: any, range: range
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
before(1, 10)\n// true\n\nbefore(10, 1)\n// false\n\nbefore(1, [2..5])\n// true\n\nbefore([1..5], 10)\n// true\n\nbefore([1..5], [6..10])\n// true\n\nbefore([1..5),[5..10])\n// true\n
\n" + "name": "string join(list, delimiter)", + "description": "

Joins a list of strings into a single string. This is similar to\nJava's joining\nfunction.

\n

If an item of the list is null, the item is ignored for the result string. If an item is\nneither a string nor null, the function returns null instead of a string.

\n

The resulting string contains a delimiter between each element.

\n

Function signature

\n
string join(list: list<string>, delimiter: string): string\n
\n

Examples

\n
string join(["a"], "X")\n// "a"\n\nstring join(["a","b","c"], ", ")\n// "a, b, c"\n
\n" }, { - "name": "after()", - "description": "
    \n
  • parameters:
      \n
    • point1, point2: any
    • \n
    • or range: range, point: any
    • \n
    • or point: any, range: range
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
after(10, 1)\n// true\n\nafter(1, 10)\n// false\n\nafter(12, [2..5])\n// true\n\n([1..5], 10)\n// false\n\nbefore([6..10], [1..5])\n// true\n\nbefore([5..10], [1..5))\n// true\n
\n" + "name": "string join(list, delimiter, prefix, suffix)", + "description": "

Camunda Extension

\n

Joins a list of strings into a single string. This is similar to\nJava's joining\nfunction.

\n

If an item of the list is null, the item is ignored for the result string. If an item is\nneither a string nor null, the function returns null instead of a string.

\n

The resulting string starts with prefix, contains a delimiter between each element, and ends\nwith suffix.

\n

Function signature

\n
string join(list: list<string>, delimiter: string, prefix: string, suffix: string): string\n
\n

Examples

\n
string join(["a","b","c"], ", ", "[", "]")\n// "[a, b, c]"\n
\n" }, { - "name": "meets()", - "description": "
    \n
  • parameters:
      \n
    • range1: range
    • \n
    • range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
meets([1..5], [5..10])\n// true\n\nmeets([1..3], [4..6])\n// false\n\nmeets([1..3], [3..5])\n// true\n\nmeets([1..5], (5..8])\n// false\n
\n" + "name": "decimal(n, scale)", + "description": "

Rounds the given value at the given scale.

\n

Function signature

\n
decimal(n: number, scale: number): number\n
\n

Examples

\n
decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n
\n" }, { - "name": "met by()", - "description": "
    \n
  • parameters:
      \n
    • range1: range
    • \n
    • range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
met by([5..10], [1..5])\n// true\n\nmet by([3..4], [1..2])\n// false\n\nmet by([3..5], [1..3])\n// true\n\nmet by((5..8], [1..5))\n// false\n\nmet by([5..10], [1..5))\n// false\n
\n" + "name": "floor(n)", + "description": "

Rounds the given value with rounding mode flooring.

\n

Function signature

\n
floor(n: number): number\n
\n

Examples

\n
floor(1.5)\n// 1\n\nfloor(-1.5)\n// -2\n
\n" }, { - "name": "overlaps()", - "description": "
    \n
  • parameters:
      \n
    • range1: range
    • \n
    • range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
overlaps([5..10], [1..6])\n// true\n\noverlaps((3..7], [1..4])\n// true\n\noverlaps([1..3], (3..6])\n// false\n\noverlaps((5..8], [1..5))\n// false\n\noverlaps([4..10], [1..5))\n// treu\n
\n" + "name": "floor(n, scale)", + "description": "

Rounds the given value with rounding mode flooring at the given scale.

\n

Function signature

\n
floor(n: number, scale: number): number\n
\n

Examples

\n
floor(-1.56, 1)\n// -1.6\n
\n" }, { - "name": "overlaps before()", - "description": "
    \n
  • parameters:
      \n
    • range1: range
    • \n
    • range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
overlaps before([1..5], [4..10])\n// true\n\noverlaps before([3..4], [1..2])\n// false\n\noverlaps before([1..3], (3..5])\n// false\n\noverlaps before([1..5), (3..8])\n// true\n\noverlaps before([1..5), [5..10])\n// false\n
\n" + "name": "ceiling(n)", + "description": "

Rounds the given value with rounding mode ceiling.

\n

Function signature

\n
ceiling(n: number): number\n
\n

Examples

\n
ceiling(1.5)\n// 2\n\nceiling(-1.5)\n// -1\n
\n" }, { - "name": "overlaps after()", - "description": "
    \n
  • parameters:
      \n
    • range1: range
    • \n
    • range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
overlaps after([4..10], [1..5])\n// true\n\noverlaps after([3..4], [1..2])\n// false\n\noverlaps after([3..5], [1..3))\n// false\n\noverlaps after((5..8], [1..5))\n// false\n\noverlaps after([4..10], [1..5))\n// true\n
\n" + "name": "ceiling(n, scale)", + "description": "

Rounds the given value with rounding mode ceiling at the given scale.

\n

Function signature

\n
ceiling(n: number, scale: number): number\n
\n

Examples

\n
ceiling(-1.56, 1)\n// -1.5\n
\n" }, { - "name": "finishes()", - "description": "
    \n
  • parameters:
      \n
    • point: any, range: range
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
finishes(5, [1..5])\n// true\n\nfinishes(10, [1..7])\n// false\n\nfinishes([3..5], [1..5])\n// true\n\nfinishes((1..5], [1..5))\n// false\n\nfinishes([5..10], [1..10))\n// false\n
\n" + "name": "round up(n, scale)", + "description": "

Rounds the given value with the rounding mode round-up at the given scale.

\n

Function signature

\n
round up(n: number, scale: number): number\n
\n

Examples

\n
round up(5.5)\n// 6\n\nround up(-5.5)\n// -6\n\nround up(1.121, 2)\n// 1.13\n\nround up(-1.126, 2)\n// -1.13\n
\n" }, { - "name": "finished by()", - "description": "
    \n
  • parameters:
      \n
    • range: range, point: any
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
finishes by([5..10], 10)\n// true\n\nfinishes by([3..4], 2)\n// false\n\nfinishes by([3..5], [1..5])\n// true\n\nfinishes by((5..8], [1..5))\n// false\n\nfinishes by([5..10], (1..10))\n// true\n
\n" + "name": "round down(n, scale)", + "description": "

Rounds the given value with the rounding mode round-down at the given scale.

\n

Function signature

\n
round down(n: number, scale: number): number\n
\n

Examples

\n
round down(5.5, 0)\n// 5\n\nround down (-5.5, 0)\n// -5\n\nround down (1.121, 2)\n// 1.12\n\nround down (-1.126, 2)\n// -1.12\n
\n" }, { - "name": "includes()", - "description": "
    \n
  • parameters:
      \n
    • range: range, point: any
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
includes([5..10], 6)\n// true\n\nincludes([3..4], 5)\n// false\n\nincludes([1..10], [4..6])\n// true\n\nincludes((5..8], [1..5))\n// false\n\nincludes([1..10], [1..5))\n// true\n
\n" + "name": "round half up(n, scale)", + "description": "

Rounds the given value with the rounding mode round-half-up at the given scale.

\n

Function signature

\n
round half up(n: number, scale: number): number\n
\n

Examples

\n
round half up(5.5, 0)\n// 6\n\nround half up(-5.5, 0)\n// -6\n\nround half up(1.121, 2)\n// 1.12\n\nround half up(-1.126, 2)\n// -1.13\n
\n" }, { - "name": "during()", - "description": "
    \n
  • parameters:
      \n
    • point: any, range: range
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
during(5, [1..10])\n// true\n\nduring(12, [1..10])\n// false\n\nduring(1, (1..10])\n// false\n\nduring([4..6], [1..10))\n// true\n\nduring((1..5], (1..10])\n// true\n
\n" + "name": "round half down(n, scale)", + "description": "

Rounds the given value with the rounding mode round-half-down at the given scale.

\n

Function signature

\n
round half down(n: number, scale: number): number\n
\n

Examples

\n
round half down (5.5, 0)\n// 5\n\nround half down (-5.5, 0)\n// -5\n\nround half down (1.121, 2)\n// 1.12\n\nround half down (-1.126, 2)\n// -1.13\n
\n" }, { - "name": "starts()", - "description": "
    \n
  • parameters:
      \n
    • point: any, range: range
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
starts(1, [1..5])\n// true\n\nstarts(1, (1..8])\n// false\n\nstarts((1..5], [1..5])\n// false\n\nstarts([1..10], [1..10])\n// true\n\nstarts((1..10), (1..10))\n// true\n
\n" + "name": "abs(number)", + "description": "

Returns the absolute value of the given numeric value.

\n

Function signature

\n
abs(number: number): number\n
\n

Examples

\n
abs(10)\n// 10\n\nabs(-10)\n// 10\n
\n" }, { - "name": "started by()", - "description": "
    \n
  • parameters:
      \n
    • range: range, point: any
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
started by([1..10], 1)\n// true\n\nstarted by((1..10], 1)\n// false\n\nstarted by([1..10], [1..5])\n// true\n\nstarted by((1..10], [1..5))\n// false\n\nstarted by([1..10], [1..10))\n// true\n
\n" + "name": "modulo(dividend, divisor)", + "description": "

Returns the remainder of the division of dividend by divisor.

\n

Function signature

\n
modulo(dividend: number, divisor: number): number\n
\n

Examples

\n
modulo(12, 5)\n// 2\n
\n" }, { - "name": "coincides()", - "description": "
    \n
  • parameters:
      \n
    • point1, point2: any
    • \n
    • or range1, range2: range
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
coincides(5, 5)\n// true\n\ncoincides(3, 4)\n// false\n\ncoincides([1..5], [1..5])\n// true\n\ncoincides((1..5], [1..5))\n// false\n\ncoincides([1..5], [2..6])\n// false\n
\n" + "name": "sqrt(number)", + "description": "

Returns the square root of the given value.

\n

Function signature

\n
sqrt(number: number): number\n
\n

Examples

\n
sqrt(16)\n// 4\n
\n" }, { - "name": "substring()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    • start position: number
    • \n
    • (optional) length: number
    • \n
    \n
  • \n
  • result: string
  • \n
\n
substring("foobar",3)\n// "obar"\n\nsubstring("foobar",3,3)\n// "oba"\n
\n" + "name": "log(number)", + "description": "

Returns the natural logarithm (base e) of the given value.

\n

Function signature

\n
log(number: number): number\n
\n

Examples

\n
log(10)\n// 2.302585092994046\n
\n" }, { - "name": "string length()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    \n
  • \n
  • result: number
  • \n
\n
string length("foo")\n// 3\n
\n" + "name": "exp(number)", + "description": "

Returns the Euler’s number e raised to the power of the given number .

\n

Function signature

\n
exp(number: number): number\n
\n

Examples

\n
exp(5)\n// 148.4131591025766\n
\n" }, { - "name": "upper case()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    \n
  • \n
  • result: string
  • \n
\n
upper case("aBc4")\n// "ABC4"\n
\n" + "name": "odd(number)", + "description": "

Returns true if the given value is odd. Otherwise, returns false.

\n

Function signature

\n
odd(number: number): boolean\n
\n

Examples

\n
odd(5)\n// true\n\nodd(2)\n// false\n
\n" }, { - "name": "lower case()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    \n
  • \n
  • result: string
  • \n
\n
lower case("aBc4")\n// "abc4"\n
\n" + "name": "even(number)", + "description": "

Returns true if the given is even. Otherwise, returns false.

\n

Function signature

\n
even(number: number): boolean\n
\n

Examples

\n
even(5)\n// false\n\neven(2)\n// true\n
\n" }, { - "name": "substring before()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    • match: string
    • \n
    \n
  • \n
  • result: string
  • \n
\n
substring before("foobar", "bar")\n// "foo"\n
\n" + "name": "random number()", + "description": "

Camunda Extension

\n

Returns a random number between 0 and 1.

\n

Function signature

\n
random number(): number\n
\n

Examples

\n
random number()\n// 0.9701618132579795\n
\n" }, { - "name": "substring after()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    • match: string
    • \n
    \n
  • \n
  • result: string
  • \n
\n
substring after("foobar", "ob")\n// "ar"\n
\n" + "name": "before(point1, point2)", + "description": "

Function signature

\n
before(point1: Any, point2: Any): boolean\n
\n

Examples

\n
before(1, 10)\n// true\n\nbefore(10, 1)\n// false\n
\n" }, { - "name": "contains()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    • match: string
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
contains("foobar", "of")\n// false\n
\n" + "name": "before(range, point)", + "description": "

Function signature

\n
before(range: range, point: Any): boolean\n
\n

Examples

\n
before([1..5], 10)\n// true\n
\n" }, { - "name": "starts with()", - "description": "
    \n
  • parameters:
      \n
    • input: string
    • \n
    • match: string
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
starts with("foobar", "fo")\n// true\n
\n" + "name": "before(point, range)", + "description": "

Function signature

\n
before(point: Any, range: range): boolean\n
\n

Examples

\n
before(1, [2..5])\n// true\n
\n" }, { - "name": "ends with()", - "description": "
    \n
  • parameters:
      \n
    • input: string
    • \n
    • match: string
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
ends with("foobar", "r")\n// true\n
\n" + "name": "before(range1, range2)", + "description": "

Function signature

\n
before(range1: range, range2: range): boolean\n
\n

Examples

\n
before([1..5], [6..10])\n// true\n\nbefore([1..5),[5..10])\n// true\n
\n" }, { - "name": "matches()", - "description": "
    \n
  • parameters:
      \n
    • input: string
    • \n
    • pattern: string (regular expression)
    • \n
    \n
  • \n
  • result: boolean
  • \n
\n
matches("foobar", "^fo*bar")\n// true\n
\n" + "name": "after(point1, point2)", + "description": "

Function signature

\n
after(point1: Any, point2: Any): boolean\n
\n

Examples

\n
after(10, 1)\n// true\n\nafter(1, 10)\n// false\n
\n" }, { - "name": "replace()", - "description": "
    \n
  • parameters:
      \n
    • input: string
    • \n
    • pattern: string (regular expression)
    • \n
    • replacement: string (e.g. $1 returns the first match group)
    • \n
    • (optional) flags: string ("s", "m", "i", "x")
    • \n
    \n
  • \n
  • result: string
  • \n
\n
replace("abcd", "(ab)|(a)", "[1=$1][2=$2]")\n// "[1=ab][2=]cd"\n\nreplace("0123456789", "(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3")\n// "(012) 345-6789"\n
\n" + "name": "after(range, point)", + "description": "

Function signature

\n
after(range: range, point: Any): boolean\n
\n

Examples

\n
after([1..5], 10)\n// false\n
\n" }, { - "name": "split()", - "description": "
    \n
  • parameters:
      \n
    • string: string
    • \n
    • delimiter: string (regular expression)
    • \n
    \n
  • \n
  • result: list of strings
  • \n
\n
split("John Doe", "\\s" )\n// ["John", "Doe"]\n\nsplit("a;b;c;;", ";")\n// ["a", "b", "c", "", ""]\n
\n" + "name": "after(point, range)", + "description": "

Function signature

\n
after(point: Any, range: range): boolean\n
\n

Examples

\n
after(12, [2..5])\n// true\n
\n" }, { - "name": "extract()", - "description": "

Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn't\nmatch.

\n
    \n
  • parameters:
      \n
    • string: string
    • \n
    • pattern: string (regular expression)
    • \n
    \n
  • \n
  • result: list of strings
  • \n
\n
extract("references are 1234, 1256, 1378", "12[0-9]*")\n// ["1234","1256"]\n
\n" + "name": "after(range1, range2)", + "description": "

Function signature

\n
after(range1: range, range2: range): boolean\n
\n

Examples

\n
after([6..10], [1..5])\n// true\n\nafter([5..10], [1..5))\n// true\n
\n" + }, + { + "name": "meets(range1, range2)", + "description": "

Function signature

\n
meets(range1: range, range2: range): boolean\n
\n

Examples

\n
meets([1..5], [5..10])\n// true\n\nmeets([1..3], [4..6])\n// false\n\nmeets([1..3], [3..5])\n// true\n\nmeets([1..5], (5..8])\n// false\n
\n" + }, + { + "name": "met by(range1, range2)", + "description": "

Function signature

\n
met by(range1: range, range2: range): boolean\n
\n

Examples

\n
met by([5..10], [1..5])\n// true\n\nmet by([3..4], [1..2])\n// false\n\nmet by([3..5], [1..3])\n// true\n\nmet by((5..8], [1..5))\n// false\n\nmet by([5..10], [1..5))\n// false\n
\n" + }, + { + "name": "overlaps(range1, range2)", + "description": "

Function signature

\n
overlaps(range1: range, range2: range): boolean\n
\n

Examples

\n
overlaps([5..10], [1..6])\n// true\n\noverlaps((3..7], [1..4])\n// true\n\noverlaps([1..3], (3..6])\n// false\n\noverlaps((5..8], [1..5))\n// false\n\noverlaps([4..10], [1..5))\n// true\n
\n" + }, + { + "name": "overlaps before(range1, range2)", + "description": "

Function signature

\n
overlaps before(range1: range, range2: range): boolean\n
\n

Examples

\n
overlaps before([1..5], [4..10])\n// true\n\noverlaps before([3..4], [1..2])\n// false\n\noverlaps before([1..3], (3..5])\n// false\n\noverlaps before([1..5), (3..8])\n// true\n\noverlaps before([1..5), [5..10])\n// false\n
\n" + }, + { + "name": "overlaps after(range1, range2)", + "description": "

Function signature

\n
overlaps after(range1: range, range2: range): boolean\n
\n

Examples

\n
overlaps after([4..10], [1..5])\n// true\n\noverlaps after([3..4], [1..2])\n// false\n\noverlaps after([3..5], [1..3))\n// false\n\noverlaps after((5..8], [1..5))\n// false\n\noverlaps after([4..10], [1..5))\n// true\n
\n" + }, + { + "name": "finishes(point, range)", + "description": "

Function signature

\n
finishes(point: Any, range: range): boolean\n
\n

Examples

\n
finishes(5, [1..5])\n// true\n\nfinishes(10, [1..7])\n// false\n
\n" + }, + { + "name": "finishes(range1, range2)", + "description": "

Function signature

\n
finishes(range1: range, range2: range): boolean\n
\n

Examples

\n
finishes([3..5], [1..5])\n// true\n\nfinishes((1..5], [1..5))\n// false\n\nfinishes([5..10], [1..10))\n// false\n
\n" + }, + { + "name": "finished by(range, point)", + "description": "

Function signature

\n
finished by(range: range, point: Any): boolean\n
\n

Examples

\n
finished by([5..10], 10)\n// true\n\nfinished by([3..4], 2)\n// false\n
\n" + }, + { + "name": "finished by(range1, range2)", + "description": "

Function signature

\n
finished by(range1: range, range2: range): boolean\n
\n

Examples

\n
finished by([1..5], [3..5])\n// true\n\nfinished by((5..8], [1..5))\n// false\n\nfinished by([5..10], (1..10))\n// false\n
\n" + }, + { + "name": "includes(range, point)", + "description": "

Function signature

\n
includes(range: range, point: Any): boolean\n
\n

Examples

\n
includes([5..10], 6)\n// true\n\nincludes([3..4], 5)\n// false\n
\n" + }, + { + "name": "includes(range1, range2)", + "description": "

Function signature

\n
includes(range1: range, range2: range): boolean\n
\n

Examples

\n
includes([1..10], [4..6])\n// true\n\nincludes((5..8], [1..5))\n// false\n\nincludes([1..10], [1..5))\n// true\n
\n" + }, + { + "name": "during(point, range)", + "description": "

Function signature

\n
during(point: Any, range: range): boolean\n
\n

Examples

\n
during(5, [1..10])\n// true\n\nduring(12, [1..10])\n// false\n\nduring(1, (1..10])\n// false\n
\n" + }, + { + "name": "during(range1, range2)", + "description": "

Function signature

\n
during(range1: range, range2: range): boolean\n
\n

Examples

\n
during([4..6], [1..10))\n// true\n\nduring((1..5], (1..10])\n// true\n
\n" + }, + { + "name": "starts(point, range)", + "description": "

Function signature

\n
starts(point: Any, range: range): boolean\n
\n

Examples

\n
starts(1, [1..5])\n// true\n\nstarts(1, (1..8])\n// false\n
\n" + }, + { + "name": "starts(range1, range2)", + "description": "

Function signature

\n
starts(range1: range, range2: range): boolean\n
\n

Examples

\n
starts((1..5], [1..5])\n// false\n\nstarts([1..10], [1..5])\n// false\n\nstarts((1..5), (1..10))\n// true\n
\n" + }, + { + "name": "started by(range, point)", + "description": "

Function signature

\n
started by(range: range, point: Any): boolean\n
\n

Examples

\n
started by([1..10], 1)\n// true\n\nstarted by((1..10], 1)\n// false\n
\n" + }, + { + "name": "started by(range1, range2)", + "description": "

Function signature

\n
started by(range1: range, range2: range): boolean\n
\n

Examples

\n
started by([1..10], [1..5])\n// true\n\nstarted by((1..10], [1..5))\n// false\n\nstarted by([1..10], [1..10))\n// true\n
\n" + }, + { + "name": "coincides(point1, point2)", + "description": "

Function signature

\n
coincides(point1: Any, point2: Any): boolean\n
\n

Examples

\n
coincides(5, 5)\n// true\n\ncoincides(3, 4)\n// false\n
\n" + }, + { + "name": "coincides(range1, range2)", + "description": "

Function signature

\n
coincides(range1: range, range2: range): boolean\n
\n

Examples

\n
coincides([1..5], [1..5])\n// true\n\ncoincides((1..5], [1..5))\n// false\n\ncoincides([1..5], [2..6])\n// false\n
\n" + }, + { + "name": "substring(string, start position)", + "description": "

Returns a substring of the given value starting at start position.

\n

Function signature

\n
substring(string: string, start position: number): string\n
\n

The start position starts at the index 1. The last position is -1.

\n

Examples

\n
substring("foobar", 3)\n// "obar"\n
\n" + }, + { + "name": "substring(string, start position, length)", + "description": "

Returns a substring of the given value starting at start position.

\n

Function signature

\n
substring(string: string, start position: number, length: number): string\n
\n

The start position starts at the index 1. The last position is -1.

\n

Examples

\n
substring("foobar", 3, 3)\n// "oba"\n
\n" + }, + { + "name": "string length(string)", + "description": "

Returns the number of characters in the given value.

\n

Function signature

\n
string length(string: string): number\n
\n

Examples

\n
string length("foo")\n// 3\n
\n" + }, + { + "name": "upper case(string)", + "description": "

Returns the given value with all characters are uppercase.

\n

Function signature

\n
upper case(string: string): string\n
\n

Examples

\n
upper case("aBc4")\n// "ABC4"\n
\n" + }, + { + "name": "lower case(string)", + "description": "

Returns the given value with all characters are lowercase.

\n

Function signature

\n
lower case(string: string): string\n
\n

Examples

\n
lower case("aBc4")\n// "abc4"\n
\n" + }, + { + "name": "substring before(string, match)", + "description": "

Returns a substring of the given value that contains all characters before match.

\n

Function signature

\n
substring before(string: string, match: string): string\n
\n

Examples

\n
substring before("foobar", "bar")\n// "foo"\n
\n" + }, + { + "name": "substring after(string, match)", + "description": "

Returns a substring of the given value that contains all characters after match.

\n

Function signature

\n
substring after(string: string, match: string): string\n
\n

Examples

\n
substring after("foobar", "ob")\n// "ar"\n
\n" + }, + { + "name": "contains(string, match)", + "description": "

Returns true if the given value contains the substring match. Otherwise, returns false.

\n

Function signature

\n
contains(string: string, match: string): boolean\n
\n

Examples

\n
contains("foobar", "of")\n// false\n
\n" + }, + { + "name": "starts with(string, match)", + "description": "

Returns true if the given value starts with the substring match. Otherwise, returns false.

\n

Function signature

\n
starts with(string: string, match: string): boolean\n
\n

Examples

\n
starts with("foobar", "fo")\n// true\n
\n" + }, + { + "name": "ends with(string, match)", + "description": "

Returns true if the given value ends with the substring match. Otherwise, returns false.

\n

Function signature

\n
ends with(string: string, match: string): boolean\n
\n

Examples

\n
ends with("foobar", "r")\n// true\n
\n" + }, + { + "name": "matches(input, pattern)", + "description": "

Returns true if the given value matches the pattern. Otherwise, returns false.

\n

Function signature

\n
matches(input: string, pattern: string): boolean\n
\n

The pattern is a string that contains a regular expression.

\n

Examples

\n
matches("foobar", "^fo*bar")\n// true\n
\n" + }, + { + "name": "matches(input, pattern, flags)", + "description": "

Returns true if the given value matches the pattern. Otherwise, returns false.

\n

Function signature

\n
matches(input: string, pattern: string, flags: string): boolean\n
\n

The pattern is a string that contains a regular expression.

\n

The flags can contain one or more of the following characters:

\n
    \n
  • s (dot-all)
  • \n
  • m (multi-line)
  • \n
  • i (case insensitive)
  • \n
  • x (comments)
  • \n
\n

Examples

\n
matches("FooBar", "foo", "i")\n// true\n
\n" + }, + { + "name": "replace(input, pattern, replacement)", + "description": "

Returns the resulting string after replacing all occurrences of pattern with replacement.

\n

Function signature

\n
replace(input: string, pattern: string, replacement: string): string\n
\n

The pattern is a string that contains a regular expression.

\n

The replacement can access the match groups by using $ and the number of the group, for example,\n$1 to access the first group.

\n

Examples

\n
replace("abcd", "(ab)|(a)", "[1=$1][2=$2]")\n// "[1=ab][2=]cd"\n\nreplace("0123456789", "(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3")\n// "(012) 345-6789"\n
\n" + }, + { + "name": "replace(input, pattern, replacement, flags)", + "description": "

Returns the resulting string after replacing all occurrences of pattern with replacement.

\n

Function signature

\n
replace(input: string, pattern: string, replacement: string, flags: string): string\n
\n

The pattern is a string that contains a regular expression.

\n

The replacement can access the match groups by using $ and the number of the group, for example,\n$1 to access the first group.

\n

The flags can contain one or more of the following characters:

\n
    \n
  • s (dot-all)
  • \n
  • m (multi-line)
  • \n
  • i (case insensitive)
  • \n
  • x (comments)
  • \n
\n

Examples

\n
replace("How do you feel?", "Feel", "FEEL", "i")\n// "How do you FEEL?"\n
\n" + }, + { + "name": "split(string, delimiter)", + "description": "

Splits the given value into a list of substrings, breaking at each occurrence of the delimiter pattern.

\n

Function signature

\n
split(string: string, delimiter: string): list<string>\n
\n

The delimiter is a string that contains a regular expression.

\n

Examples

\n
split("John Doe", "\\s" )\n// ["John", "Doe"]\n\nsplit("a;b;c;;", ";")\n// ["a", "b", "c", "", ""]\n
\n" + }, + { + "name": "extract(string, pattern)", + "description": "

Camunda Extension

\n

Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn't\nmatch.

\n

Function signature

\n
extract(string: string, pattern: string): list<string>\n
\n

The pattern is a string that contains a regular expression.

\n

Examples

\n
extract("references are 1234, 1256, 1378", "12[0-9]*")\n// ["1234","1256"]\n
\n" }, { "name": "now()", - "description": "

Returns the current date and time including the timezone.

\n
    \n
  • parameters: no
  • \n
  • result: date-time with timezone
  • \n
\n
now()\n// date and time("2020-07-31T14:27:30@Europe/Berlin")\n
\n" + "description": "

Returns the current date and time including the timezone.

\n

Function signature

\n
now(): date and time\n
\n

Examples

\n
now()\n// date and time("2020-07-31T14:27:30@Europe/Berlin")\n
\n" }, { "name": "today()", - "description": "

Returns the current date.

\n
    \n
  • parameters: no
  • \n
  • result: date
  • \n
\n
today()\n// date("2020-07-31")\n
\n" + "description": "

Returns the current date.

\n

Function signature

\n
today(): date\n
\n

Examples

\n
today()\n// date("2020-07-31")\n
\n" + }, + { + "name": "day of week(date)", + "description": "

Returns the day of the week according to the Gregorian calendar. Note that it always returns the English name of the day.

\n

Function signature

\n
day of week(date: date): string\n
\n
day of week(date: date and time): string\n
\n

Examples

\n
day of week(date("2019-09-17"))\n// "Tuesday"\n\nday of week(date and time("2019-09-17T12:00:00"))\n// "Tuesday"\n
\n" }, { - "name": "day of week()", - "description": "

Returns the day of the week according to the Gregorian calendar. Note that it always returns the English name of the day.

\n
    \n
  • parameters:
      \n
    • date: date/date-time
    • \n
    \n
  • \n
  • result: string
  • \n
\n
day of week(date("2019-09-17"))\n// "Tuesday"\n
\n" + "name": "day of year(date)", + "description": "

Returns the Gregorian number of the day within the year.

\n

Function signature

\n
day of year(date: date): number\n
\n
day of year(date: date and time): number\n
\n

Examples

\n
day of year(date("2019-09-17"))\n// 260\n\nday of year(date and time("2019-09-17T12:00:00"))\n// 260\n
\n" }, { - "name": "day of year()", - "description": "

Returns the Gregorian number of the day within the year.

\n
    \n
  • parameters:
      \n
    • date: date/date-time
    • \n
    \n
  • \n
  • result: number
  • \n
\n
day of year(date("2019-09-17"))\n// 260\n
\n" + "name": "week of year(date)", + "description": "

Returns the Gregorian number of the week within the year, according to ISO 8601.

\n

Function signature

\n
week of year(date: date): number\n
\n
week of year(date: date and time): number\n
\n

Examples

\n
week of year(date("2019-09-17"))\n// 38\n\nweek of year(date and time("2019-09-17T12:00:00"))\n// 38\n
\n" }, { - "name": "week of year()", - "description": "

Returns the Gregorian number of the week within the year, according to ISO 8601.

\n
    \n
  • parameters:
      \n
    • date: date/date-time
    • \n
    \n
  • \n
  • result: number
  • \n
\n
week of year(date("2019-09-17"))\n// 38\n
\n" + "name": "month of year(date)", + "description": "

Returns the month of the year according to the Gregorian calendar. Note that it always returns the English name of the month.

\n

Function signature

\n
month of year(date: date): string\n
\n
month of year(date: date and time): string\n
\n

Examples

\n
month of year(date("2019-09-17"))\n// "September"\n\nmonth of year(date and time("2019-09-17T12:00:00"))\n// "September"\n
\n" }, { - "name": "month of year()", - "description": "

Returns the month of the week according to the Gregorian calendar. Note that it always returns the English name of the month.

\n
    \n
  • parameters:
      \n
    • date: date/date-time
    • \n
    \n
  • \n
  • result: string
  • \n
\n
month of year(date("2019-09-17"))\n// "September"\n
\n" + "name": "abs(n)", + "description": "

Returns the absolute value of a given duration.

\n

Function signature

\n
abs(n: days and time duration): days and time duration\n
\n
abs(n: years and months duration): years and months duration\n
\n

Examples

\n
abs(duration("-PT5H"))\n// "duration("PT5H")"\n\nabs(duration("PT5H"))\n// "duration("PT5H")"\n\nabs(duration("-P2M"))\n// duration("P2M")\n
\n" }, { - "name": "abs()", - "description": "

Returns the absolute value of a given duration.

\n
    \n
  • parameters:
      \n
    • n: days-time-duration/years-months-duration
    • \n
    \n
  • \n
  • result: duration
  • \n
\n
abs(duration("-PT5H"))\n// "duration("PT5H")"\n\nabs(duration("PT5H"))\n// "duration("PT5H")"\n\nabs(duration("-P2M"))\n// duration("P2M")\n
\n" + "name": "last day of month(date)", + "description": "

Camunda Extension

\n

Takes the month of the given date or date-time value and returns the last day of this month.

\n

Function signature

\n
last day of month(date: date): date\n
\n
last day of month(date: date and time): date\n
\n

Examples

\n
last day of month(date("2022-10-01"))\n// date("2022-10-31"))\n\nlast day of month(date and time("2022-10-16T12:00:00"))\n// date("2022-10-31"))\n
\n" } ] \ No newline at end of file diff --git a/test/spec/CodeEditor.spec.js b/test/spec/CodeEditor.spec.js index 9d559ce..9ffce41 100644 --- a/test/spec/CodeEditor.spec.js +++ b/test/spec/CodeEditor.spec.js @@ -629,7 +629,7 @@ return const completions = currentCompletions(cm.state); expect(completions).not.to.be.empty; - expect(completions[0].label).to.have.eql('abs()'); + expect(completions[0].label).to.have.eql('abs(n)'); }); }); diff --git a/test/spec/autocompletion/builtIns.spec.js b/test/spec/autocompletion/builtIns.spec.js index b26df87..6f61149 100644 --- a/test/spec/autocompletion/builtIns.spec.js +++ b/test/spec/autocompletion/builtIns.spec.js @@ -14,7 +14,7 @@ describe('autocompletion - builtIns', function() { // then expect(autoCompletion).to.exist; - expect(autoCompletion.options).to.have.length(84); + expect(autoCompletion.options).to.have.length(120); const firstOption = autoCompletion.options[0]; @@ -42,7 +42,7 @@ describe('autocompletion - builtIns', function() { expect(info).to.exist; // contains parameter list - expect(info.textContent.toLowerCase()).to.have.include('parameters'); + expect(info.textContent.toLowerCase()).to.have.include('function signature'); // contains example expect(info.querySelector('pre')).to.exist; From 9b06d9b6b33db2758886a8ee85f281ffb14f0d92 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Mon, 23 Oct 2023 13:11:17 +0200 Subject: [PATCH 4/4] chore(builtins): mark camunda extension as `em` --- scripts/compileBuiltins.js | 2 +- src/autocompletion/builtins.json | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/compileBuiltins.js b/scripts/compileBuiltins.js index 1f45f38..f8c9319 100644 --- a/scripts/compileBuiltins.js +++ b/scripts/compileBuiltins.js @@ -19,7 +19,7 @@ glob(MARKDOWN_SRC, function(err, files) { const name = string.split('\n')[0]; let description = marked.parse(string.split('\n').slice(1).join('\n')); - description = description.replace('', 'Camunda Extension'); + description = description.replace('', 'Camunda Extension'); // e.g. "and() / all()" if (name.includes('/')) { diff --git a/src/autocompletion/builtins.json b/src/autocompletion/builtins.json index 303f80a..55bd540 100644 --- a/src/autocompletion/builtins.json +++ b/src/autocompletion/builtins.json @@ -5,19 +5,19 @@ }, { "name": "is defined(value)", - "description": "

Camunda Extension

\n

Checks if a given value is not null. If the value is null then the function returns false.\nOtherwise, the function returns true.

\n

Function signature

\n
is defined(value: Any): boolean\n
\n

Examples

\n
is defined(1)\n// true\n\nis defined(null)\n// false\n\nis defined(x)\n// false - if no variable "x" exists\n\nis defined(x.y)\n// false - if no variable "x" exists or it doesn't have a property "y"\n
\n

:::caution Breaking change

\n

This function worked differently in previous versions. It returned true if the value was null.\nSince this version, the function returns false if the value is null.

\n

:::

\n" + "description": "

Camunda Extension

\n

Checks if a given value is not null. If the value is null then the function returns false.\nOtherwise, the function returns true.

\n

Function signature

\n
is defined(value: Any): boolean\n
\n

Examples

\n
is defined(1)\n// true\n\nis defined(null)\n// false\n\nis defined(x)\n// false - if no variable "x" exists\n\nis defined(x.y)\n// false - if no variable "x" exists or it doesn't have a property "y"\n
\n

:::caution Breaking change

\n

This function worked differently in previous versions. It returned true if the value was null.\nSince this version, the function returns false if the value is null.

\n

:::

\n" }, { "name": "get or else(value, default)", - "description": "

Camunda Extension

\n

Return the provided value parameter if not null, otherwise return the default parameter

\n

Function signature

\n
get or else(value: Any, default: Any): Any\n
\n

Examples

\n
get or else("this", "default")\n// "this"\n\nget or else(null, "default")\n// "default"\n\nget or else(null, null)\n// null\n
\n" + "description": "

Camunda Extension

\n

Return the provided value parameter if not null, otherwise return the default parameter

\n

Function signature

\n
get or else(value: Any, default: Any): Any\n
\n

Examples

\n
get or else("this", "default")\n// "this"\n\nget or else(null, "default")\n// "default"\n\nget or else(null, null)\n// null\n
\n" }, { "name": "assert(value, condition)", - "description": "

Camunda Extension

\n

Verify that the given condition is met. If the condition is true, the function returns the value.\nOtherwise, the evaluation fails with an error.

\n

Function signature

\n
assert(value: Any, condition: Any)\n
\n

Examples

\n
assert(x, x != null)\n// "value" - if x is "value"\n// error - if x is null or doesn't exist\n\nassert(x, x >= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n
\n" + "description": "

Camunda Extension

\n

Verify that the given condition is met. If the condition is true, the function returns the value.\nOtherwise, the evaluation fails with an error.

\n

Function signature

\n
assert(value: Any, condition: Any)\n
\n

Examples

\n
assert(x, x != null)\n// "value" - if x is "value"\n// error - if x is null or doesn't exist\n\nassert(x, x >= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n
\n" }, { "name": "assert(value, condition, cause)", - "description": "

Camunda Extension

\n

Verify that the given condition is met. If the condition is true, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.

\n

Function signature

\n
assert(value: Any, condition: Any, cause: String)\n
\n

Examples

\n
assert(x, x != null, "'x' should not be null")\n// "value" - if x is "value"\n// error('x' should not be null) - if x is null or doesn't exist\n\nassert(x, x >= 0, "'x' should be positive")\n// 4 - if x is 4\n// error('x' should be positive) - if x is less than zero\n
\n" + "description": "

Camunda Extension

\n

Verify that the given condition is met. If the condition is true, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.

\n

Function signature

\n
assert(value: Any, condition: Any, cause: String)\n
\n

Examples

\n
assert(x, x != null, "'x' should not be null")\n// "value" - if x is "value"\n// error('x' should not be null) - if x is null or doesn't exist\n\nassert(x, x >= 0, "'x' should be positive")\n// 4 - if x is 4\n// error('x' should be positive) - if x is less than zero\n
\n" }, { "name": "get value(context, key)", @@ -25,7 +25,7 @@ }, { "name": "get value(context, keys)", - "description": "

Camunda Extension

\n

Returns the value of the context entry for a context path defined by the given keys.

\n

If keys contains the keys [k1, k2] then it returns the value at the nested entry k1.k2 of the context.

\n

If keys are empty or the nested entry defined by the keys doesn't exist in the context, it returns null.

\n

Function signature

\n
get value(context: context, keys: list<string>): Any\n
\n

Examples

\n
get value({x:1, y: {z:0}}, ["y", "z"])\n// 0\n\nget value({x: {y: {z:0}}}, ["x", "y"])\n// {z:0}\n\nget value({a: {b: 3}}, ["b"])\n// null\n
\n" + "description": "

Camunda Extension

\n

Returns the value of the context entry for a context path defined by the given keys.

\n

If keys contains the keys [k1, k2] then it returns the value at the nested entry k1.k2 of the context.

\n

If keys are empty or the nested entry defined by the keys doesn't exist in the context, it returns null.

\n

Function signature

\n
get value(context: context, keys: list<string>): Any\n
\n

Examples

\n
get value({x:1, y: {z:0}}, ["y", "z"])\n// 0\n\nget value({x: {y: {z:0}}}, ["x", "y"])\n// {z:0}\n\nget value({a: {b: 3}}, ["b"])\n// null\n
\n" }, { "name": "get entries(context)", @@ -85,7 +85,7 @@ }, { "name": "date and time(date, timezone)", - "description": "

Camunda Extension

\n

Returns the given date and time value at the given timezone.

\n

If date has a different timezone than timezone then it adjusts the time to match the local time of timezone.

\n

Function signature

\n
date and time(date: date and time, timezone: string): date and time\n
\n

Examples

\n
date and time(@"2020-07-31T14:27:30@Europe/Berlin", "America/Los_Angeles")\n// date and time("2020-07-31T05:27:30@America/Los_Angeles")\n\ndate and time(@"2020-07-31T14:27:30", "Z")\n// date and time("2020-07-31T12:27:30Z")\n
\n" + "description": "

Camunda Extension

\n

Returns the given date and time value at the given timezone.

\n

If date has a different timezone than timezone then it adjusts the time to match the local time of timezone.

\n

Function signature

\n
date and time(date: date and time, timezone: string): date and time\n
\n

Examples

\n
date and time(@"2020-07-31T14:27:30@Europe/Berlin", "America/Los_Angeles")\n// date and time("2020-07-31T05:27:30@America/Los_Angeles")\n\ndate and time(@"2020-07-31T14:27:30", "Z")\n// date and time("2020-07-31T12:27:30Z")\n
\n" }, { "name": "duration(from)", @@ -185,7 +185,7 @@ }, { "name": "duplicate values(list)", - "description": "

Camunda Extension

\n

Returns all duplicate values of the given list.

\n

Function signature

\n
duplicate values(list: list): list\n
\n

Examples

\n
duplicate values([1,2,3,2,1])\n// [1,2]\n
\n" + "description": "

Camunda Extension

\n

Returns all duplicate values of the given list.

\n

Function signature

\n
duplicate values(list: list): list\n
\n

Examples

\n
duplicate values([1,2,3,2,1])\n// [1,2]\n
\n" }, { "name": "flatten(list)", @@ -205,7 +205,7 @@ }, { "name": "string join(list, delimiter, prefix, suffix)", - "description": "

Camunda Extension

\n

Joins a list of strings into a single string. This is similar to\nJava's joining\nfunction.

\n

If an item of the list is null, the item is ignored for the result string. If an item is\nneither a string nor null, the function returns null instead of a string.

\n

The resulting string starts with prefix, contains a delimiter between each element, and ends\nwith suffix.

\n

Function signature

\n
string join(list: list<string>, delimiter: string, prefix: string, suffix: string): string\n
\n

Examples

\n
string join(["a","b","c"], ", ", "[", "]")\n// "[a, b, c]"\n
\n" + "description": "

Camunda Extension

\n

Joins a list of strings into a single string. This is similar to\nJava's joining\nfunction.

\n

If an item of the list is null, the item is ignored for the result string. If an item is\nneither a string nor null, the function returns null instead of a string.

\n

The resulting string starts with prefix, contains a delimiter between each element, and ends\nwith suffix.

\n

Function signature

\n
string join(list: list<string>, delimiter: string, prefix: string, suffix: string): string\n
\n

Examples

\n
string join(["a","b","c"], ", ", "[", "]")\n// "[a, b, c]"\n
\n" }, { "name": "decimal(n, scale)", @@ -273,7 +273,7 @@ }, { "name": "random number()", - "description": "

Camunda Extension

\n

Returns a random number between 0 and 1.

\n

Function signature

\n
random number(): number\n
\n

Examples

\n
random number()\n// 0.9701618132579795\n
\n" + "description": "

Camunda Extension

\n

Returns a random number between 0 and 1.

\n

Function signature

\n
random number(): number\n
\n

Examples

\n
random number()\n// 0.9701618132579795\n
\n" }, { "name": "before(point1, point2)", @@ -445,7 +445,7 @@ }, { "name": "extract(string, pattern)", - "description": "

Camunda Extension

\n

Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn't\nmatch.

\n

Function signature

\n
extract(string: string, pattern: string): list<string>\n
\n

The pattern is a string that contains a regular expression.

\n

Examples

\n
extract("references are 1234, 1256, 1378", "12[0-9]*")\n// ["1234","1256"]\n
\n" + "description": "

Camunda Extension

\n

Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn't\nmatch.

\n

Function signature

\n
extract(string: string, pattern: string): list<string>\n
\n

The pattern is a string that contains a regular expression.

\n

Examples

\n
extract("references are 1234, 1256, 1378", "12[0-9]*")\n// ["1234","1256"]\n
\n" }, { "name": "now()", @@ -477,6 +477,6 @@ }, { "name": "last day of month(date)", - "description": "

Camunda Extension

\n

Takes the month of the given date or date-time value and returns the last day of this month.

\n

Function signature

\n
last day of month(date: date): date\n
\n
last day of month(date: date and time): date\n
\n

Examples

\n
last day of month(date("2022-10-01"))\n// date("2022-10-31"))\n\nlast day of month(date and time("2022-10-16T12:00:00"))\n// date("2022-10-31"))\n
\n" + "description": "

Camunda Extension

\n

Takes the month of the given date or date-time value and returns the last day of this month.

\n

Function signature

\n
last day of month(date: date): date\n
\n
last day of month(date: date and time): date\n
\n

Examples

\n
last day of month(date("2022-10-01"))\n// date("2022-10-31"))\n\nlast day of month(date and time("2022-10-16T12:00:00"))\n// date("2022-10-31"))\n
\n" } ] \ No newline at end of file