Opadeez Help Center

Opadeez Scripting Language

Overview

Opadeez Scripting Language has been designed to be as easy as possible to access the solution data model, implement loops and advance logic. The language provides powerful capabilities for data manipulation, calculations, and business logic implementation.

Script Helper

Where Opadeez lets user write script, there is a gear icon to open the script helper. The Script Helper provides three main categories of assistance:

Script Helper Dictionary

Script Helper Dictionary - Access to data model entities and attributes

Script Helper Functions

Script Helper Functions - Complete list of available functions with syntax

Script Helper Keywords

Script Helper Keywords - Language keywords and control structures

Usage Areas

Scripts can be used in different areas of a solution:

Attribute Formulas

Used to define calculated fields (Refer to Entities & Attributes for details). For Attribute formulas you should provide either:

Visibility, Mandatory and Read-only Rules

Refer to Data Set Attributes Rules for details. Similarly to Attribute formulas, these rules should be either a single expression or a program with a return statement.

Scripts

Refer to Scripts for details. In this case, the script should be a Program.

Decision Matrices and Decision Trees

Used in Decision Matrix and Decision Tree for rule evaluation.

Important: Keywords, variable names and function names are case sensitive.

General Syntax

Expressions vs Programs

Instructions

Comments

Data Types and Literals

Literal Values

Supported Data Types

Note: Variables are not strongly typed and can store objects of different types at different moments.

Operators

Comparison Operators

Boolean Operators

Arithmetical Operators

Assignment Operator

Control Structures

IF Statement

IF condition THEN 
  program 
ELSEIF condition THEN
  program 
ELSE 
  program 
END IF

Example:

IF A > 0 THEN
  A = 123
ELSEIF B > 0 THEN
  A = 789
ELSE
  A = 456
END IF

FOR Loop

FOR variable IN array 
  program 
NEXT

Example:

FOR account IN Customer.Account
  A = A + account.Balance
NEXT

Variables

Variable Declaration

Variables are created using the declare keyword:

declare A
A = 123

Variable Naming

Functions

Date Functions

String Functions

Numeric Functions

Utility Functions

System Functions

NULL Values

NULL values are handled gracefully in the system. Performing operations on operands having NULL values will not raise an error, however the overall expression will return null.

Example: 1 + 2 + NULL will return NULL

Data Dictionary Access

Context-Dependent Access

Alias Syntax

Looping Through Multiple Occurrences

declare product, payment, sumAmount
sumAmount = 0
// Browse products
FOR product IN Product
  // Browse payments for each product
  FOR payment IN product.Payment
    sumAmount = sumAmount + payment.amount
  NEXT
NEXT

Data Link Attributes

Access linked entity attributes using Alias.attribute syntax. Special link attributes are automatically created for each link with the name: link<EntityFromName><LinkName>

Best Practices

Script Writing

Performance

Debugging

Related Topics

Pro Tip: Always use the Script Helper (gear icon) when writing scripts. It provides instant access to your data model, available functions, and proper syntax examples.