Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Using Set Expressions

Introduction

There are two primary ways of setting a Gloop property's value:

The examples package shows how set expressions are used in Gloop services via example services under the setExpression code directory. Listed below are the services and their descriptions:

Service Name Description
BasicSetExpression.gloop Demonstrates the use of unevaluated set expressions.
BCryptHashing.gloop Demonstrates how to use import statements in set expressions.
DatabaseLookup.gloop Demonstrates how the properties of a model are set via set expressions that query the database.
GloopModelSetExpression.gloop Demonstrates how to set a value of a Gloop model via set expressions.

Related articles

Please see the following articles for more information:

Try It!

In the examples package that is already installed in your TORO Integrate instance, navigate to code folder, and look for a directory called setExpression. This directory has a conf folder that has a startup service and four Gloop services that demonstrate the use of set expressions, shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
examples
├── ...
└── code
    └── ...
    └── dataTransformation
        ├── conf
        │   └── SetExpressionSetup.gloop
        ├── BasicSetExpression.gloop
        ├── BCryptHashing.gloop
        ├── DatabaseLookup.gloop
        └── GloopModelSetExpression.gloop

Simply open and run these services to inspect their contents and see how they work.

How It Works...

Map lines work best for simple property value mappings. However, for more complex value mappings, set expressions are more ideal. You can use set expressions to assign a default value, or to use Groovy to compute the value for you.