2/4

isBetween: an inclusive quantity rule

Easy

An order line accepts a quantity from 10 to 20, both included. Return true when ri!quantity is allowed.

a!isBetween() is banned here, and that is the lesson: its range excludes both limits, so it cannot express this rule. Write the comparisons out.

Input

  • ri!quantity — Number (Integer)

Restrictions

Solve this without using a!isBetween().

ri! Rule Inputs

ri!quantityNumber (Integer)
10

Example 1 — The lowest allowed quantity

Input: ri!quantity
10
Output:
true

Example 2 — The highest allowed quantity

Input: ri!quantity
20
Output:
true

Example 3 — In the middle

Input: ri!quantity
15
Output:
true

Example 4 — One below

Input: ri!quantity
9
Output:
false

Example 5 — One above

Input: ri!quantity
21
Output:
false

Appian Expression Tips

  • • Use ri!variableName for rule inputs
  • • Use a!localVariables(local!x: …, body) for locals
  • • Use a!forEach(items: …, expression: fv!item) to iterate
  • • Use where() / reject(fn!isnull, list) to filter