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

Type reference

DevNote generate the rest.

Type reference

Any

Is primitive: n/a

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.

Table 1. Initialization patterns:
Expression Value/result Notes

v

null

Initializes the variable with the value of null.

v = "test"

"test"

Initializes the variable with the string value of test.

v = 42

42

Initializes the variable with the integer value of 42.

Vars

Is primitive: no

Identical to KV but used for complex structures.

Table 2. Initialization patterns:
Expression Value/result Notes

v

{}

Initializes a vars variable without value, defaults to empty ({}).

v = { "key": "value" }

{ "key": "value" }

Initializes a vars variable with the property key with value of value.

v = { "key": { "key": "value" } }

{ "key": { "key": "value" } }

Initializes a vars variable with the property key with value of a nested vars variable with the property key with value of value.

Boolean

Is primitive: yes

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

Table 3. Initialization patterns:
Expression Value/result Notes

v

false

Initializes boolean variable without value, defaults to false.

v = true

true

Initializes boolean variable with an boolean value.

v = "true"

true

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

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

v = 10 == 0

true

Initializes boolean variable as result of an expression.

DateTime

Is primitive: yes

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

Table 4. Initialization patterns:
Expression Value/result Notes

v

ERROR

DateTime initialization requires a non-null value.

v = "2022-01-17T07:32:30Z"

"2022-01-17T07:32:30Z"

Initializes a DateTime variable to the given ISO 8601 timestamp.

v = 1642414876

"2022-01-17T11:21:16"

Initializes a DateTime variable to the given unix timestamp.

When initializing DateTime variables with unix timestamps inside workflows, you will need an intermediate variable for the unix timestamp value.

Duration

Is primitive: yes

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

Table 5. Initialization patterns:
Expression Value/result Notes

v

ERROR

Duration initialization requires a non-null value

v = "1m"

1m0s

Initializes a Duration variable to be 1 minute.

v = "3h"

3h0m0s

Initializes a Duration variable to be 3 hours.

Float

Is primitive: yes

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

Table 6. Initialization patterns:
Expression Value/result Notes

v

0

Initializes a float variable without value, defaults to 0.

v = 4.2

4.2

Initializes a float variable with a float value.

v = "4.2"

"4.2"

Initializes a float variable with a string value.

v = "four.two"

ERROR

Initializes a float variable with an invalid string value.

Integer

Is primitive: yes

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

Table 7. Initialization patterns:
Expression Value/result Notes

v (Integer)

0

Initializes an integer variable without value, defaults to 0.

v (Integer) = 42

42

Initializes an integer variable with an integer value.

v (Integer) = 3.14

3

Initializes an integer variable with a float will cut of the decimals.

v (Integer) = "42"

42

Initializes an 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 results in an error.

UnsignedInteger

Is primitive: yes

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

Table 8. Initialization patterns:
Expression Value/result Notes

v (Integer)

0

Initializes an unsigned integer variable without value, defaults to 0.

v (Integer) = 42

42

Initializes an unsigned integer variable with an integer value.

v (Integer) = 3.14

3

Initializes an unsigned integer variable with a float will cut of the decimals.

v (Integer) = "42"

42

Initializes an unsigned 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 results in an error.

String

Is primitive: yes

A String variable contains a text (a string).

If the initialization value is a non-null, non-string value; if defined; the value is casted to a string.

DevNote provide a complete list for this.

Table 9. Initialization patterns:
Expression Value/result Notes

v

""

Initializes a string variable without value, defaults to empty string ("").

v = "Hi"

"Hi"

Initializes a string variable with a string value.

v = 10

"10"

Initializes a string variable with an integer value.

ID

Is primitive: yes

An ID is a unique system assigned identifier for all system resources. While it can be assigned or manipulated manually, the system normally either ignores the modifications or errors them out.

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

Handle

Is primitive: yes

A Handle is a user-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]$/.

Table 10. Initialization patterns:
Expression Value/result Notes

v

0

Initializes a handle variable without value, defaults to empty ("").

v = "transaction"

"transaction"

Initializes a handle variable with a string value.

v = "invalid handle"

ERROR

Initializes a handle variable with an invalid string value.

Array

Is primitive: no

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

Table 11. Initialization patterns:
Expression Value/result Notes

v

[]

Initializes an array variable without value, defaults to empty ([]).

v = [1, 2, 3]

[1, 2, 3]

Initializes an array variable with a list of integers.

Reader

Is primitive: 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.

Table 12. Initialization patterns:
Expression Value/result Notes

v

ERROR

Reader initialization requires a non-nil value.

v = "Test"

Reader("Test")

Initializes a reader variable from the string.

KV

Is primitive: no

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

Table 13. Initialization patterns:
Expression Value/result Notes

v

{}

Initializes a kv variable without value, defaults to empty ({}).

v = { "key": "value" }

{ "key": "value" }

Initializes a kv variable to the given set of keys and values.

KVV

Is primitive: no

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

Table 14. Initialization patterns:
Expression Value/result Notes

v

{}

Initializes a kvv variable without value, defaults to empty ({}).

v = { "key": [ "value 1", "value 2" ] }

{ "key": [ "value 1", "value 2" ] }

Initializes a kvv variable to the given set of keys and values.

Template

Is primitive: no

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

Table 15. Initialization patterns:
Expression Value/result Notes

v

{ …​ }

Initializes a template variable without value, defaults to empty. Refer to the object reference for details.

v = { "handle": "test", "type": "text/html" }

{ …​ "handle": "test", "type": "text/html" …​ }

Initializes a template variable with the given handle and template type. Refer to the object reference for details.

Document

Is primitive: no

A Document is a rendered Template. It uses RenderOptions and RenderVariables in order to produce a document.

A Document is a result of the template render function and should not be constructed manually.

RenderOptions

Is primitive: no

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

Table 16. Initialization patterns:
Expression Value/result Notes

v

{}

Initializes a render options variable without value, defaults to empty ({}).

v = { "marginY": "1" }

{ "marginY": "1" }

Initializes a render options variable to the given object.

EmailMessage

Is primitive: no

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

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

Role

Is primitive: no

A Role contains a system role.

Table 17. Initialization patterns:
Expression Value/result Notes

v

{…​}

Initializes a role variable without value, defaults to empty. Refer to the object reference for details.

v = { "handle": "test_role" }

{…​ "handle": "test_role" …​}

Initializes a role variable with the given handle. Refer to the object reference for details.

User

Is primitive: no

A User contains a system user.

Table 18. Initialization patterns:
Expression Value/result Notes

v

{…​}

Initializes a user variable without value, defaults to empty. Refer to the object reference for details.

v = { "handle": "test_user" }

{…​ "handle": "test_user" …​}

Initializes a user variable with the given handle. Refer to the object reference for details.

ComposeModule

Is primitive: no

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

Table 19. Initialization patterns:
Expression Value/result Notes

v

{…​}

Initializes a module variable without value, defaults to empty. Refer to the object reference for details.

v = { "handle": "test_module" }

{…​ "handle": "test_module" …​}

Initializes a module variable with the given handle. Refer to the object reference for details.

ComposeNamespace

Is primitive: no

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

Table 20. Initialization patterns:
Expression Value/result Notes

v

{…​}

Initializes a namespace variable without value, defaults to empty. Refer to the object reference for details.

v = { "slug": "test_namespace" }

{…​ "slug": "test_namespace" …​}

Initializes a namespace variable with the given handle. Refer to the object reference for details.

ComposeRecord

Is primitive: 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

Is primitive: 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

Attachment

{
   ID (ID)
   kind (String)
   url (Handle)
   previewUrl (Handle)
   name (Handle)
   createdAt (DateTime)
   updatedAt (DateTime)
   deletedAt (DateTime)
}

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)
}

HttpRequest

{
   Method (String)
   URL (Url)
   Header (KVV)
   Body (Reader)
   Form (KVV)
   PostForm (KVV)
}

QueueMessage

{
   Queue (String)
   Payload (Bytes)
}

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)
}

Url

{
   Scheme (String)
   Opaque (String)
   Host (String)
   Path (String)
   RawPath (String)
   ForceQuery (Boolean)
   RawQuery (String)
   Fragment (String)
   RawFragment (String)
}

User

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