assignToGroup ( record: Record , groupRef: Group, String, privilege: Privilege, String)

Assigns a privilege on a particular model to a Group

Parameters
Name Type Description
record Record
groupRef Group, String
privilege Privilege, String
Context: serversideApplication
Tags: standard

assignToRole ( item: Record, Model, roleRef: String/Role-ID, privilege: Privilege, String)

Assigns a privilege on a particular model to a Role

Parameters
Name Type Description
item Record, Model
roleRef String/Role-ID
privilege Privilege, String
Context: serversideApplication
Tags: standard

assignToUser ( record: Record , userRef: Record,User, String, privilege: Privilege, String)

Assigns a privilege on a particular model to a User

Parameters
Name Type Description
record Record
userRef Record,User, String
privilege Privilege, String
Context: serversideApplication
Tags: standard

begin ( )

Initiate a database transaction. Always follow by doing a commit or a rollback.

Context: serversideRuntime
Tags: standard

clearData ( key: String) { Object }

Parameters
Name Type Description
key String
Context: serversideDevice

commit ( )

Commits a database transaction

Context: serversideRuntime
Tags: standard

create ( object: Record, Object, options: Object) { Record }

Creates a Record in the database. Should be done within the context of a transaction.

Parameters
Name Type Description
object Record, Object
options Object
Context: serversideApplication
Tags: standard

create ( object: Object) { Promise }

Parameters
Name Type Description
object Object
Context: serversideDevice

createAnonymousAccessURL ( email: String, ui: String, view: String, id: Object, options: Object) { String }

Creates a URL providing unauthenticated access to a particular view. Note that the view must be part of a UI that is marked as public.

Parameters
Name Type Description
email String
ui String
view String
id Object
options Object
Context: serversideRuntime
Tags: basic

createAs ( object: Record, Object, user: User , options: Object) { Record }

Creates a Record in the database as a given User. Should be done within the context of a transaction.

Parameters
Name Type Description
object Record, Object
user User
options Object
Context: serversideApplication
Tags: standard

createEmailAddress ( key: String) { String }

Creates an email address that routes to this application

Parameters
Name Type Description
key String
Context: serversideRuntime
Tags: standard

createFile ( source: Object, options: Map) { File }

Creates file using source object, context-type and filename

Parameters
Name Type Description
source Object
options Map
Context: serversideRuntime
Tags: basic

createJWT ( header: Map, payload: Map, keys: Map) { String }

Generates a custom JWT

Parameters
Name Type Description
header Map
payload Map
keys Map
Context: serversideRuntime
Tags: basic

createPromise ( ) { Promise }

Context: serversideRuntime
Tags: basic

createRecord ( modelName: String/Model-ID, data: Object, binary: Object) { Record }

Creates a Record given the name of a Model and a map of attribute-values. Note that this does not create a Record in the database, it just creates a Record-object that can be passed to database-operations.

Parameters
Name Type Description
modelName String/Model-ID
data Object
binary Object
Context: serversideRuntime
Tags: basic

createRecordSet ( name: String, data: Object) { RecordSet }

Creates a RecordSet out of an array or an object of named arrays.

Parameters
Name Type Description
name String
data Object
Context: serversideRuntime
Tags: standard

delete ( model: String/ID, idStr: String)

Deletes a Record from the database. Should be done within the context of a transaction.

Parameters
Name Type Description
model String/ID
idStr String
Context: serversideApplication
Tags: standard

delete ( object: Object, options: Map)

Deletes a Record from the database. Should be done within the context of a transaction.

Parameters
Name Type Description
object Object
options Map
Context: serversideApplication
Tags: standard

deleteAs ( object: Object, user: User , options: Map)

Deletes a Record from the database as a given User. Should be done within the context of a transaction.

Parameters
Name Type Description
object Object
user User
options Map
Context: serversideApplication
Tags: standard

executeQuery ( name: String/Query-ID, args: Object) { QueryResult }

Gets the results of the specified query

Parameters
Name Type Description
name String/Query-ID
args Object
Context: serversideRuntime
Tags: standard

executeTemplate ( options: Map) { String }

Executes a template given a set of parameters

Parameters
Name Type Description
options Map
Properties
Name Type Description
template String
templateString String
data Object
Context: serversideApplication
Tags: standard

fail ( error: String)

TODO

Parameters
Name Type Description
error String
Context: serversideRuntime
Tags: basic

get ( model: String/Model-ID, idStr: String, options: Object) { Record }

Get a single Record from the database given its ID.

Parameters
Name Type Description
model String/Model-ID
idStr String
options Object
Context: serversideApplication
Tags: standard

get ( modelObj: Object, idObj: Object) { Promise }

Parameters
Name Type Description
modelObj Object
idObj Object
Context: serversideDevice

getAndClearData ( key: String) { Object }

Parameters
Name Type Description
key String
Context: serversideDevice

getAppConfig ( ) { Map }

Gets the application-configuration for the current Tenant

Context: serversideRuntime
Tags: basic

getAppliance ( ) { Appliance }

Context: serversideDevice

getApplianceId ( ) { Object }

Gets the ID of the appliance that the code is running on

Context: serversideRuntime
Tags: basic

getAs ( model: Object, idStr: Object, user: User , options: Map) { Record }

Get a single Record from the database as a given User given its ID.

Parameters
Name Type Description
model Object
idStr Object
user User
options Map
Context: serversideApplication
Tags: standard

getConfig ( ) { Config }

Context: serversideRuntime
Tags: integration

getConfigParam ( name: String/ConfigParam-ID) { ConfigParam }

Returns a configuration parameter using the specified name, or null if no such parameter exists.

Parameters
Name Type Description
name String/ConfigParam-ID
Context: serversideApplication
Tags: basic

getCredentials ( ) { Config }

Context: serversideRuntime
Tags: integration

getData ( key: String, defaultValue: Object) { Object }

Parameters
Name Type Description
key String
defaultValue Object
Context: serversideRuntime
Tags: basic

getDataFunctions ( ) { DataFunctions }

Gets the DataFunctions API

Context: serversideRuntime
Tags: basic

getDateFunctions ( ) { DateFunctions }

Gets the DateFunctions API - an API for handling Dates

Context: serversideRuntime
Tags: basic

getId ( ) { long }

TODO

Context: serversideRuntime
Tags: standard

getIntegration ( name: String/Integration-ID) { Object }

Gets a named Integration-module

Parameters
Name Type Description
name String/Integration-ID
Context: serversideRuntime
Tags: basic

getLocale ( ) { Locale }

Returns the current locale.

Context: serversideRuntime
Tags: basic

getMail ( ) { Mail }

Gets the incoming Mail that triggered the execution of this Action

Context: serversideREST
Tags: standard,action,REST

getMessage ( ) { Message }

Gets the incoming Message that triggered the execution of this Action

Context: serversideREST
Tags: standard,action,REST

getMilliTime ( ) { long }

Context: serversideDevice

getModule ( moduleName: String) { Object }

Parameters
Name Type Description
moduleName String
Context: serversideDevice

getNanoTime ( ) { long }

Context: serversideDevice

getNextCounterValue ( name: String) { String }

TODO

Parameters
Name Type Description
name String
Context: serversideApplication
Tags: standard

getNextCounterValueLong ( name: String) { Integer }

TODO

Parameters
Name Type Description
name String
Context: serversideApplication
Tags: standard

getPreviousRecord ( ) { Record }

Get Previous Record

Context: serversideRuntime
Tags: standard,action,DATA

getRecord ( ) { Record }

Get Record

Context: serversideRuntime
Tags: standard,action,DATA

getRequest ( ) { ServiceRequest }

Gets the HTTP-request that triggered the execution of this Action

Context: serversideRuntime
Tags: action,REST

getResponse ( ) { ServiceResponse }

Gets the HTTP-response that is associated with the HTTP-request that triggered this Action

Context: serversideRuntime
Tags: standard,action,REST

getSchema ( ) { Schema }

Returns the Schema of the current App.

Context: serversideRuntime
Tags: basic

getServiceRequestHeaders ( ) { Object }

Gets the request headers and returns them as an object.

Context: serversideREST
Tags: standard,action,REST

getServiceRequestParameter ( name: String) { String }

Gets the value of an URI parameter in the request.

Parameters
Name Type Description
name String
Context: serversideREST
Tags: action,REST

getString ( name: String, vars: Map) { String }

Gets a String from the applications String-resources and performs variable substitution using the given parameters.

Parameters
Name Type Description
name String
vars Map
Context: serversideRuntime
Tags: basic

getString ( name: String) { String }

Gets a String from the applications String-resources

Parameters
Name Type Description
name String
Context: serversideRuntime
Tags: basic

getSystemManager ( ) { SystemManager }

TODO

Context: serversideREST
Tags: standard

getTags ( ) { Object }

Context: serversideDevice

getTenantId ( ) { String }

Returns the ID of the current user's tenant.

Context: serversideRuntime
Tags: basic

getTokenProperty ( key: String) { Object }

Gets a custom property from the access-token

Parameters
Name Type Description
key String
Context: serversideRuntime
Tags: basic

getURL ( ) { String }

Gets the server base-URL

Context: serversideRuntime
Tags: standard

getURL ( userInterface: String, view: String, recordId: String/ID, params: Object) { String }

Gets the url of a specific view

Parameters
Name Type Description
userInterface String
view String
recordId String/ID
params Object
Context: serversideRuntime
Tags: standard

getUser ( ) { User }

Gets the current User

Context: serversideRuntime
Tags: basic

hasFeature ( name: String) { boolean }

Checks for the presence of an application-feature

Parameters
Name Type Description
name String
Context: serversideRuntime
Tags: basic

hash ( data: String, algorithm: String) { String }

Compute the hash of a string using a given algorithm

Parameters
Name Type Description
data String
algorithm String
Context: serversideRuntime
Tags: basic

hasRequest ( ) { boolean }

True if there is a pending REST request

Context: serversideRuntime
Tags: standard,action,REST

hasResponse ( ) { boolean }

True if it is possible to respond to a pending REST request

Context: serversideRuntime
Tags: standard,action,REST

http ( options: Map) { Promise }

Sends an HTTP-request

Parameters
Name Type Description
options Map
Properties
Name Type Description
url String
method String/HTTP-Method
contentType String
handleAs String
body String,Object
headers Object
parameters Object
Context: serversideRuntime
Tags: basic

inTransaction ( ) { boolean }

Checks whether is an active database transaction in place

Context: serversideRuntime
Tags: standard

invoke ( funcName: String, args: Map) { Object }

Parameters
Name Type Description
funcName String
args Map
Context: serversideDevice

invoke ( funcName: String) { Object }

Parameters
Name Type Description
funcName String
Context: serversideDevice

invokeAction ( actionRef: Object, recordObj: Object) { ActionResult }

Executes an action

Parameters
Name Type Description
actionRef Object
recordObj Object
Context: serversideApplication
Tags: standard

isUserAllowed ( record: Record , userRef: User, String, privilege: Privilege, String) { boolean }

Checks if a User has a certain privilege on a Record

Parameters
Name Type Description
record Record
userRef User, String
privilege Privilege, String
Context: serversideApplication
Tags: standard

jsonpath ( path: String, document: Object) { Object }

Executes a jsonpath-expression on the provided JSON-document

Parameters
Name Type Description
path String
document Object
Context: serversideRuntime
Tags: basic

log ( level: Object, message: Object[])

Log a message to the application-log with a given severity (one of TRACE, DEBUG, INFO, WARN, ERROR)

Parameters
Name Type Description
level Object
message Object[]
Context: serversideRuntime
Tags: basic

log ( message: Object)

Log a message to the application-log

Parameters
Name Type Description
message Object
Context: serversideRuntime
Tags: basic

lookupGroup ( name: String) { Group }

Looks up a Group given its name

Parameters
Name Type Description
name String
Context: serversideApplication
Tags: standard

lookupUser ( name: String) { User }

Lookup a User given his username

Parameters
Name Type Description
name String
Context: serversideApplication
Tags: standard

parseHTML ( html: String) { Document }

Parses html string

Parameters
Name Type Description
html String
Context: serversideRuntime
Tags: basic

parseXML ( xml: String) { Document }

Parses xml string

Parameters
Name Type Description
xml String
Context: serversideRuntime
Tags: basic

publish ( topic: String, message: Map, headers: Map)

Publish a message to the bus

Parameters
Name Type Description
topic String
message Map
headers Map
Context: serversideRuntime
Tags: basic

publish ( topic: String, message: Map)

Publish a message to the bus

Parameters
Name Type Description
topic String
message Map
Context: serversideRuntime
Tags: basic

query ( queryStr: String/Query-ID, params: Object, user: User ) { Result }

Executes a query using the provided parameters

Parameters
Name Type Description
queryStr String/Query-ID
params Object
user User
Context: serversideRuntime
Tags: standard

queryForArray ( query: String/Query-ID, params: Object, user: User ) { Array }

Executes a query using the provided parameters and returns the resulting records as an array

Parameters
Name Type Description
query String/Query-ID
params Object
user User
Context: serversideRuntime
Tags: standard

queryForSingle ( query: String/Query-ID, params: Object, user: User ) { Record }

Executes a query using the given parameters and returns just the first record or null

Parameters
Name Type Description
query String/Query-ID
params Object
user User
Context: serversideRuntime
Tags: standard

randomString ( size: int) { String }

Generates a randomized alphanumeric string of a given size (default is 16 characters)

Parameters
Name Type Description
size int
Context: serversideRuntime
Tags: basic

readServiceRequestObject ( ) { Object }

Reads the request data and returns it as an object.

Context: serversideREST
Tags: standard,action,REST

reboot ( hard: boolean)

Parameters
Name Type Description
hard boolean
Context: serversideDevice

requestExecutionTime ( milliseconds: int) { boolean }

Requests an extension of this actions runtime

Parameters
Name Type Description
milliseconds int
Context: serversideApplication
Tags: standard

revokeFromGroup ( record: Record , groupRef: Group, String, privilege: Privilege, String)

Revokes a privilege on a particular model from a Group

Parameters
Name Type Description
record Record
groupRef Group, String
privilege Privilege, String
Context: serversideApplication
Tags: standard

revokeFromRole ( record: Record , roleRef: Role, String, privilege: Privilege, String)

Revokes a privilege on a particular model from a Role

Parameters
Name Type Description
record Record
roleRef Role, String
privilege Privilege, String
Context: serversideApplication
Tags: standard

revokeFromUser ( record: Record , userRef: User, String, privilege: Privilege, String)

Revokes a privilege on a particular model from a User

Parameters
Name Type Description
record Record
userRef User, String
privilege Privilege, String
Context: serversideApplication
Tags: standard

rollback ( )

Rolls back a database transaction

Context: serversideRuntime
Tags: standard

scheduleTask ( options: Map) { TimerTask }

Parameters
Name Type Description
options Map
Context: serversideDevice

sendHttpRequest ( options: Map) { HttpResponse }

Send an http-request

Parameters
Name Type Description
options Map
Properties
Name Type Description
url String
method String/HTTP-Method
handleAs String
body String,Object
headers Object
parameters Object
Context: serversideRuntime
Tags: basic

sendMail ( options: Map) { boolean }

Sends an email to one or more recipients

Parameters
Name Type Description
options Map
Properties
Name Type Description
from String
fromName String
to String
replyTo String, Array/String
subject String
body String
htmlBody String
attachments Array/String, Object
Context: serversideRuntime
Tags: standard

sendPush ( pushObject: Map) { boolean }

Sends a push-notification to one or more recipients

Parameters
Name Type Description
pushObject Map
Context: serversideRuntime
Tags: standard

sendServiceResponseError ( errorCode: int, message: String)

Sends an error to the client that invoked the rule

Parameters
Name Type Description
errorCode int
message String
Context: serversideREST
Tags: action,REST

sendSMS ( smsObject: Map) { boolean }

Sends an SMS to one or more recipients

Parameters
Name Type Description
smsObject Map
Properties
Name Type Description
from String
to String
body String
Context: serversideRuntime
Tags: standard

setData ( key: String, value: Object, scope: String)

Parameters
Name Type Description
key String
value Object
scope String
Context: serversideRuntime
Tags: basic

setServiceResponseHeaders ( headers: Object)

Sets the response headers to be the fields in the provided object.

Parameters
Name Type Description
headers Object
Context: serversideREST
Tags: standard,action,REST

sleep ( millis: long, nano: int)

Parameters
Name Type Description
millis long
nano int
Context: serversideDevice

sleep ( millis: long)

Parameters
Name Type Description
millis long
Context: serversideDevice

store ( object: Record, Object) { Record }

Stores a Record in the database. This will either create or update the Record depending on whether the record already exists.

Parameters
Name Type Description
object Record, Object
Context: serversideApplication
Tags: standard

storeAsUser ( object: Record, Object, user: User ) { Record }

Stores a Record in the database as a given User. This will either create or update the Record depending on whether the record already exists.

Parameters
Name Type Description
object Record, Object
user User
Context: serversideApplication
Tags: standard

tx ( transaction: Runnable, onSuccess: Runnable, onError: Consumer) { boolean }

Perform a set of operations wrapped inside a database transaction. When the function returns the transaction is commited, if an error occurs the transaction is rolled back. If the transaction is successfully committed the method returns true.

Parameters
Name Type Description
transaction Runnable
onSuccess Runnable
onError Consumer
Context: serversideRuntime
Tags: standard

update ( object: Record, Object, options: Object) { Record }

Updates a Record in the database. Should be done within the context of a transaction.

Parameters
Name Type Description
object Record, Object
options Object
Context: serversideApplication
Tags: standard

update ( recordObj: Object) { Promise }

Parameters
Name Type Description
recordObj Object
Context: serversideDevice

updateAs ( object: Record, Object, user: User , options: Object) { Record }

Updates a Record in the database as a given User. Should be done within the context of a transaction.

Parameters
Name Type Description
object Record, Object
user User
options Object
Context: serversideApplication
Tags: standard

waitForAll ( promises: Object[]) { Promise }

Parameters
Name Type Description
promises Object[]
Context: serversideRuntime
Tags: basic

writeServiceResponseObject ( data: Object)

Sends a response using the specified object.

Parameters
Name Type Description
data Object
Context: serversideREST
Tags: standard,action,REST