Search

Chapter 8. Expression syntax in test scenarios

download PDF

The test scenarios designer supports different expression languages for both rule-based and DMN-based test scenarios. While rule-based test scenarios support a basic expression language, DMN-based test scenarios support the FEEL expression language.

8.1. Expression syntax in rule-based test scenarios

The following rule-based test scenario definition expressions are supported by the test scenarios designer:

Table 8.1. Description of expressions syntax
OperatorDescription

=

Specifies equal to a value. This is default for all columns and is the only operator supported by the GIVEN column.

=, =!, <>

Specifies inequality of a value. This operator can be combined with other operators.

<, >, <=, >=

Specifies a comparison: less than, greater than, less or equals than, and greater or equals than.

[value1, value2, value3]

Specifies a list of values. If one or more values are valid, the scenario definition is evaluated as true.

expression1; expression2; expression3

Specifies a list of expressions. If all expressions are valid, the scenario definition is evaluated as true.

Note

An empty cell is skipped from evaluation. To define an empty string, use =,[], or ;. To define a null value, use null.

Table 8.2. Example expressions
ExpressionDescription

-1

The actual value is equal to -1.

< 0

The actual value is less than 0.

! > 0

The actual value is not greater than 0.

[-1, 0, 1]

The actual value is equal to either -1 or 0 or 1.

<> [1, -1]

The actual value is neither equal to 1 nor -1.

! 100; 0

The actual value is not equal to 100 but is equal to 0.

!= < 0; <> > 1

The actual value is neither less than 0 nor greater than 1.

<> <= 0; >= 1

The actual value is neither less than 0 nor equal to 0 but is greater than or equal to 1.

Note

You can refer to the supported commands and syntax in the Scenario Cheatsheet tab on the right of the rule-based test scenarios designer.

8.2. Expression syntax in DMN-based scenarios

The following data types are supported by the DMN-based test scenarios in the test scenarios designer:

Table 8.3. Data types supported by DMN-based scenarios
Supported data typesDescription

numbers & strings

Strings must be delimited by quotation marks, for example, "John Doe", "Brno" or "".

boolean values

true, false, and null.

dates and time

For example, date("2019-05-13") or time("14:10:00+02:00").

functions

 

contexts

For example, {x : 5, y : 3}.

ranges and lists

For example, [1 .. 10] or [2, 3, 4, 5].

Note

You can refer to the supported commands and syntax in the Scenario Cheatsheet tab on the right of the DMN-based test scenarios designer.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.