Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: apply changes from downstream project #437

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
id: feel-built-in-functions-boolean
title: Boolean Functions
title: Boolean functions
description: "This document outlines current boolean functions and a few examples."
---

## not()

* parameters:
* `negand`: boolean
* result: boolean
- parameters:
- `negand`: boolean
- result: boolean

```js
not(true)
Expand All @@ -16,13 +17,13 @@ not(true)

## is defined()

Checks if a given value is defined or not. A value is defined if it exists, and it is an instance of one of the FEEL data types including `null`.
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`.

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 variable that is `null` and a value that doesn't exist.
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.

* parameters:
* `value`: any
* result: boolean
- parameters:
- `value`: any
- result: boolean

```js
is defined(1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
id: feel-built-in-functions-context
title: Context Functions
title: Context functions
description: "This document outlines context functions and a few examples."
---

## get value()

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

* parameters:
* `context`: context
* `key`: string
* result: any
- parameters:
- `context`: context
- `key`: string
- result: any

```js
get value({foo: 123}, "foo")
Expand All @@ -19,11 +20,11 @@ get value({foo: 123}, "foo")

## get entries()

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

* parameters:
* `context`: context
* result: list of context which contains two entries for "key" and "value"
- parameters:
- `context`: context
- result: list of context which contains two entries for "key" and "value"

```js
get entries({foo: 123})
Expand All @@ -32,15 +33,15 @@ get entries({foo: 123})

## put()

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.
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.

Returns `null` if the value is not defined.

* parameters:
* `context`: context
* `key`: string
* `value`: any
* result: context
- parameters:
- `context`: context
- `key`: string
- `value`: any
- result: context

```js
put({x:1}, "y", 2)
Expand All @@ -49,13 +50,13 @@ put({x:1}, "y", 2)

## put all()

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.
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.

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

* parameters:
* `contexts`: contexts as varargs
* result: context
- parameters:
- `contexts`: contexts as varargs
- result: context

```js
put all({x:1}, {y:2})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
id: feel-built-in-functions-conversion
title: Conversion Functions
title: Conversion functions
description: "This document outlines conversion functions and a few examples."
---

Convert a value into a different type.

## date()

* parameters:
* `from`: string / date-time
* or `year`, `month`, `day`: number
* result: date
- parameters:
- `from`: string / date-time
- or `year`, `month`, `day`: number
- result: date

```js
date(birthday)
Expand All @@ -25,11 +26,11 @@ date(2012, 12, 25)

## time()

* parameters:
* `from`: string / date-time
* or `hour`, `minute`, `second`: number
* (optional) `offset`: day-time-duration
* result: time
- parameters:
- `from`: string / date-time
- or `hour`, `minute`, `second`: number
- (optional) `offset`: day-time-duration
- result: time

```js
time(lunchTime)
Expand All @@ -47,11 +48,11 @@ time(14, 30, 0, duration("PT1H"))

## date and time()

* parameters:
* `date`: date / date-time
* `time`: time
* or `from`: string
* result: date-time
- parameters:
- `date`: date / date-time
- `time`: time
- or `from`: string
- result: date-time

```js
date and time(date("2012-12-24"),time("T23:59:00"))
Expand All @@ -66,9 +67,9 @@ date and time(birthday)

## duration()

* parameters:
* `from`: string
* result: day-time-duration or year-month-duration
- parameters:
- `from`: string
- result: day-time-duration or year-month-duration

```js
duration(weekDays)
Expand All @@ -80,10 +81,10 @@ duration(age)

## years and months duration()

* parameters:
* `from`: date
* `to`: date
* result: year-month-duration
- parameters:
- `from`: date
- `to`: date
- result: year-month-duration

```js
years and months duration(date("2011-12-22"), date("2013-08-24"))
Expand All @@ -92,9 +93,9 @@ years and months duration(date("2011-12-22"), date("2013-08-24"))

## number()

* parameters:
* `from`: string
* result: number
- parameters:
- `from`: string
- result: number

```js
number("1500.5")
Expand All @@ -103,9 +104,9 @@ number("1500.5")

## string()

* parameters:
* `from`: any
* result: string
- parameters:
- `from`: any
- result: string

```js
string(1.1)
Expand All @@ -121,13 +122,13 @@ Constructs a context of the given list of key-value pairs. It is the reverse fun

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`.

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.
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.

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

* parameters:
* `entries`: list of contexts
* result: context
- parameters:
- `entries`: list of contexts
- result: context

```js
context([{"key":"a", "value":1}, {"key":"b", "value":2}])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
id: feel-built-in-functions-introduction
title: Introduction
description: "FEEL includes many built-in functions. These functions can be invoked
in expressions and unary-tests."
---

FEEL includes a lot of built-in functions. These functions can be invoked
FEEL includes many built-in functions. These functions can be invoked
in [expressions](../language-guide/feel-expressions-introduction.md)
and [unary-tests](../language-guide/feel-unary-tests.md).

Expand All @@ -17,15 +19,15 @@ contains(string: "me@camunda.com", match: ".de")

Read more about functions [here](../language-guide/feel-functions.md#invocation).

For a better overview, this section is split into functions based on their primary operational data type:
This section is split into functions based on their primary operational data type:

* [Boolean](./feel-built-in-functions-boolean.md)
* [String](./feel-built-in-functions-string.md)
* [Numeric](./feel-built-in-functions-numeric.md)
* [List](./feel-built-in-functions-list.md)
* [Context](./feel-built-in-functions-context.md)
* [Temporal](./feel-built-in-functions-temporal.md)
* [Range](./feel-built-in-functions-range.md)
- [Boolean](./feel-built-in-functions-boolean.md)
- [String](./feel-built-in-functions-string.md)
- [Numeric](./feel-built-in-functions-numeric.md)
- [List](./feel-built-in-functions-list.md)
- [Context](./feel-built-in-functions-context.md)
- [Temporal](./feel-built-in-functions-temporal.md)
- [Range](./feel-built-in-functions-range.md)

Additionally, there are [conversion](./feel-built-in-functions-conversion.md) functions that allows
to construct new values of a data type (aka factory functions).
Additionally, there are [conversion](./feel-built-in-functions-conversion.md) functions that allow
you to construct new values of a data type (factory functions).