4.3.2. Built-in functions in FEEL


To promote interoperability with other platforms and systems, Friendly Enough Expression Language (FEEL) includes a library of built-in functions. The built-in FEEL functions are implemented in the Drools Decision Model and Notation (DMN) engine so that you can use the functions in your DMN decision services.

The following sections describe each built-in FEEL function, listed in the format NAME( PARAMETERS ). For more information about FEEL functions in DMN, see the OMG Decision Model and Notation specification.

4.3.2.1. Conversion functions

The following functions support conversion between values of different types. Some of these functions use specific string formats, such as the following examples:

  • date string: Follows the format defined in the XML Schema Part 2: Datatypes document, such as 2020-06-01
  • time string: Follows one of the following formats:

    • Format defined in the XML Schema Part 2: Datatypes document, such as 23:59:00z
    • Format for a local time defined by ISO 8601 followed by @ and an IANA Timezone, such as 00:01:00@Etc/UTC
  • date time string: Follows the format of a date string followed by T and a time string, such as 2012-12-25T11:00:00Z
  • duration string: Follows the format of days and time duration and years and months duration defined in the XQuery 1.0 and XPath 2.0 Data Model, such as P1Y2M
date( from ) - using date

Converts from to a date value.

Expand
表4.3 Parameters
ParameterTypeFormat

from

string

date string

Example

date( "2012-12-25" ) - date( "2012-12-24" ) = duration( "P1D" )

date( from ) - using date and time

Converts from to a date value and sets time components to null.

Expand
表4.4 Parameters
ParameterType

from

date and time

Example

date(date and time( "2012-12-25T11:00:00Z" )) = date( "2012-12-25" )

date( year, month, day )

Produces a date from the specified year, month, and day values.

Expand
表4.5 Parameters
ParameterType

year

number

month

number

day

number

Example

date( 2012, 12, 25 ) = date( "2012-12-25" )

date and time( date, time )

Produces a date and time from the specified date and ignores any time components and the specified time.

Expand
表4.6 Parameters
ParameterType

date

date or date and time

time

time

Example

date and time ( "2012-12-24T23:59:00" ) = date and time(date( "2012-12-24" ), time( "23:59:00" ))

date and time( from )

Produces a date and time from the specified string.

Expand
表4.7 Parameters
ParameterTypeFormat

from

string

date time string

Example

date and time( "2012-12-24T23:59:00" ) + duration( "PT1M" ) = date and time( "2012-12-25T00:00:00" )

time( from )

Produces a time from the specified string.

Expand
表4.8 Parameters
ParameterTypeFormat

from

string

time string

Example

time( "23:59:00z" ) + duration( "PT2M" ) = time( "00:01:00@Etc/UTC" )

time( from )

Produces a time from the specified parameter and ignores any date components.

Expand
表4.9 Parameters
ParameterType

from

time or date and time

Example

time(date and time( "2012-12-25T11:00:00Z" )) = time( "11:00:00Z" )

time( hour, minute, second, offset? )

Produces a time from the specified hour, minute, and second component values.

Expand
表4.10 Parameters
ParameterType

hour

number

minute

number

second

number

offset (Optional)

days and time duration or null

Example

time( "23:59:00z" ) = time(23, 59, 0, duration( "PT0H" ))

number( from, grouping separator, decimal separator )

Converts from to a number using the specified separators.

Expand
表4.11 Parameters
ParameterType

from

string representing a valid number

grouping separator

Space ( ), comma (,), period (.), or null

decimal separator

Same types as grouping separator, but the values cannot match

Example

number( "1 000,0", " ", "," ) = number( "1,000.0", ",", "." )

string( from )

Provides a string representation of the specified parameter.

Expand
表4.12 Parameters
ParameterType

from

Non-null value

Examples

string( 1.1 ) = "1.1"
string( null ) = null

duration( from )

Converts from to a days and time duration value or years and months duration value.

Expand
表4.13 Parameters
ParameterTypeFormat

from

string

duration string

Examples

date and time( "2012-12-24T23:59:00" ) - date and time( "2012-12-22T03:45:00" ) = duration( "P2DT20H14M" )
duration( "P2Y2M" ) = duration( "P26M" )

years and months duration( from, to )

Calculates the years and months duration between the two specified parameters.

Expand
表4.14 Parameters
ParameterType

from

date or date and time

to

date or date and time

Example

years and months duration( date( "2011-12-22" ), date( "2013-08-24" ) ) = duration( "P1Y8M" )

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る