How is your experience with the OutSystems Community?
expression-editor-pro
Reactive icon

Expression Editor Pro

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 25 Nov (2 days ago)
 by 
0.0
 (0 ratings)
expression-editor-pro

Expression Editor Pro

Details
Expression Editor Pro is a reusable Web Block that lets users build mathematical and business expressions from predefined inputs, rate tables, operators and numeric constants. It provides autocomplete, colour-coded tokens, inline error underlining and real-time validation of brackets, items, syntax and operator precedence. Expressions are stored as plain text and can be exported as a JSON expression tree for backend calculation. Built with CodeMirror 5.
Read more

Expression Editor Pro is a reusable Reactive Web block for building mathematical and business expressions without hand-typing everything. Users compose formulas from predefined inputs, rate tables, operators and numeric constants. Typing is fully supported, with autocomplete and live validation. It was designed for rating and pricing scenarios, such as insurance premium formulas, but works for any calculation rule.

Key features

Editor

  • Advanced text editor built on CodeMirror 5, not the standard OutSystems Input widget
  • Type directly, or click inputs, rate tables, operators and numbers to insert them at the cursor
  • Selection replace, Backspace and Delete, Undo, Redo and Clear
  • Colour-coded tokens: inputs, rate tables, numbers, operators and brackets each have their own style

Autocomplete

  • Suggestions appear near the cursor as you type and are filtered by what you have typed
  • Up/Down to navigate, Enter or Tab to select, Esc to close, or click a suggestion
  • Selecting a suggestion replaces only the identifier being typed and keeps the rest of the formula
  • Works for both inputs and rate tables
  • You can keep typing without selecting anything

Validation

  • Red wavy underline only on the invalid identifier, never on the whole formula
  • A partially typed identifier is not flagged while you are still typing it
  • Separate indicators for "Brackets match", "Every item exists" and "Formula syntax is valid"
  • "Formula valid" / "Formula invalid" badge with clear messages
  • Detects:
    • empty formulas
    • unknown or disallowed identifiers (with a "Did you mean…" hint for wrong case)
    • consecutive operators
    • missing operands or operators
    • unbalanced or empty brackets
    • unexpected characters
  • Correct operator precedence, so A + B × C is read as A + (B × C)


Supported syntax

Expression  = Term (( + | - ) Term)*
Term        = Factor (( × | ÷ ) Factor)*
Factor      = Number | Identifier | ( Expression )

* and / are accepted and normalised to × and ÷. Identifiers are case-sensitive and may contain letters, digits and underscores.


Limitations

  • Unary minus (for example A × -5) is not supported, in line with the "consecutive operators are invalid" rule
  • Validation runs on the client. Re-validate the stored formula on the server before using it in calculations
Release notes (1.0.0)
License (1.0.0)
Reviews (0)
Team
Other assets in this category