📖
Rulecube documentation
v2.4
v2.4
  • Overview
  • Quick Start
  • Tutorial
    • Getting started
    • Create and Run Your First Ruleset
    • Use Constants and Methods
    • Create and Call Functions
    • Adding Testcases
    • Using Lookup Tables
    • Using Entities
    • Using Forms
  • How-to Guides
    • Logging in and Authorization
      • Activate Your Account From an Invitation
      • Log in to Rulecube
      • Change Your Password
      • Recover Your Password
      • Two-factor authentication (2FA)
      • Invite Other Users to Rulecube
      • Edit a User's Role
      • Delete a User
    • Ruleset Development
      • Create a Ruleset
      • Set the Input for a Ruleset
      • Create a Rule
      • Generate Alerts
      • Try out a Ruleset
      • Call a Ruleset from Your Software
      • Entities
        • Create an Entity
        • Drag and Drop a JSON Schema or XSD to create entities
        • Entity instantiation
        • Persisted Entities
      • Constants
        • Constant Tables
      • Functions
      • Built-in Functions
      • Create and Run a Testcase
      • Delete a Ruleset or Components
      • Debugging your Ruleset
    • Create a Workflow
      • Workflow step types
      • Working with documents in a workflow
    • Work with (Environment) Variables
    • Call a Ruleset via Its API From Postman
    • Creating input from JSON Schema
    • Use a Ruleset from Your Software
    • Ruleset Productivity Tips
    • Create an Ockto workflow
    • Alert aggregation
    • Forms
      • Introduction and overview
      • Create a Data table
  • Language Reference
    • Global
    • Array
    • Compression
    • Crypto
    • Date
    • Encryption (deprecated)
    • Finance
    • Http
    • Mail
    • MongoDB
    • Ockto
    • PDF
    • SQL
    • Statistics
    • System
    • UserStore
    • Workflow
Powered by GitBook
On this page
  • Introduction
  • Procedure
  • Additional resources
  1. How-to Guides
  2. Ruleset Development

Built-in Functions

PreviousFunctionsNextCreate and Run a Testcase

Introduction

This guide explains what built-in functions there are in Rulecube and how to use them.

Rulecube has many built-in functions ready to use for you and grouped them into these categories:

  • Global

  • Finance

  • HTTP

  • Mail

  • MongoDB

  • SQL

  • Statistics

  • Workflow

  • System

  • Array

  • Date

For example, in the Finance group, you have the pv function for calculating the present value of a loan or investment. And in the Statistics group, you'll find the mean and median functions.

To discover what's available, the best way is to click on the icon and then on "Documentation". This will open the Rulecube Manual.

Alternatively you can access this Manual from any code editor, like when editing a Rule:

Procedure

Let's say you want to calculate the VAT amount from an amount that includes the VAT. The resulting VAT amount can have several decimal places, but for a neat presentation, you want to limit the decimal places to two. Rulecube has the ROUND function for this:

  1. Create a ruleset named VAT_calculator.

  2. Create an input named AmountIncludingVAT and set its Type to number.

  3. Create a rule named ExtractVAT and set its Type to number and the Expression to:

    ROUND(AmountIncludingVAT / 121 * 21, 2)

  4. Click Save and click Try it out to test the ruleset.

Additional resources

Language (Methods) Reference
Clicking the "Rulecube manual" link will open the Manual in a new window.