You are reading the documentation for an outdated Corteza release. 2023.9 is the latest stable Corteza release.

Data types

All of the data inside a workflow is typed in order to provide a robust development environment.

Type reference

Certain variable types can not be initialized directly by expressions, but need to be initialized by a function.

Type Primitive Description

Any

A variable of type Any does not perform any type checks and can store anything. The use of this is not recommended, but it can be used.

Vars

No

Like KV but for complex structures.

Boolean

Yes

A Boolean indicates wether a variable is truthy (true) or faulty (false).

DateTime

Yes

A DateTime contains an absolute temporal value. A DateTime can easily be manipulated using date-time functions.

Duration

Yes

A Duration contains a relative temporal value. A Duration is usually used in combination with DateTime values to calculate offsets.

Float

Yes

A Float is a 64bit floating point number following the IEEE 754 standard.

Integer

Yes

An Integer is a 64bit signed integer; range -9223372036854775808 through 9223372036854775807.

UnsignedInteger

Yes

An UnsignedInteger is a 64bit unsigned integer; range 0 through 18446744073709551615.

String

Yes

A String is a string.

ID

Yes

An ID is a system assigned unique identifier for all system resources and should not be assigned or manipulated manually. An ID is a 64bit unsigned integer; range 0 through 18446744073709551615.

Handle

Yes

A Handle is a human-friendly resource identifier. Most Corteza resources (such as namespaces and modules) allow you to define a unique identifier that can be used instead of its system assigned ID.

The value must be an empty string or a string matching the following regular expression /^[A-Za-z][0-9A-Za-z_\-.]*[A-Za-z0-9]$/.

Array

No

An Array contains a list of items, such as a list of users, records or modules.

Reader

No

A Reader represents a data stream (such as a file or a blob) that can be read or iterated over using the stream iterator.

A Reader can only be read once. If you need to use it multiple times you will need to cache the initial output.

KV

No

A KV is a hashmap that maps String values to String keys.

KVV

No

A KVV is a hashmap that maps a set of String values to String keys.

Template

No

A Template contains a template that can be used by the rendering engine.

Document

No

A Document is a rendered Template using RenderOptions and RenderVariables.

RenderOptions

No

RenderOptions define how a Template should be rendered into a Document.

RenderVariables

No

RenderVariables define what data the Template can use to produce a Document.

EmailMessage

No

An EmailMessage represents an email that will be sent to the recipients. The EmailMessage type should not be constructed or interacted with directly. Use the predefined functions to manipulate it’s contents.

A new EmailMessage must be initialized using the Email builder function.

Role

No

A Role contains a system role.

User

No

A User contains a system user.

ComposeModule

No

A ComposeModule contains a Low Code module. The ComposeModule type is mostly used when updating module fields or creating new records.

ComposeNamespace

No

A ComposeNamespace contains a Low Code namespace. The ComposeNamespace type is mostly used when interacting with namespace specific Low Code resources.

ComposeRecord

No

A ComposeRecords contains a Low Code record. The ComposeRecords type is mostly used when interacting with Low Code records, such as changing their values or converting them into email notifications.

A new ComposeRecord must be initialized using the Compose record maker function.

ComposeRecordValues

No

A ComposeRecordValues contains a set of Corteza record values. This type is usually not used on it’s own but in the combination with ComposeRecord.

Object reference

Type Structure

ComposeModule

{
   ID (ID)
   namespaceID (ID)
   name (String)
   handle (Handle)
   labels (KV)
   createdAt (DateTime)
   updatedAt (DateTime)
   deletedAt (DateTime)
}

ComposeNamespace

{
   ID (ID)
   name (String)
   slug (Handle)
   labels (KV)
   createdAt (DateTime)
   updatedAt (DateTime)
   deletedAt (DateTime)
}

ComposeRecord

{
   ID (ID)
   moduleID (ID)
   namespaceID (ID)
   values (ComposeRecordValues)
   labels (KV)
   ownedBy (ID)
   createdAt (DateTime)
   createdBy (ID)
   updatedAt (DateTime)
   updatedBy (ID)
   deletedAt (DateTime)
   deletedBy (ID)
}

RenderedDocument

{
   document (Reader)
   name (string)
   type (string)
}

Role

{
   ID (ID)
   name (String)
   handle (Handle)
   labels (KV)
   createdAt (DateTime)
   updatedAt (DateTime)
   archivedAt (DateTime)
   deletedAt (DateTime)
}

Template

{
   ID (ID)
   handle (Handle)
   language (String)
   type (DocumentType)
   partial (Boolean)
   meta (TemplateMeta)
   template (String)
   labels (KV)
   ownerID (ID)
   createdAt (DateTime)
   updatedAt (DateTime)
   deletedAt (DateTime)
   lastUsedAt (DateTime)
}

TemplateMeta

{
   short (String)
   description (String)
}

User

{
   ID (ID)
   username (String)
   email (String)
   name (String)
   handle (Handle)
   emailConfirmed (Boolean)
   labels (KV)
   createdAt (DateTime)
   updatedAt (DateTime)
   suspendedAt (DateTime)
   deletedAt (DateTime)
}

Initialization patterns

Table 1. Integer initialization patterns:
Expression Value/result Notes

v (Integer)

0

Initializing integer variable without value, defaults to 0.

v (Integer) = 42

42

Initializing integer variable with an integer value.

v (Integer) = 3.14

3

Initializing integer variable with a float will cut of the decimals.

v (Integer) = "42"

42

Initializing integer variable with a string that contains a valid integer.

v (Integer) = "forty two"

ERROR

Initializing integer variable with a string that contains a invalid integer will result in an error.

Table 2. Boolean initialization patterns:
Expression Value/result Notes

v (Bool)

false

Initializing boolean variable without value, defaults to false.

v (Boolean) = true

true

Initializing boolean variable with an boolean value.

v (Boolean) = "true"

true

Parsing string values:
  • "1", `"t", `"T", `"true", `"TRUE", `"True" result as `true

  • "0", `"f", `"F", `"false", `"FALSE", `"False" result as `false

v (Boolean) = 10 == 0

true

Initializing boolean variable as result of an expression.