My FNZ Studio Version

Scripting

Latest Update: 15.02.2024 | Margherita Taffarel
Documentation
2023

Abbreviate

ABS

ABSOLUTEPATH

AccessPolicyCheck

ACOS

ADD

AddClientKeyAlias

AddPrivateKey

ADDTOTESTDATA

AddTrustedCertificate

AddUser (Deprecated)

AnalyzeSplittableValueStore (Deprecated)

AND

APPENDTOTEXTFILE

AppTask:HasBlockingViolations

ASIN

ASSERT

ASSIGN

AssignWorkitemToUser

ATAN

Auth:CreateJwtHmacSigned

Auth:CreateJwtRsaSigned

Auth:DecodeJwt

Auth:GetJwtClaim

Auth:GetJwtClaimNames

Auth:HasJwtClaim

Auth:HasPassword

Auth:RemovePassword

Auth:RetrievePassword

Auth:StorePassword

Auth:ValidateJwtHmacSigned

Auth:ValidateJwtRsaSigned

BBCode

BindingProxy

Blob:CopyBlobToLocalFile

Blob:CopyLocalFileToBlob

Blob:Delete

Blob:DeleteMetadata

Blob:DeleteTag

Blob:Exists

Blob:GetMetadata

Blob:GetTag

Blob:List

Blob:ListMetadata

Blob:ListTags

Blob:SetMetadata

Blob:SetTag

BuildDataClassScript

BusinessObject:Duplicate

CacheClear

CacheLookup

CacheNames

CacheRemove

CacheStore

CallIntegrationLink

CallOracleProcedure

CancelProcessInstance

CapitalizeTitle

CAST

Catalog:NewReference

CatalogueDelete

CatalogueUpdate

CEIL

CHAR

CHECKACCESSLICENSE

CHECKSYNTAX

CLEANDIRECTORY

CLONE

Cluster:IsLocalKey

ClusterCache:Clear

ClusterCache:ExistsEntry

ClusterCache:GetEntry

ClusterCache:ListEntryNames

ClusterCache:RemoveEntry

ClusterCache:StoreEntry

ClusterCacheClear (Deprecated)

ClusterCacheLookup (Deprecated)

ClusterCacheNames (Deprecated)

ClusterCacheRemove (Deprecated)

ClusterCacheStore (Deprecated)

CollectDependencies

Collection:AddAllElements

Collection:AddElement

Collection:ContainsElement

Collection:Difference

Collection:Filter

Collection:GetIndexOf

Collection:HasName

Collection:Intersection

Collection:LegacyGetIndexOfElement (Deprecated)

Collection:ListIndicesOf

Collection:ListNames

Collection:ListNamesOf

Collection:ListValues

Collection:Map

Collection:Merge

Collection:RemoveAllElements

Collection:RemoveElement (Deprecated)

Collection:RemoveElementAtIndex

Collection:RemoveElementFromIndexed

Collection:RemoveElementWithName

Collection:Reverse

Collection:SetElement (Deprecated)

Collection:SetElementAtIndex

Collection:SetElementWithName

Collection:Size

Collection:Sort

Collection:Union

CommitBusinessObject

CommitBusinessObjects

CommitProcessInstance

COMPONENTPATH

CompressFile

CONCAT

CONF

CONTAINS

CONTEXT (Deprecated)

CONTEXTPATH

ConvertImage

CopyBinaryDataToStream

COPYDIRECTORY

COPYFILE

CopyFileToStream

COS

CREATEDIRECTORY

CreateNotificationTopic

CreateProcessInstanceIndex

CREATEPROTOTYPE

CreateUser (Deprecated)

CreateWorkflowToken

CreateXmlDocument

CropImage

CustomListById

CustomListChildren

CustomListContent

CustomListRoot

CustomProcessLogEntry (Deprecated)

CypherText (Deprecated)

DataClass:GetInstanceId

DataClass:NewReference

DataEntityDeepSearch

DataEntityToXml

DATAHANDLEURL

DataLogic:CreateAndEvaluateContext

DataLogic:EvaluateDataRules

DataLogic:EvaluateFilteredDataRules

DataLogic:HasDataRuleViolations

DataLogic:IsDataLogicContext

DATAPATH

DataRules:GetPhoneNumberCountry

DataRules:SetPhoneNumberCountry

DataTableModel

DATEADD (Deprecated)

DATECOMPARE

DATEFIELD

DATEFORMAT

DATEPARSE

DAYSSINCE

DebugNonSplittableValueStore (Deprecated)

DECODETEXT

DecompressFile

DecryptText

DELETECLUSTERFILE

DELETEDIRECTORY

DELETEFILE

DeleteKey

DeleteNotificationTopic

DeleteProcessInstance

DeleteProcessInstanceIndex

DeleteUser (Deprecated)

DeleteWorkflowToken

DESERIALIZE

DIFFERENCE

DIR

DIRECTORYEXISTS

DIRECTORYSIZE

DIV

DIVV

DNSLookup

DNSReverseLookup

DocumentCategory:GetFromDocument

DocumentCategory:GetIconUrl

DocumentCategory:NewReference

DOCUMENTSETACTIONS

DROPSTRUCTURE

EMPTY

ENCODETEXT

ENCODETEXTMD5

ENCODEURL

ENCRYPTPATH

EncryptPDF

EncryptText

EncryptUserPassword (Deprecated)

EndDataTask

ENDSWITH

EQUAL

ERROR

ESCAPEHTML

ESCAPEJAVASCRIPT

EscapeRegex

ESCAPEXML

EVAL

EVALUATERULE

EVALUATERULESET (Deprecated)

ExceptionRootCause

ExcludeFromNotificationSubscription

ExecuteDistributed

EXECUTIONCONTEXT

EXECUTIONCONTEXTATTRIBUTE

ExistsBusinessObject

ExistsDataClass

EXN

EXP

FAIL

File:Checksum

File:DetectMediaType

File:ListDirectoryContent

File:ScanForVirus

FileChecksum (Deprecated)

FILEEXISTS

FILEEXTENSION

FILEMODIFICATIONTIME

FILENAME

FILESIZE

FILESYSTEMURL

FILTER

FindWorkitem

FLOOR

FOCUS

Format:NewReference

Format:Number

FROMLIST (Deprecated)

GENERATEPDF

GETBUSINESSOBJECT

GETBUSINESSOBJECTS

GetCalendar

GETCOLENTITY

GetDataContext

GETDEPENDENCIES

GETENTITY

GetIconIds

GetIconUrl

GetInstalledExtensions

GetLicenseReports

GetNotificationReceivers

GetNotificationSubscriptions

GetNotificationTopicDescription

GetNotificationTopicIds

GetNotificationTopicName

GetNumUnreadNotifications

GetProcessStatistics (Deprecated)

GetProcessToken

GETPROPERTY

GETSCROLLOFFSETVERTICAL

GetSensorStates

GetSubWorkflowTokenId

GetUser (Deprecated)

GetUserGroups (Deprecated)

GetUserRO (Deprecated)

GetUserRoles (Deprecated)

GetUsers (Deprecated)

GetValuestoreId

GREATER

GREATEREQUAL

HasKey

Http:ReadRequest

HTTPCOOKIEGET

HTTPCOOKIESET

HTTPGET

HTTPPOST

HTTPREQUEST

HTTPRESPONSE

HTTPSESSION (Deprecated)

HttpSession:GetHashedId

HttpSession:GetId

HTTPSESSIONGET (Deprecated)

HTTPSESSIONSET (Deprecated)

HTTPURL

IF

ImageInfo

INCOMINGDEPENDENCIES

INDEXOF (Deprecated)

InjectVariable

INPREVIEW

INTERSECTION

ISA

IsAjaxUpdateRequest

IsDataEntity

IsDataPlaceholder

IsDefined

IsPrimitiveType

ISRECENTLYUSED

JaasLoginTest

JOIN

JOINLIST

JOINPATH

KEY

KEYS

Label:NewReference

Label:Translate

LANGUAGE

LeftPad

LENGTH

LESS

LESSEQUAL

LIST

ListClusterFiles

LISTCONTENT

LISTDIRECTORIES

LISTFILES

ListProcessInstanceIndexDefinitions

LN

LOADFROMCSV

LoadNotifications

LOADTESTDATA

LocalProcessInstanceIds

LocationPath

LocationStack

LOG

LOGGER

LOGIN

LOGOUT

LONG

LOWERCASE

Mail:CreateIncomingMailConfiguration

Mail:CreateOutgoingMailConfiguration

Mail:DeleteIncomingMailConfiguration

Mail:DeleteOutgoingMailConfiguration

Mail:GetIncomingMailConfiguration

Mail:GetOutgoingMailConfiguration

Mail:UpdateIncomingMailConfiguration

Mail:UpdateOutgoingMailConfiguration

MakeUppercaseTexts

MAP

Markdown

MarkNotificationRead

MATCH

MATCHCOUNT

MatchingStrings

MAX

MEDIUM

MemoryUsage:GetThreadAllocatedBytes

MemoryUsageStatistics

MergePDFFiles (Deprecated)

MergeValueStore (Deprecated)

METHODCALL

Migration:AlignTimestampFilters

Migration:ExecNullSafe

Migration:MigrateFunctions

MIN

MOD

MOVEDIRECTORY

MOVEFILE

MUL

NEG

NEW (Deprecated)

NewIndexed

NEWLINE

NewNamed

NewObject

NextDayOfMonth

NextDayOfWeek

NOT

NotEmpty

NOTEQUAL

NOW

NUMBERFORMAT

OR

OUTGOINGDEPENDENCIES

Package:CompareVersionsReport

Package:NewReference

PARENTDIRECTORY

PARSEDATE

ParseJSON

ParseXmlDocument

PAUSE

Pdf:CountPages

Pdf:Decrypt

Pdf:HasDocumentOpenPassword

Pdf:HasPermissionsPassword

Pdf:IsEncrypted

Pdf:Join

Pdf:Merge (Deprecated)

Pdf:RemovePages

Pdf:ResetPermissions

Pdf:RotatePages

Pdf:Split

PdfNumberOfPages (Deprecated)

PdfOutputTable

PdfToImage

PI

POW

PrettyPrint

PRINT

PRINTLN

PrintXmlDocument

Process:CreateMessageQueue

Process:DeleteMessageQueue

Process:DeleteProcessMessage

Process:ExecuteAdHocAction

Process:ExportMessageQueues

Process:FindWorkitems

Process:GetAdHocNavigationStructure

Process:GetNewProcessMessages

Process:GetReadOnlyInstance

Process:GoToAdHocNavigationItem

Process:ImportMessageQueues

Process:IsEmptyLogicalWorkitemFilter

Process:NewReference

Process:TriggerCancel

Process:TriggerError

Process:TriggerTerminate

ProcessElementId

ProcessErrorCode

ProcessId

ProcessInstance

ProcessInstanceGetAttribute

ProcessInstanceId

ProcessInstanceIds

ProcessInstanceQueueNames

ProcessInstanceRemoveAttribute

ProcessInstanceSetAttribute

ProcessQueueCheckAccess

ProcessQueueNames

ProcessStartURL

ProcessToken

ProcessTokenGetAttribute

ProcessTokenRemoveAttribute

ProcessTokenSetAttribute

RANDOM

RandomText

ReadBinaryData

READCLUSTERFILE

ReadProcessMessageFile

READPROPERTIESFILE

READTEXTFILE

ReadTextFileLine

READTEXTRESOURCE

Record

RECORDS

RecursiveBuild

RELATIVEPATH

RemoveClientKeyAlias

RemoveDataContextCollectionElement

RemoveNotifications

RemovePrivateKey

RemoveSSLAlias

RemoveTrustedCertificate

RenderRichSuggestFieldSuggestions

REPLACE

ReplaceMatchingStrings

ReportValidationError

RESEMBLES

ResetStatistics

Resource:NewReference

RESOURCEURL

RethrowJavaException (Deprecated)

RetrieveTrustedCertificate

ReturnWebApiError

REVERSE

RightPad

RM

RollbackProcessInstance

RotateImage

ROUND

Rule:NewReference

RULEFORMULA

RuleSet:NewReference (Deprecated)

RULETEXT

RunWithVersionFilter

ScaleImage

SCOPETRACETABLE

Screen:GenerateAppwayTestIds

Screen:NewReference

SCREENCONTEXT

ScreenHasOutgoingConnection

SCREENID

SCREENSTATE

SCREENSTATEGET

SCREENSTATESET

SCREENURL

SCRIPTFUNCTIONURL (Deprecated)

SelectBusinessObjects

SendAddressedNotification

SendProcessMessage

SendPubSubNotification

SendWorkflowMessage

SEQUENCE

SERIALIZE

SetDataContextPrimitiveValue

SetKey

SetProcessSignal

SETSCROLLOFFSETVERTICAL

SetVersionFilter

SHORT

SignData

SIN

SIZE

SORT (Deprecated)

SPLIT

SplitIndexed (Deprecated)

SPLITLINES

SplitValueStore (Deprecated)

SqlCall

SqlClose

SqlCommit

SqlExport

SqlImport

SqlLoad

SqlOpen

SqlQuery

SqlRollback

SQRT

Ssl:DecodeCertificates

Ssl:FetchCertificates

Ssl:ListTrustStoreAliases

StackTrace

StartCollectingStatistics

StartProcess

StartSubProcess

STARTSWITH

STDERR

STDOUT

StopCollectingStatistics

StoreLicenseReport

STRINGCOMPARE

STRINGFORMAT

SUB

SubscribeForNotifications

SUBSTRING

SUPER

System:GetCsrfToken

System:MajorVersion

TAN

TextFormat

Throw:Exception

Throw:IllegalArgumentException

Throw:IllegalStateException

Throw:RethrowException

ThrowJavaException (Deprecated)

ThrowProcessCancel (Deprecated)

ThrowProcessError (Deprecated)

ThrowProcessTerminate (Deprecated)

Time:EpochMilli

Time:EpochSecond

TIMEADD

TIMEDIFF

TIMEROUND

TIMESTAMP (Deprecated)

TOBOOLEAN

TODATE

TODAY

TODOUBLE

ToIndexed

TOINTEGER

ToJSON

TOLIST (Deprecated)

TOLONG

ToMoney

ToNamed (Deprecated)

ToSqlDate

ToSqlTime

ToSqlTimestamp

TOSTRING

TracingEnter

TracingExit

TransformImage

TRANSLATE

TRIM

TypeOf

UID

UNESCAPEHTML

UNEVAL

UnexcludeFromNotificationSubscription

UNION

UNIQUE

UnsubscribeFromNotifications

Unwrap

Unzip

UpdateEncryptionKeyAlias

UpdateProcessInstance

UpdateUser (Deprecated)

UPPERCASE

USER (Deprecated)

User:AddToPhysicalGroup

User:AddUser

User:CheckPassword

User:Create

User:CreatePhysicalGroup

User:CreateVirtualGroup

User:CurrentUserGetFirstName

User:CurrentUserGetId

User:CurrentUserGetLastName

User:CurrentUserIsInGroup

User:CurrentUserIsInRole

User:CurrentUserListGroupIds

User:CurrentUserListRoleIds

User:Delete

User:DeleteGroup

User:Get

User:GetAllGroups

User:GetAllPermissions

User:GetAllRoles

User:GetPermissionsForRole

User:GetReadOnly

User:HashPassword

User:IsInGroup

User:ListGroupIds

User:ListIds

User:ListLocalIds

User:ListRoleIds

User:RemoveFromPhysicalGroup

User:SetPermissionToRole

User:Update

User:UpdateVirtualGroupDefinition

UserAddToGroup (Deprecated)

USERFIRSTNAME (Deprecated)

UserGetGroupIds (Deprecated)

USERGROUPS (Deprecated)

USERID (Deprecated)

USERIDS (Deprecated)

USERINGROUP (Deprecated)

USERINROLE (Deprecated)

UserIsInGroup (Deprecated)

USERLASTNAME (Deprecated)

UserRemoveFromGroup (Deprecated)

USERROLES (Deprecated)

USERS (Deprecated)

UseSSLAlias

UseValuestoreRO

UUID

VALUES

ValueStore:AnalyzeIfSplittable

ValueStore:DebugNonSplittable

ValueStore:Merge

ValueStore:MergeAllLocalValueStores

VariablePointer

VersionFilter

WINDOWSTATE

WINDOWSTATEGET

WINDOWSTATESET

WORKITEM

WORKLIST

WriteBinaryData

WRITECLUSTERFILE

WriteProcessMessageFile

WRITEPROPERTIESFILE

WRITETEXTFILE

WRITETEXTRESOURCE

XmlToDataEntity

XmlTransform

XOR

XPathQuery

Zip

This article documents the functions included with the Core Platform and mandatory extensions for FNZ Studio 2023 LTS. Functions delivered with other extensions are documented in the according extension documentation. Note that the information contained in this article is extracted from FNZ Studio Composition Interactive Script Editor (ISE).

Updated as of FNZ Studio 2023 LTS patch 3 (2023.5.3).

Abbreviate

Returns the abbreviation of the given text.

Signature


Abbreviate($text , $length) : String

Parameters

  • $text (mandatory)
    The text to be abbreviated.
    Type: String
    Example: 'hello world'
  • $length (mandatory)
    The length of the abbreviated text.
    Type: Integer
    Example: 5

Return Value

  • Returns the abbreviation of the given text.
    Type: String

Examples

Abbreviate('hello world', 5)

ABS

Calculate the absolute value of the given argument.

Signature


ABS($number) : Number

Parameters

  • $number (mandatory)
    The number whose absolute value must be calculated.
    Type: Number
    Example: -12.4

Return Value

  • The absolute value of the given parameter.
    Type: Number

Examples


ABS(-12.4)=12.4


ABS(5)=5

ABSOLUTEPATH

Build the absolute path to a file in the Data Home folder.

Signature


ABSOLUTEPATH($path) : String

Parameters

  • $path (mandatory)
    Relative path to a file in the Data Home folder.
    Type: String
    Example: 'conf/content.properties'

Return Value

  • Absolute path to a file in the Data Home folder.
    Type: String

Examples


ABSOLUTEPATH('conf/content.properties') ='C:/.../conf/content.properties'

AccessPolicyCheck

Check whether there is an Access Policy for the given Business Object and return the Policy decision. If there is no such Access Policy, the default decision is returned. If there is no default decision, null is returned.

Signature


AccessPolicyCheck($userId , $type , $id , $default) : Boolean

Parameters

  • $userId (mandatory)
    User Id or null for anonymous user.
    Type: String
    Example: USERID()
    $creator
  • $type (mandatory)
    Business Object Type.
    Type: String
    Example: 'Workflow'
  • $id (mandatory)
    Business Object Id.
    Type: String
    Example: 'AOP'
  • $default (optional)
    Default Decision.
    Type: Boolean
    Example: false

Return Value

  • Access Policy Check result.
    Type: Boolean

Examples

AccessPolicyCheck(USERID(), 'Workflow', 'AOP', false)
AccessPolicyCheck($creator, 'Workflow', 'Credits', USERINROLE('User'))

ACOS

Arccosine.

Signature


ACOS($value) : Double

Parameters

  • $value (mandatory)
    Value.
    Type: Double
    Example: 0.5

Return Value

  • Arccosine.
    Type: Double

Examples

ACOS(0.5)

ADD

Calculate the sum of all arguments.

Signature


ADD($value , $value2) : Number

Parameters

  • $value (mandatory)
    The value that must be summed up.
    Type: Number
    Example: 1
  • $value2 (optional)
    The other value that must be summed up.
    Type: Number
    Example: 2

Return Value

  • Return the sum of all arguments.
    Type: Number

Examples


ADD(1,2)=3

AddClientKeyAlias

Signature


AddClientKeyAlias($hostname , $alias) : Nothing

Parameters

  • $hostname (mandatory)
    The hostname for the hostname<->alias mapping to be added.
    Type: String
    Example: localhost
  • $alias (mandatory)
    The alias for the hostname<->alias mapping to be added.
    Type: String
    Example: crm_service

Return Value

  • Type: Nothing

Examples

AddClientKeyAlias('localhost', 'crm_service')

AddPrivateKey

Success or failure.

Signature


AddPrivateKey($alias , $keyfilepath , $password) : Boolean

Parameters

  • $alias (mandatory)
    The alias the key should be saved under in the keystore.
    Type: String
    Example: crm_service
  • $keyfilepath (mandatory)
    The path to the file containing the key you want to import.
    Type: String
    Example: /data/keys/key.pfx
  • $password (mandatory)
    The password the key was stored with when created.
    Type: String
    Example: password

Return Value

  • Success or failure.
    Type: Boolean

Examples

AddPrivateKeyFunction('alias', '/data/keys/key.pfx', 'password')

ADDTOTESTDATA

Add the given variable to the given test data.

Signature


ADDTOTESTDATA($testDataId , $variableName , $expression) : Nothing

Parameters

  • $testDataId (mandatory)
    The id of the Test Data.
    Type: String
    Example: $testDataId
  • $variableName (mandatory)
    The name of the variable.
    Type: String
    Example: 'relation'
  • $expression (mandatory)
    The the value of the variable.
    Type: Any
    Example: $relation

Return Value

  • Add the given variables to the given test data.
    Type: Nothing

Examples

ADDTOTESTDATA($testDataId, $variableName, $variableValue)

AddTrustedCertificate

Success or failure.

Signature


AddTrustedCertificate($alias , $certificatefilepath) : Boolean

Parameters

  • $alias (mandatory)
    The alias the key should be saved under in the keystore.
    Type: String
    Example: crm_service
  • $certificatefilepath (mandatory)
    The path to the certificate you want to import.
    Type: String
    Example: /data/certs/cert.cer

Return Value

  • Success or failure.
    Type: Boolean

Examples

AddTrustedCertificateFunction('alias', '/data/certs/cert.cer')

AddUser (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:AddUser instead.

Signature


AddUser($user) : Nothing

Parameters

  • $user (mandatory)
    The user to be added.
    Type: User
    Example: AddUser()

Return Value

  • Adds a User to the system.
    Type: Nothing

AnalyzeSplittableValueStore (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ValueStore:AnalyzeIfSplittable instead.

Signature


AnalyzeSplittableValueStore($processInstanceId , $smallThresholdSizeInKB) : Any

Parameters

  • $processInstanceId (mandatory)
    The process instance id of the value store that must be analyzed.
    Type: String
    Example: $processInstanceId
  • $smallThresholdSizeInKB (optional)
    The size of the smaller threshold used to group the data objects. The large threshold used will be 10 times the small one so there will be three size ranges. Default small threshold is 10 KB.
    Type: Double
    Example: $smallThresholdSizeInKB

Return Value

  • Type: Any

Examples

AnalyzeSplittableValueStore($processInstanceId)

AND

Calculate the booolean AND function. Returns true only if all arguments are true.

Signature


AND($booleanValue , $booleanValue) : Boolean

Parameters

  • $booleanValue (mandatory)
    A boolean value.
    Type: Boolean
    Example: $a
  • $booleanValue (optional)
    A boolean value.
    Type: Boolean
    Example: $b

Return Value

  • True if all arguments evaluate to true, false otherwise.
    Type: Boolean

Examples


AND(true,false)=false


AND(true,true)=true

APPENDTOTEXTFILE

Append the given data to the given file. Relative paths are interpreted relative to the Data Home, use '{DATA_HOME}' to refer to the nm data home location.

Signature


APPENDTOTEXTFILE($filepath , $data , $encoding) : Nothing

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: '{DATA_HOME}/work/tmp/thefile.txt'
  • $data (mandatory)
    The data to be added to the file.
    Type: String
    Example: 'some text'
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'

Return Value

  • Append the given data to the given file.
    Type: Nothing

Examples

APPENDTOTEXTFILE('{DATA_HOME}/work/tmp/thefile.txt', 'some text')

AppTask:HasBlockingViolations

Returns true if the current AppTask has any blocking violation.

Signature


AppTask:HasBlockingViolations() : Boolean

Parameters
None
Return Value

  • Returns true if the current AppTask has any blocking violations.
    Type: Boolean

Examples

AppTask:HasBlockingViolations()

ASIN

Arcsine.

Signature


ASIN($value) : Double

Parameters

  • $value (mandatory)
    Value.
    Type: Double
    Example: 0.5

Return Value

  • Arcsine.
    Type: Double

Examples

ASIN(0.5)

ASSERT

Throws an AssertionException if condition isn't true.

Signature


ASSERT($condition , $message) : Nothing

Parameters

  • $condition (mandatory)
    Condition to assert.
    Type: Boolean
    Example: $balance >= 0
  • $message (optional)
    Error message if assertion fails.
    Type: String
    Example: 'negative balance'

Return Value

  • Type: Nothing

Examples

FAIL()
ASSERT($balance >= 0, 'negative balance')

ASSIGN

Assign a value to a variable.

Signature


ASSIGN($var , $value) : Any

Parameters

  • $var (mandatory)
    The variable.
    Type: com.nm.sdk.data.expeval.nodes.ExecutionNode
    Example: $entity
  • $value (mandatory)
    The new value of the variable or entity.
    Type: com.nm.sdk.data.expeval.Pointer
    Example: 12.4

Return Value

  • The new value of the variable.
    Type: Any

Examples


ASSIGN($entity,12.4) = $entity now contains the value 12.4

AssignWorkitemToUser

Assign a workitem to a user.

Signature


AssignWorkitemToUser($workItemId , $userId , $variableAssignments , $ignoreAssignmentErrors , $forceCurrentProcessToken) : String

Parameters

  • $workItemId (mandatory)
    The id of the workItem that must be assigned to the given user.
    Type: String
    Example: $itemId
  • $userId (mandatory)
    The id of the user whome the workitem must be assigned.
    Type: String
    Example: $userId
  • $variableAssignments (optional)
    Variable Assignments for the valuestore of the workflowinstance being forwarded.
    Type: Any:mapped
    Example: $map
  • $ignoreAssignmentErrors (optional)
    Ignores variable assignment errors if set to true (default: false).
    Type: Boolean
    Example: true
  • $forceCurrentProcessToken (optional)
    Assigns to the current Workitem instead to a parent one lying inside a swimlane (default: false).
    Type: Boolean
    Example: false

Return Value

  • Assign a workitem to a user.
    Type: String

Examples

AssignWorkitemToUser($itemId, $userId)

ATAN

Arctangent.

Signature


ATAN($value) : Double

Parameters

  • $value (mandatory)
    Value.
    Type: Double
    Example: 0.5

Return Value

  • Arctangent.
    Type: Double

Examples

ATAN(0.5)

Auth:CreateJwtHmacSigned

Generate a JWT signed using HMAC.

Signature


Auth:CreateJwtHmacSigned($algorithmName , $secretAlias , $claims , $headerClaims) : String

Parameters

  • $algorithmName (mandatory)
    The name of the HMAC algorithm used to sign the JWT. Accepted algorithms are: 'HS256', 'HS384', 'HS512'.
    Type: String
    Example: 'HS256'
  • $secretAlias (mandatory)
    The alias of the secret used for creating the JWT. It represents a secret stored in the Appway Key service.
    Type: String
    Example: 'my-secret-alias'
  • $claims (mandatory)
    A Named collection of public and private claims.
    Type: String:mapped
    Example: Named String $claims := {'iat'=TOSTRING(TOINTEGER(TIMESTAMP(NOW()) / 1000)), 'iss'='appway'}:String
  • $headerClaims (optional)
    A Named collection of claims to include in the header of the JWT.
    Type: String:mapped
    Example: Named String $headerClaims := {'kid'='123456'}:String

Return Value

  • Generate a JWT signed using HMAC.
    Type: String

Examples

Auth:CreateJwtHmacSigned('HS256', 'my-secret-alias', $claims)

Auth:CreateJwtRsaSigned

Generate a JWT signed using RSA.

Signature


Auth:CreateJwtRsaSigned($algorithmName , $privateKeyAlias , $claims , $headerClaims) : String

Parameters

  • $algorithmName (mandatory)
    The name of the RSA algorithm used to sign the JWT. Accepted algorithms are: 'RS256', 'RS384', 'RS512'.
    Type: String
    Example: 'RS256'
  • $privateKeyAlias (mandatory)
    The alias of the private key used for creating the JWT. It represents a private key stored in the Appway Key service.
    Type: String
    Example: 'my-private-key-alias'
  • $claims (mandatory)
    A Named collection of public and private claims.
    Type: String:mapped
    Example: Named String $claims := {'iat'=TOSTRING(TOINTEGER(TIMESTAMP(NOW()) / 1000)), 'iss'='appway'}:String
  • $headerClaims (optional)
    A Named collection of claims to include in the header of the JWT.
    Type: String:mapped
    Example: Named String $headerClaims := {'kid'='123456'}:String

Return Value

  • Generate a JWT signed using RSA.
    Type: String

Examples

Auth:CreateJwtRsaSigned('RS256', 'my-private-key-alias', $claims)

Auth:DecodeJwt

Returns a decoded JWT as a string based on the given JWT.

Signature


Auth:DecodeJwt($jwt) : String

Parameters

  • $jwt (mandatory)
    The JWT to be decoded.
    Type: String
    Example: eyJ0eXAi[...]gxBzFfOg

Return Value

  • Returns a decoded JWT as a string based on the given JWT.
    Type: String

Examples

Auth:DecodeJwt($jwt)

Auth:GetJwtClaim

Return the claim with the given name from the given JWT without verifying the signature. If the claim does not exist or there is a type mismatch, null is returned. If the given type is not supported IllegalArgumentException is thrown. If the given type is Named and some values are not serializable, they are not included in the result.

Signature


Auth:GetJwtClaim($jwt , $claimName , $type) : Any

Parameters

  • $jwt (mandatory)
    The JWT to extract the claim from.
    Type: String
    Example: eyJ0eXAi[...]gxBzFfOg
  • $claimName (mandatory)
    The name of the claim to extract.
    Type: String
    Example: String
  • $type (optional)
    The expected type of the claim. Only the following types are supported: String, Boolean, Integer, Long, Double, Date, Indexed, Named.
    Type: String
    Example: String

Return Value

  • Return the claim with the given name from the given JWT without verifying the signature. If the claim does not exist or there is a type mismatch, null is returned. If the given type is not supported IllegalArgumentException is thrown. If the given type is Named and some values are not serializable, they are not included in the result.
    Type: Any

Examples

Auth:GetJwtClaim($jwt, $claimName) or Auth:GetJwtClaim($jwt, $claimName, $claimType)

Auth:GetJwtClaimNames

Return the names of the claims that the given JWT contains.

Signature


Auth:GetJwtClaimNames($jwt) : Indexed String

Parameters

  • $jwt (mandatory)
    The JWT to extract the claim names from.
    Type: String
    Example: eyJ0eXAi[...]gxBzFfOg

Return Value

  • Return the names of the claims that the given JWT contains.
    Type: Indexed String

Examples

Auth:GetJwtClaimNames($jwt)

Auth:HasJwtClaim

Return true if the claim with the given name exists, false otherwise.

Signature


Auth:HasJwtClaim($jwt , $claimName) : Boolean

Parameters

  • $jwt (mandatory)
    The JWT where to check the claim.
    Type: String
    Example: eyJ0eXAi[...]gxBzFfOg
  • $claimName (mandatory)
    The name of the claim to check.
    Type: String
    Example: String

Return Value

  • Return true if the claim with the given name exists, false otherwise.
    Type: Boolean

Examples

Auth:HasJwtClaim($jwt, $claimName)

Auth:HasPassword

Verify the existence of a password for a given alias.

Signature


Auth:HasPassword($passwordAlias) : Boolean

Parameters

  • $passwordAlias (mandatory)
    The alias which existence should be verified. Can't be empty.
    Type: String
    Example: 'myPassword'

Return Value

  • Verify the existence of a password for a given alias.
    Type: Boolean

Examples

Auth:HasPassword('myPassword')

Auth:RemovePassword

Removes password with specified alias. Returns true if success, false if alias does not exist.

Signature


Auth:RemovePassword($passwordAlias) : Boolean

Parameters

  • $passwordAlias (mandatory)
    The password alias to be removed. Can't be empty.
    Type: String
    Example: 'myPassword'

Return Value

  • Removes password with specified alias. Returns true if success, false if alias does not exist.
    Type: Boolean

Examples

Auth:RemovePassword('myPassword')

Auth:RetrievePassword

Returns the password associated with the given alias or null if no such alias exists.

Signature


Auth:RetrievePassword($passwordAlias) : String

Parameters

  • $passwordAlias (mandatory)
    The alias associated with the password. Can't be empty.
    Type: String
    Example: 'myPassword'

Return Value

  • Returns the password associated with the given alias or null if no such alias exists.
    Type: String

Examples

Auth:RetrievePassword('myPassword')

Auth:StorePassword

Stores password with associated alias.

Signature


Auth:StorePassword($passwordAlias , $password) : Nothing

Parameters

  • $passwordAlias (mandatory)
    The alias to be associated with the password for later retrieval. Can't be empty.
    Type: String
    Example: 'myPassword'
  • $password (mandatory)
    The password to be stored. Can't be empty.
    Type: String
    Example: 'm4X2NUymFZBHZeCP'

Return Value

  • Stores password with associated alias.
    Type: Nothing

Examples

Auth:StorePassword('myPassword', 'm4X2NUymFZBHZeCP')

Auth:ValidateJwtHmacSigned

Validate a JWT signed using HMAC and return its claims. If the JWT is not valid a NmRuntimeException is thrown.

Signature


Auth:ValidateJwtHmacSigned($algorithmName , $secretAlias , $jwt , $requiredClaims) : String:mapped

Parameters

  • $algorithmName (mandatory)
    The name of the HMAC algorithm used to validate the JWT. Accepted algorithms are: 'HS256', 'HS384', 'HS512'.
    Type: String
    Example: 'HS256'
  • $secretAlias (mandatory)
    The alias of the secret used for validating the JWT. It represents a secret stored in the Appway Key service.
    Type: String
    Example: 'my-secret-alias'
  • $jwt (mandatory)
    The JWT to be verified.
    Type: String
    Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
  • $requiredClaims (optional)
    A Named collection of public and private claims that need to be present in the JWT. If an empty string is used as value, the presence only of the claim is checked, otherwise its value too.
    Type: String:mapped
    Example: Named String $requiredClaims := {'iat'= TOSTRING(TOINTEGER(TIMESTAMP() / 1000)), 'iss'='appway'}:String

Return Value

  • Validate a JWT signed using HMAC and return its claims. If the JWT is not valid a NmRuntimeException is thrown.
    Type: String:mapped

Examples

Auth:ValidateJwtHmacSigned('HS256', 'my-secret-alias', $jwt, $requiredClaims)

Auth:ValidateJwtRsaSigned

Validate a JWT signed using RSA and return its claims. If the JWT is not valid a NmRuntimeException is thrown.

Signature


Auth:ValidateJwtRsaSigned($algorithmName , $publicKeyAlias , $jwt , $requiredClaims) : String:mapped

Parameters

  • $algorithmName (mandatory)
    The name of the RSA algorithm used to validate the JWT. Accepted algorithms are: 'RS256', 'RS384', 'RS512'.
    Type: String
    Example: 'RS256'
  • $publicKeyAlias (mandatory)
    The alias of the public key used for validating the JWT. It represents a public key stored in the Appway Key service.
    Type: String
    Example: 'my-public-key-alias'
  • $jwt (mandatory)
    The JWT to be verified.
    Type: String
    Example: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhcHB3YXkiLCJjdXN0b21lck51bWJlciI6Im4xMjM0NSIsImlhdCI6MTYwNzA4NzI2OH0.iH_kL9bUjX2aho8yQZabUDchMy759CFcuigmUpBA9oqzjjyGBH2yvrTYM7GCZpW5iVK2RpBI8WfAaSkQGvpXCB0DeTst28OI14QsTmQAkP_Bb1pInM4DeMPMyI4OY1lRMwjsw3a1jIdBE_otrIlvBA4ut0nGHm6sycy4ufKl7xKnwlGubV5lxHi2Vs6v3I9KkIoRRp-sfYvahfQteIBVr8eiVXYemGngWsmJxsCZjo8KneIQ6X9PEtYsfj6nskbDSvTlPC5yfktUTC99WxyzeGJ5eMMS7IKKf5bWfaSr3Qopba4XdQ_aRJ7zCyvYpvEsO1r7t4ny81KEM3gxBzFfOg
  • $requiredClaims (optional)
    A Named collection of public and private claims that need to be present in the JWT. If an empty string is used as value, the presence only of the claim is checked, otherwise its value too.
    Type: String:mapped
    Example: Named String $requiredClaims := {'iat'= TOSTRING(TOINTEGER(TIMESTAMP() / 1000)), 'iss'='appway'}:String

Return Value

  • Validate a JWT signed using RSA and return its claims. If the JWT is not valid a NmRuntimeException is thrown.
    Type: String:mapped

Examples

Auth:ValidateJwtRsaSigned('RS256', 'my-public-key-alias', $jwt, $requiredClaims)

BBCode

Render BBCode-Formatted Text into HTML.

Signature


BBCode($string) : String

Parameters

  • $string (mandatory)
    BBCode-formatted Text.
    Type: String
    Example: 'BBCode("Hello [b]World[/b]")'

Return Value

  • HTML-formatted Text.
    Type: String

Examples

BBCode($string)

BindingProxy

Returns a pointer to the value referenced in the given binding expression.

Signature


BindingProxy($bindingExpression , $entityName , $entity) : String

Parameters

  • $bindingExpression (mandatory)
    The expression for the binding.
    Type: String
    Example: '$person.firstName'
  • $entityName (mandatory)
    The variable name of the entity which is the root of the binding expression.
    Type: String
    Example: '$person.firstName'
  • $entity (mandatory)
    The entity where the binding is rooted.
    Type: Any
    Example: $myPerson

Return Value

  • Returns a pointer to the value referenced in the given binding expression.
    Type: String

Examples

BindingProxy('$person.firstName', 'person', $myPerson)

Blob:CopyBlobToLocalFile

Copy the specified Blob to the given local file.

Signature


Blob:CopyBlobToLocalFile($silo , $blobKey , $filePath) : Nothing

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to read.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $filePath (mandatory)
    The local path (relative to data home or absolute) where the Blob needs to be written. If the local file already exists, an exception is thrown.
    Type: String
    Example: 'foo/bar/thefile.txt'

Return Value

  • Copy the specified Blob to the given local file.
    Type: Nothing

Examples

Blob:CopyBlobToLocalFile('archive', '2020/24/123.txt.dat', 'foo/bar/thefile.txt')

Blob:CopyLocalFileToBlob

Copy the specified local file to given Blob Storage silo. Returns the key of the written Blob.

Signature


Blob:CopyLocalFileToBlob($silo , $filePath) : String

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $filePath (mandatory)
    The local path (relative to data home or absolute) of the File to be written.
    Type: String
    Example: 'foo/bar/thefile.txt'

Return Value

  • Copy the specified local file to given Blob Storage silo. Returns the key of the written Blob.
    Type: String

Examples

Blob:CopyLocalFileToBlob('archive', 'foo/bar/thefile.txt')

Blob:Delete

Delete a specified Blob and its metadata.

Signature


Blob:Delete($silo , $blobKey) : Nothing

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to delete.
    Type: String
    Example: '2020/24/123.txt.dat'

Return Value

  • Delete a specified Blob and its metadata.
    Type: Nothing

Examples

Blob:Delete('archive', '2020/24/123.txt.dat')

Blob:DeleteMetadata

Delete the specified metadata of a specified Blob.

Signature


Blob:DeleteMetadata($silo , $blobKey , $metadataName) : Nothing

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to delete metadata for.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $metadataName (mandatory)
    The name of the metadata to delete.
    Type: String
    Example: 'Custom:PassportNumber'

Return Value

  • Delete the specified metadata of a specified Blob.
    Type: Nothing

Examples

Blob:DeleteMetadata('archive', '2020/24/123.txt.dat', 'Custom:PassportNumber')

Blob:DeleteTag

Delete a tag from a Blob. If no such tag exists, nothing happens.

Signature


Blob:DeleteTag($silo , $blobKey , $tagName) : Nothing

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to delete the tag for.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $tagName (mandatory)
    The name of the tag to delete.
    Type: String
    Example: 'PassportNumber'

Return Value

  • Delete a tag from a Blob. If no such tag exists, nothing happens.
    Type: Nothing

Examples

Blob:DeleteTag('archive', '2020/24/123.txt.dat', 'PassportNumber')

Blob:Exists

Return true if the Blob exists, false otherwise.

Signature


Blob:Exists($silo , $blobKey) : Boolean

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to check existence for.
    Type: String
    Example: '2020/24/123.txt.dat'

Return Value

  • Return true if the Blob exists, false otherwise.
    Type: Boolean

Examples

Blob:Exists('archive', '2020/24/123.txt.dat')

Blob:GetMetadata

Return the specified metadata of a specified Blob.

Signature


Blob:GetMetadata($silo , $blobKey , $metadataName) : String

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to get metadata for.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $metadataName (mandatory)
    The name of the metadata to get.
    Type: String
    Example: 'Filename'

Return Value

  • Return the specified metadata of a specified Blob.
    Type: String

Examples

Blob:GetMetadata('archive', '2020/24/123.txt.dat', 'FileName')

Blob:GetTag

Get the value of a tag on a Blob. If no such tag exists, null is returned.

Signature


Blob:GetTag($silo , $blobKey , $tagName) : String

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to get the tag value for.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $tagName (mandatory)
    The name of the tag to retrieve.
    Type: String
    Example: 'PassportNumber'

Return Value

  • Get the value of a tag on a Blob. If no such tag exists, null is returned.
    Type: String

Examples

Blob:GetTag('archive', '2020/24/123.txt.dat', 'PassportNumber')

Blob:List

Return the list of keys of the Blobs matching the search criteria.

Signature


Blob:List($silo , $filter) : String:indexed

Parameters

  • $silo (mandatory)
    The silo to query.
    Type: String
    Example: 'archive'
  • $filter (mandatory)
    The filter used to search for the Blobs.
    Type: Blob:Filter
    Example: $filter

Return Value

  • Return the list of keys of the Blobs matching the search criteria.
    Type: String:indexed

Examples

Blob:List('archive', $filter)

Blob:ListMetadata

Return the list of metadata names for a specified Blob.

Signature


Blob:ListMetadata($silo , $blobKey) : String:indexed

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to list the metadata for.
    Type: String
    Example: '2020/24/123.txt.dat'

Return Value

  • Return the list of metadata names for a specified Blob.
    Type: String:indexed

Examples

Blob:ListMetadata('archive', '2020/24/123.txt.dat')

Blob:ListTags

Return all tag names on a Blob.

Signature


Blob:ListTags($silo , $blobKey) : String:indexed

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to list the tag names for.
    Type: String
    Example: '2020/24/123.txt.dat'

Return Value

  • Return all tag names on a Blob.
    Type: String:indexed

Examples

Blob:ListTags('archive', '2020/24/123.txt.dat')

Blob:SetMetadata

Set the metadata name-value pair of a specified Blob.

Signature


Blob:SetMetadata($silo , $blobKey , $metadataName , $metadataValue) : Nothing

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to set metadata for.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $metadataName (mandatory)
    The name of the metadata to set.
    Type: String
    Example: 'Custom:PassportNumber'
  • $metadataValue (mandatory)
    The value of the metadata to set.
    Type: String
    Example: 'AZ123'

Return Value

  • Set the metadata name-value pair of a specified Blob.
    Type: Nothing

Examples

Blob:SetMetadata('archive', '2020/24/123.txt.dat', 'Custom:PassportNumber', 'AZ123')

Blob:SetTag

Set a tag on a Blob. If the tag already exists, its value will be overwritten.

Signature


Blob:SetTag($silo , $blobKey , $tagName , $tagValue) : Nothing

Parameters

  • $silo (mandatory)
    The silo to use for the Blob.
    Type: String
    Example: 'archive'
  • $blobKey (mandatory)
    The key of the Blob to set the tag on.
    Type: String
    Example: '2020/24/123.txt.dat'
  • $tagName (mandatory)
    The name of the tag to set.
    Type: String
    Example: 'PassportNumber'
  • $tagValue (mandatory)
    The value of the tag to set.
    Type: String
    Example: 'AZ123'

Return Value

  • Set a tag on a Blob. If the tag already exists, its value will be overwritten.
    Type: Nothing

Examples

Blob:SetTag('archive', '2020/24/123.txt.dat', 'PassportNumber', 'AZ123')

BuildDataClassScript

Build the script that defines the given dataclass.

Signature


BuildDataClassScript($id , $versionFilter) : String

Parameters

  • $id (mandatory)
    The id of the dataclass.
    Type: String
    Example: 'Person'
  • $versionFilter (mandatory)
    The version filter used for retrieving the class, null selects the 'current' version.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VERSIONFILTER()

Return Value

  • Build the script that defines the given dataclass.
    Type: String

Examples

BuildDataClassScript($id, $versionFilter)

BusinessObject:Duplicate

Duplicates a Business Object. The function verifies if there are permissions to alter the target Package. By default, it is not allowed to overwrite an existing Business Object. Special configuration Business Objects and the Package Business Object are not supported (e.g. PackageConfiguration,.).

Signature


BusinessObject:Duplicate($type , $srcId , $targetId , $override , $versionFilter) : Nothing

Parameters

  • $type (mandatory)
    Business Object Type.
    Type: String
    Example: 'Screen'
  • $srcId (mandatory)
    Business Object Id.
    Type: String
    Example: 'Source:TestScreen'
  • $targetId (mandatory)
    Business Object Id.
    Type: String
    Example: 'Target:NewTestScreen'
  • $override (optional)
    Boolean indicate if an already existing target Business Object should be overwritten or not. Default: false.
    Type: Boolean
    Example: true
  • $versionFilter (optional)
    Version Filter used to select Business Object version. Default: Current Version Filter.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter('HeadFilter')

Return Value

  • Nothing.
    Type: Nothing

Examples

BusinessObject:Duplicate('Screen', 'Source:TestScreen', 'Target:NewTestScreen')

CacheClear

Remove all objects from the application cache.

Signature


CacheClear() : Nothing

Parameters
None
Return Value

  • Remove all objects from the application cache.
    Type: Nothing

Examples

CacheClear()

CacheLookup

Return the object with the given name in the application cache.

Signature


CacheLookup($name) : Any

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Return the object with the given name in the application cache.
    Type: Any

Examples

$cachedObject := CacheLookup('myobject')

CacheNames

Returns an indexed collection of all object names in the application cache. This function does not check if the cache entries have expired.

Signature


CacheNames($pattern) : String:indexed

Parameters

  • $pattern (optional)
    Optional regex pattern to match names against.
    Type: String
    Example: user.*

Return Value

  • Returns an indexed collection of all object names in the application cache. This function does not check if the cache entries have expired.
    Type: String:indexed

Examples

$names := CacheNames('user.*')

CacheRemove

Remove the object with the given name from the application cache.

Signature


CacheRemove($name) : Nothing

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Remove the object with the given name from the application cache.
    Type: Nothing

Examples

CacheRemove('myobject')

CacheStore

Store the given object with the given name in the application cache.

Signature


CacheStore($name , $object , $retentionExpression) : Any

Parameters

  • $name (mandatory)
    The name of the object to cache.
    Type: String
    Example: 'myobject'
  • $object (mandatory)
    The object to be stored in the application cache.
    Type: Any
    Example: $cachedObject
  • $retentionExpression (optional)
    An expression that returns true as long as the object is valid. The expression may use the implicit variables $insertTimestamp (Long, the time when the object was stored in the application cache) and $accessTimestamp (Long, the time when the object was last accessed) to make the decision.
    Type: Any
    Example: true

Return Value

  • Store the given object with the given name in the application cache.
    Type: Any

Examples

CacheStore('myobject', $cachedObject)

CallIntegrationLink

Send a message through the message routing system.

Signature


CallIntegrationLink($integrationLinkId , $params , $versionFilter , $waitForReply) : Any

Parameters

  • $integrationLinkId (mandatory)
    The id of the integration link the message must be sent to.
    Type: String
    Example: 'route1'
  • $params (mandatory)
    The parameter assignments for the integration link
    Type: Any:mapped
    Example: $params
  • $versionFilter (mandatory)
    The version filter used for processing the exchange, null for inheriting the version filter.
    Type: String
    Example: HeadFilter
    LatestCommittedFilter
  • $waitForReply (mandatory)
    Wait for a reply. True: do wait, false: do not wait (default).
    Type: Boolean
    Example: true

Return Value

  • Send a message through the message routing system.
    Type: Any

Examples

CallIntegrationLink($linkId, $params, $versionFilter, $waitForReply)

CallOracleProcedure

Return the result of the given SQL call to an Oracle Procedure.

Signature


CallOracleProcedure($datasource , $query , $attributes , $limit) : Any:indexed

Parameters

  • $datasource (mandatory)
    The name of the datasource.
    Type: String
    Example: 'nmruntime'
  • $query (mandatory)
    The SQL query.
    Type: String
    Example: 'Begin TESTS.CURSOR_TEST (?, ?); End;'
  • $attributes (optional)
    The attributes of the query for a callablestatement.
    Type: Any:indexed
    Example: $theAttributes
  • $limit (optional)
    Limit the number of results (default 0, no limit).
    Type: java.lang.Integer
    Example: 100

Return Value

  • Return the result of the given SQL call to an Oracle Procedure.
    Type: Any:indexed

Examples

CallOracleProcedure('xe', 'Begin TESTS.CURSOR_TEST (?, ?); End;', [{'type'='in', 'value'='2'}:Any, {'type'='out/cursor'}:Any]:Any)

CancelProcessInstance

Cancel a Process Instance.

Signature


CancelProcessInstance($processInstanceId) : Nothing

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '129409273901'

Return Value

  • Type: Nothing

Examples

CancelProcessInstance('129409273901')

CapitalizeTitle

Capitalize titles properly according to US rules. To change the list of words which should not be capitalized, edit configuration property nm.titlecapitalization.smallwords

Signature


CapitalizeTitle($string) : String

Parameters

  • $string (mandatory)
    A title with random capitalization.
    Type: String
    Example: 'this is A great title'

Return Value

  • Properly capitalized title.
    Type: String

Examples


CapitalizeTitle('this is A great title')='This Is a Great Title'

CAST

The value of the second parameter.

Signature


CAST($type , $theObject) : Any

Parameters

  • $type (mandatory)
    The type we want to cast to.
    Type: Any
    Example: Person
    Indexed Person
    Named Person
    'Person:none'
    'Person:indexed'
    'Person:mapped'
  • $theObject (mandatory)
    The object that should be casted.
    Type: Any
    Example: $entity

Return Value

  • The value of the second parameter.
    Type: Any

Examples

CAST(Employee, $theObject)

Catalog:NewReference

Creates a Business Object Reference of type Catalog:Reference.

Signature


Catalog:NewReference($id) : Catalog:Reference

Parameters

  • $id (mandatory)
    Catalog ID.
    Type: String
    Example: 'myCatalog'

Return Value

  • Creates a Business Object Reference of type Catalog:Reference.
    Type: Catalog:Reference

Examples

Catalog:NewReference('myCatalog')

CatalogueDelete

Deletes the row with the given id from the given Catalog. This function will only operate on a Catalog with a Static Catalog Source. The edited Catalog will not be committed.

Signature


CatalogueDelete($catalogRef , $rowid) : Nothing

Parameters

  • $catalogRef (mandatory)
    Catalog Reference.
    Type: Catalog:Reference
    Example: Catalog:NewReference('Countries')
  • $rowid (mandatory)
    The Id of the row to be deleted.
    Type: String
    Example: '12'

Return Value

  • Deletes the row with the given id from the given Catalog. This function will only operate on a Catalog with a Static Catalog Source. The edited Catalog will not be committed.
    Type: Nothing

Examples

CatalogueDelete($catalog, $rowid)

CatalogueUpdate

Update the entry in the given Catalog with the given id using the given key value pairs. This function will only operate on a Catalog with a Static Catalog Source. The edited Catalog will not be committed.

Signature


CatalogueUpdate($catalogRef , $rowId , $propertyMap) : Record

Parameters

  • $catalogRef (mandatory)
    Catalog Reference.
    Type: Catalog:Reference
    Example: Catalog:NewReference('Countries')
  • $rowId (mandatory)
    The Id of the row to be updated. If this Id is null a new row will be inserted with newId=MAX(id)+1.
    Type: String
    Example: '12'
  • $propertyMap (mandatory)
    The name value pairs that hold the information for the Catalog.
    Type: String:mapped
    Example: $map

Return Value

  • Update the entry in the given Catalog with the given id using the given key value pairs. This function will only operate on a Catalog with a Static Catalog Source. The edited Catalog will not be committed.
    Type: Record

Examples

CatalogueUpdate($catalog, $rowid, $propertymap)

CEIL

Round the given value to the next higher integer.

Signature


CEIL($value) : Integer

Parameters

  • $value (mandatory)
    The value that must be rounded.
    Type: Double
    Example: 1.234

Return Value

  • Round the given value to the next higher integer.
    Type: Integer

Examples


CEIL(1.234)=2

CHAR

Returns the character for the given decimal number.

Signature


CHAR($number) : String

Parameters

  • $number (mandatory)
    Decimal character value (Unicode code point).
    Type: Integer
    Example: 65

Return Value

  • String with single character.
    Type: String

Examples


CHAR(65) = 'A'

CHECKACCESSLICENSE

Test if the current User has a valid Access License for the given Module (default: Workspace). If there is no Access License assigned to this User but there are free Access Licenses, the function may assign one (default: false).

Signature


CHECKACCESSLICENSE($userId , $module , $assign) : Boolean

Parameters

  • $userId (mandatory)
    User Id.
    Type: String
    Example: USERID()
  • $module (optional)
    Module.
    Type: String
    Example: 'Workspace'
  • $assign (optional)
    Whether to assign an Access License to the User or not.
    Type: Boolean
    Example: false

Return Value

  • Returns true if the User has a valid Access License.
    Type: Boolean

Examples

CHECKACCESSLICENSE(USERID(), 'Workspace', false)

CHECKSYNTAX

Return true if the given expression is syntactically correct.

Signature


CHECKSYNTAX($expression) : Boolean

Parameters

  • $expression (mandatory)
    A string.
    Type: String
    Example: '$hello.how.are.you'

Return Value

  • True if the given expression is syntactically correct.
    Type: Boolean

Examples

CHECKSYNTAX('true') == true
CHECKSYNTAX('$you.say.hello - $i.say.goodbye') == true
CHECKSYNTAX('$1 + @rubish') == false

CLEANDIRECTORY

Cleans a directory (deleting its content). Relative paths are interpreted relative to the Data Home.

Signature


CLEANDIRECTORY($path) : Boolean

Parameters

  • $path (mandatory)
    The directory to clean.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

CLEANDIRECTORY('uploads/2006')

CLONE

Create a clone of the given data entity.

Signature


CLONE($dataEntity , $deepClone , $cloneMetaData) : Any

Parameters

  • $dataEntity (mandatory)
    The data entity which must be copied.
    Type: Any
    Example: $person[1]
  • $deepClone (optional)
    True (make a deep clone even of substructures), false (copies substructures).
    Type: Boolean
    Example: false
  • $cloneMetaData (optional)
    Indicates whether the metadata should be cloned as well (default is false).
    Type: Boolean
    Example: false

Return Value

  • Create a clone of the given data entity.
    Type: Any

Examples

CLONE($person[1])

Cluster:IsLocalKey

Check if the provided key is owned by the local node. If so, true is returned, false otherwise.

Signature


Cluster:IsLocalKey($key) : Boolean

Parameters

  • $key (mandatory)
    The key to be checked.
    Type: String
    Example: $key

Return Value

  • True if the provided key is owned by the cluster node where the function is invoked, false otherwise.
    Type: Boolean

Examples

Cluster:IsLocalKey($key)

ClusterCache:Clear

Remove all objects from the cluster cache.

Signature


ClusterCache:Clear() : Nothing

Parameters
None
Return Value

  • Remove all objects from the cluster cache.
    Type: Nothing

Examples

ClusterCache:Clear()

ClusterCache:ExistsEntry

Return true if the object exists in the cluster cache, false otherwise. The retention expression is not taken into consideration, so the entry can exist even if it is not valid.

Signature


ClusterCache:ExistsEntry($name) : Boolean

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Return true if the object exists in the cluster cache, false otherwise. The retention expression is not taken into consideration, so the entry can exist even if it is not valid.
    Type: Boolean

Examples

ClusterCache:ExistsEntry('myobject')

ClusterCache:GetEntry

Return the object with the given name in the cluster cache.

Signature


ClusterCache:GetEntry($name) : Any

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Return the object with the given name in the cluster cache.
    Type: Any

Examples

$cachedObject := ClusterCache:GetEntry('myobject')

ClusterCache:ListEntryNames

Return an indexed collection of all object names in the cluster cache. The retention expression is not taken into consideration, so entries can exist even if they are not valid.

Signature


ClusterCache:ListEntryNames($pattern) : String:indexed

Parameters

  • $pattern (optional)
    Optional regex pattern to match names against.
    Type: String
    Example: user.*

Return Value

  • Return an indexed collection of all object names in the cluster cache. The retention expression is not taken into consideration, so entries can exist even if they are not valid.
    Type: String:indexed

Examples

$names := ClusterCache:ListEntryNames('user.*')

ClusterCache:RemoveEntry

Remove the object with the given name from the cluster cache.

Signature


ClusterCache:RemoveEntry($name) : Any

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Remove the object with the given name from the cluster cache.
    Type: Any

Examples

ClusterCache:RemoveEntry('myobject')

ClusterCache:StoreEntry

Store the given object with the given name in the cluster cache. If no timeToLive (optional parameter) is given, or it is -1, the entry will be removed from the cache after the default time-to-live as configured in nm.cluster.cache.ttl.

Signature


ClusterCache:StoreEntry($name , $object , $retentionExpression , $timeToLive) : Any

Parameters

  • $name (mandatory)
    The name of the object to cache.
    Type: String
    Example: 'myobject'
  • $object (mandatory)
    The object to be stored in the cache.
    Type: Any
    Example: $object
  • $retentionExpression (optional)
    An expression that returns true as long as the object is valid. The expression may use the implicit variable $insertTimestamp (Long, the time when the object was stored or updated in the cluster cache in milliseconds) to make the decision.
    Type: Any
    Example: true
  • $timeToLive (optional)
    the amount of time in seconds after which the cluster cache entry should be removed. If you supply 0, the entry will never expire (until the system is shutdown). If no timeToLive is given, or it is -1, the default time-to-live as configured in nm.cluster.cache.ttl will be used.
    Type: Long
    Example: 1200

Return Value

  • Store the given object with the given name in the cluster cache. If no timeToLive (optional parameter) is given, or it is -1, the entry will be removed from the cache after the default time-to-live as configured in nm.cluster.cache.ttl.
    Type: Any

Examples

ClusterCache:StoreEntry('myobject', $object)

ClusterCacheClear (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ClusterCache:Clear instead.

Signature


ClusterCacheClear() : Nothing

Parameters
None
Return Value

  • Remove all objects from the cluster cache.
    Type: Nothing

Examples

ClusterCacheClear()

ClusterCacheLookup (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ClusterCache:GetEntry instead.

Signature


ClusterCacheLookup($name) : Any

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Return the object with the given name in the cluster cache.
    Type: Any

Examples

$cachedObject := ClusterCacheLookup('myobject')

ClusterCacheNames (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ClusterCache:ListEntryNames instead.

Signature


ClusterCacheNames($pattern) : String:indexed

Parameters

  • $pattern (optional)
    Optional regex pattern to match names against.
    Type: String
    Example: user.*

Return Value

  • Return an indexed collection of all object names in the cluster cache. The retention expression is not taken into consideration, so entries can exist even if they are not valid.
    Type: String:indexed

Examples

$names := ClusterCacheNames('user.*')

ClusterCacheRemove (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ClusterCache:RemoveEntry instead.

Signature


ClusterCacheRemove($name) : Any

Parameters

  • $name (mandatory)
    The name of the cached object.
    Type: String
    Example: 'myobject'

Return Value

  • Remove the object with the given name from the cluster cache.
    Type: Any

Examples

ClusterCacheRemove('myobject')

ClusterCacheStore (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ClusterCache:StoreEntry instead.

Signature


ClusterCacheStore($name , $object , $retentionExpression , $timeToLive) : Any

Parameters

  • $name (mandatory)
    The name of the object to cache.
    Type: String
    Example: 'myobject'
  • $object (mandatory)
    The object to be stored in the cache.
    Type: Any
    Example: $object
  • $retentionExpression (optional)
    An expression that returns true as long as the object is valid. The expression may use the implicit variable $insertTimestamp (Long, the time when the object was stored or updated in the cluster cache in milliseconds) to make the decision.
    Type: Any
    Example: true
  • $timeToLive (optional)
    the amount of time in seconds after which the cluster cache entry should be removed. If you supply 0, the entry will never expire (until the system is shutdown). If no timeToLive is given, or it is -1, the default time-to-live as configured in nm.cluster.cache.ttl will be used.
    Type: Long
    Example: 1200

Return Value

  • Store the given object with the given name in the cluster cache. If no timeToLive (optional parameter) is given, or it is -1, the entry will be removed from the cache after the default time-to-live as configured in nm.cluster.cache.ttl.
    Type: Any

Examples

ClusterCacheStore('myobject', $object)

CollectDependencies

Collects all outgoing dependencies starting at a given business object until a specific pattern has been reached.

Signature


CollectDependencies($startingObject , $stoppingPattern , $customListName , $clearCustomList , $versionFilter) : Nothing

Parameters

  • $startingObject (mandatory)
    BusinessObject to start at.
    Type: String
    Example: Workflow:AccountOpening
  • $stoppingPattern (mandatory)
    BusinessObject pattern to stop digging further at. This is checked against a dependency chain built up in the pattern ObjectType:ObjectId/NextObjectType:NextObjectId/., i.e. Workflow:Portal/Screen:Portal/Screen:IncludePortalWorklist/Resource:IconDelete.
    Type: String
    Example: Screen:Template[^/]*/Workflow
  • $customListName (mandatory)
    Name of a custom list to add the encountered objects to.
    Type: String
    Example: AccountOpeningObjects
  • $clearCustomList (optional)
    If true, the custom list is first cleared.
    Type: Boolean
    Example: true
  • $versionFilter (optional)
    VersionFilter to use (default: current VF).
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter('HeadFilter')

Return Value

  • Collects all outgoing dependencies starting at a given business object until a specific pattern has been reached.
    Type: Nothing

Examples

CollectDependencies()

Collection:AddAllElements

Appends all the elements of the Indexed collection $source to the Indexed collection $target. Collection $target may contain duplicated elements. The $source collection must be of a type compatible with $target collection.E. g. if $target is of type Any, $source can be of any type; if $target is of type String, $source must be of type String; if $target is of type Person and $source is of type Client, where Client is a child Data Class of Person, then you can add elements from $source, while if $source is of type Car, which is not a child Data Class of Person, then you cannot add elements from $source. The given Indexed collections cannot be null.

Signature


Collection:AddAllElements($target , $source) : Nothing

Parameters

  • $target (mandatory)
    Target Indexed collection.
    Type: Any:indexed
    Example: $target
  • $source (mandatory)
    Source Indexed collection.
    Type: Any:indexed
    Example: $source

Return Value

  • Adds all the elements of an Indexed collection to another.
    Type: Nothing

Examples

Collection:AddAllElements($target, $source)

Collection:AddElement

Adds the given element to the given Indexed collection. Specifically, it inserts the element in the given position by shifting up all the elements from position $index by one position. If no position exists for the given index, it creates all the positions between the last element in the indexed and the specified position. The $index param is optional, since it indicates that the element is added in the last position. Indices start from 1. Collection cannot be null.

Signature


Collection:AddElement($collection , $element , $index) : Nothing

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $element (mandatory)
    Object to be added to the collection.
    Type: Any
    Example: $person
  • $index (optional)
    Index where the object has to be added.
    Type: Integer
    Example: $index
    1

Return Value

  • Adds an element to an Indexed collection.
    Type: Nothing

Examples

Collection:AddElement($persons, $person)
Collection:AddElement($persons, $person, $index)

Collection:ContainsElement

Checks if the given Indexed or Named collection contains the given element at least once. The given collection can be null.

Signature


Collection:ContainsElement($collection , $element) : Boolean

Parameters

  • $collection (mandatory)
    Indexed or Named collection; if a null collection is provided, it is treated as an empty collection.
    Type: Any:indexed
    Example: $persons
    $addresses
  • $element (mandatory)
    Element to be found in the given collection.
    Type: Any
    Example: $person
    $address

Return Value

  • Returns true if the element is contained in the Indexed or Named collection; false otherwise or if the collection is null.
    Type: Boolean

Examples

Collection:ContainsElement($persons, $person)
Collection:ContainsElement($addresses, $address)

Collection:Difference

Returns the difference between two Indexed collections. Given Indexed collections cannot be null. The returned new Indexed collection contains all the elements that are contained in $collection1 and not contained in $collection2. Indexed $collection2 may also contain elements not present in $collection1; these are simply ignored. The iteration order of the returned Indexed collection matches that of $collection1. The returned Indexed collection has the type declared in by $collection1. Result of the difference operation is undefined if $collection1 and $collection2 are based on different equivalence relations (since contains elements of different types).

Signature


Collection:Difference($collection1 , $collection2) : Any:indexed

Parameters

  • $collection1 (mandatory)
    First Indexed collection.
    Type: Any:indexed
    Example: $addresses
  • $collection2 (mandatory)
    Second Indexed collection.
    Type: Any:indexed
    Example: $amendedAddresses

Return Value

  • Returns a new Indexed collection that is the difference of the first with the second collection.
    Type: Any:indexed

Examples

Collection:Difference($addresses, $amendedAddresses)

Collection:Filter

Filters a given Indexed collection according to the given filter expression. The given Indexed collection cannot be null.

Signature


Collection:Filter($collection , $filter , $itemVariable , $inPlace) : Any:indexed

Parameters

  • $collection (mandatory)
    Indexed collection to be filtered.
    Type: Any:indexed
    Example: $indexed
  • $filter (mandatory)
    The filter expression.
    Type: Boolean
    Example: $item > 2
  • $itemVariable (optional)
    Optional name of the variable used for a single item of the list while applying the filter. The default value is $item.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $item
  • $inPlace (optional)
    Optional flag to apply the filtering in place. The default value is false. If set to true, the collection is filtered in place.
    Type: Boolean
    Example: false

Return Value

  • Filters a given Indexed collection according to the given filter expression.
    Type: Any:indexed

Examples

Collection:Filter($indexed, $item > 2, $item, $inPlace)

Collection:GetIndexOf

Gets the index of an element in an Indexed collection. If the element is not contained in the collection or the collection is null, then -1 is returned.

Signature


Collection:GetIndexOf($collection , $element) : Integer

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $element (mandatory)
    Element to be found in the collection.
    Type: Any
    Example: $person

Return Value

  • Returns the index of the element in the Indexed collection; -1, if the element is not found or the collection is null.
    Type: Integer

Examples

Collection:GetIndexOf($persons, $person)

Collection:HasName

Checks if the given Named collection has the given name. The given collection can be null.

Signature


Collection:HasName($collection , $name) : Boolean

Parameters

  • $collection (mandatory)
    Named collection.
    Type: Any:mapped
    Example: $addresses
  • $name (mandatory)
    Name to be checked against the Named collection.
    Type: String
    Example: 'Main'

Return Value

  • Returns true if the Named collection contains an entry with the given name; false otherwise or if the collection is null.
    Type: Boolean

Examples

Collection:HasName($addresses, 'Main')

Collection:Intersection

Returns an Indexed collection containing the intersection of two Indexed collections. Given Indexed collections cannot be null. The returned new Indexed collection contains all the elements that are contained both in $collection1 and in $collection2. The type of the returned collection is the one of the closest ancestor of the given collection types, or Any if the given types are unrelated. The cardinality of each element in the returned Indexed collection is equal to the minimum cardinality of that element in the two given collections. There is no specific sorting of elements in the returned collection.

Signature


Collection:Intersection($collection1 , $collection2) : Any:indexed

Parameters

  • $collection1 (mandatory)
    First Indexed collection.
    Type: Any:indexed
    Example: $oldAddresses
  • $collection2 (mandatory)
    Second Indexed collection.
    Type: Any:indexed
    Example: $updatedAddresses

Return Value

  • Returns the intersection of the two Indexed collections.
    Type: Any:indexed

Examples

Collection:Intersection($oldAddresses, $updatedAddresses)

Collection:LegacyGetIndexOfElement (Deprecated)

Gets the index of an element in an Indexed collection. Given Indexed collection cannot be null. If the element is not contained in the collection, then 0 is returned. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2023 OR LATER. Use Collection:GetIndexOf instead. Beware that Collection:GetIndexOf returns -1 when the element is not found.

Signature


Collection:LegacyGetIndexOfElement($collection , $element) : Integer

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $element (mandatory)
    Element to be found in the collection.
    Type: Any
    Example: $person

Return Value

  • Returns the index of the element in the Indexed collection; 0, if the element is not found.
    Type: Integer

Examples

Collection:LegacyGetIndexOfElement($persons, $person)

Collection:ListIndicesOf

Given an Indexed collection and an object, returns an Integer:indexed with all the indices matching the given object or an empty Indexed collection if no indices exist for the given object. The given collection can be null.

Signature


Collection:ListIndicesOf($collection , $object) : Integer:indexed

Parameters

  • $collection (mandatory)
    Indexed collection to search for indices.
    Type: Any:indexed
    Example: $persons
  • $object (mandatory)
    Object to search for indices.
    Type: Any
    Example: $person

Return Value

  • Lists all the indices matching the given object in the given Indexed collection.
    Type: Integer:indexed

Examples

Collection:ListIndicesOf($collection, $object)

Collection:ListNames

Gets all the names in a Named collection. The given collection can be null.

Signature


Collection:ListNames($collection) : String:indexed

Parameters

  • $collection (mandatory)
    Named collection.
    Type: Any:mapped
    Example: $persons

Return Value

  • Get all the names in the Named collection.
    Type: String:indexed

Examples

Collection:ListNames($persons)

Collection:ListNamesOf

Given a Named collection and an object, returns a String:indexed with all the names matching the given object, or an empty Indexed collection if no names exist for the given object or the given Named collection is null.

Signature


Collection:ListNamesOf($collection , $object) : String:indexed

Parameters

  • $collection (mandatory)
    Named collection to search for names.
    Type: Any:mapped
    Example: $persons
  • $object (mandatory)
    Object to search for names.
    Type: Any
    Example: $person

Return Value

  • Lists all the names matching the given object in the given Named collection.
    Type: String:indexed

Examples

Collection:ListNamesOf($collection, $object)

Collection:ListValues

Gets all the values of a Named collection. Returns an Indexed collection with the same type as the given Named Collection. The given Named collection cannot be null.

Signature


Collection:ListValues($collection) : Any:indexed

Parameters

  • $collection (mandatory)
    Named collection.
    Type: Any:mapped
    Example: $persons

Return Value

  • Gets all the elements in the Named collection.
    Type: Any:indexed

Examples

Collection:ListValues($persons)

Collection:Map

Applies a transformation expression to every element in an Indexed collection, and returns a new Indexed collection containing the newly created elements. The given Indexed collection cannot be null.

Signature


Collection:Map($collection , $transformation , $variable , $type) : Any:indexed

Parameters

  • $collection (mandatory)
    Indexed collection to be transformed.
    Type: Any:indexed
    Example: $persons
  • $transformation (mandatory)
    Transformation expression.
    Type: Any
    Example: $person.FullName()
  • $variable (optional)
    Transformation variable, default is $item.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $person
  • $type (optional)
    Data Type of the elements in the transformed collection, default is 'Any'.
    Type: String
    Example: 'String'

Return Value

  • Transformed Indexed collection.
    Type: Any:indexed

Examples

Collection:Map($persons, $person.FullName(), $person, 'String')

Collection:Map(['peter','john','sam'], LENGTH($item), $item, 'Integer') = [5, 4, 3]

Collection:Merge

Merge the elements of the Named collection $source to the Named collection $target. The $source collection must be of a type compatible with $target collection.E. g. if $target is of type Any, $source can be of any type; if $target is of type String, $source must be of type String; if $target is of type Person and $source is of type Client, where Client is a child Data Class of Person, then you can merge elements from $source, while if $source is of type Car, which is not a child Data Class of Person, then you cannot merge elements from $source. The given Named collections cannot be null.

Signature


Collection:Merge($target , $source) : Nothing

Parameters

  • $target (mandatory)
    Target Named collection.
    Type: Any:mapped
    Example: $targetCollection
  • $source (mandatory)
    Source Named collection.
    Type: Any:mapped
    Example: $sourceCollection

Return Value

  • Merge all the elements of a Named collection with another.
    Type: Nothing

Examples

Collection:Merge($target, $source)

Collection:RemoveAllElements

Removes all the elements of the given Indexed or Named collection. The given collection cannot be null.

Signature


Collection:RemoveAllElements($collection) : Nothing

Parameters

  • $collection (mandatory)
    Indexed or Named collection.
    Type: Any:indexed
    Example: $persons

Return Value

  • Removes all the elements of an Indexed or Named collection.
    Type: Nothing

Examples

Collection:RemoveAllElements($persons)

Collection:RemoveElement (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. Use Collection:RemoveElementAtIndex, Collection:RemoveElementWithName instead. Removes a specific element in the given index/name of the given Indexed/Named collection and returns the removed element (or null if none was found). The removal of an element of an Indexed collection before the current size of the collection shifts down all the elements after that position by one. Collection cannot be null.

Signature


Collection:RemoveElement($collection , $index or name) : Any

Parameters

  • $collection (mandatory)
    Indexed or Named collection.
    Type: Any:indexed
    Example: $persons
    $addresses
  • $index or name (mandatory)
    Index or name from which the element is to be removed.
    Type: Integer
    Example: 5
    'Main'

Return Value

  • Returns the removed element in the Indexed or Named collection, or null if none was found or if the element was null.
    Type: Any

Examples

Person $personAtIndex5 := Collection:RemoveElement($persons, 5)
Address $addressWithNameMain := Collection:RemoveElement($addresses, 'Main')

Collection:RemoveElementAtIndex

Removes a specific element in the given index of the given Indexed collection and returns the removed element (or null if none was found). The removal of an element of an Indexed collection before the current size of the collection shifts down all the elements after that position by one. Collection cannot be null.

Signature


Collection:RemoveElementAtIndex($collection , $index or name) : Any

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $index or name (mandatory)
    Index from which the element is to be removed.
    Type: Integer
    Example: 5

Return Value

  • Returns the removed element in the Indexed collection, or null if none was found or if the element was null.
    Type: Any

Examples

Person $personAtIndex5 := Collection:RemoveElementAtIndex($persons, 5)

Collection:RemoveElementFromIndexed

Removes the given element from the given Indexed collection and returns the removed element (or null if none was found). If the element is found more than once, only the first occurrence is removed. Collection cannot be null.

Signature


Collection:RemoveElementFromIndexed($collection , $element) : Any

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $element (mandatory)
    Element to be found and removed from the collection.
    Type: Any
    Example: $person

Return Value

  • Returns the removed element in the Indexed collection, or null if none was found or if the element was null.
    Type: Any

Examples

Person $removedPerson := Collection:RemoveElementFromIndexed($persons, $person)

Collection:RemoveElementWithName

Removes a specific element in the given name of the given Named collection and returns the removed element (or null if none was found). Collection cannot be null.

Signature


Collection:RemoveElementWithName($collection , $index or name) : Any

Parameters

  • $collection (mandatory)
    Named collection.
    Type: Any:mapped
    Example: $addresses
  • $index or name (mandatory)
    Name from which the element is to be removed.
    Type: String
    Example: 'Main'

Return Value

  • Returns the removed element in the Named collection, or null if none was found or if the element was null.
    Type: Any

Examples

Address $addressWithNameMain := Collection:RemoveElementWithName($addresses, 'Main')

Collection:Reverse

Reverses the items of an Indexed collection. Given Indexed collection cannot be null. By default, a new collection is returned. Set the 'inplace' parameter to true to reverse the original collection.

Signature


Collection:Reverse($collection , $inplace) : Any:indexed

Parameters

  • $collection (mandatory)
    Indexed collection whose items are to be reversed.
    Type: Any:indexed
    Example: $persons
  • $inplace (optional)
    If set to true, the collection is reversed in place; otherwise a new Indexed collection containing the elements in reversed order is returned. Default value is false.
    Type: Boolean
    Example: false

Return Value

  • Returns the reversed collection.
    Type: Any:indexed

Examples

Collection:Reverse($persons)
Collection:Reverse($persons, true)

Collection:SetElement (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. Use Collection:SetElementAtIndex, Collection:SetElementWithName instead. Sets the given element in the given index/name of the given Indexed/Named collection. Replaces any element in the given index or name if the position exists; otherwise, for Indexed collections it creates all the positions between the last element in the collection and the specified position by setting null entries. Indexed indices start from 1. Named names should not be null. Collection cannot be null.

Signature


Collection:SetElement($collection , $index or $name , $element) : Nothing

Parameters

  • $collection (mandatory)
    Indexed or Named Collection.
    Type: Any:indexed
    Example: $persons
    $addresses
  • $index or $name (mandatory)
    Index or Name where the element is set.
    Type: Integer
    Example: 5
    'Main'
  • $element (mandatory)
    Element to be set in the collection.
    Type: Any
    Example: $person
    $address

Return Value

  • Sets an element in an Indexed or Named Collection.
    Type: Nothing

Examples

Collection:SetElement($persons, 5, $person)
Collection:SetElement($addresses, 'Main', $address)

Collection:SetElementAtIndex

Sets the given element in the given index of the given Indexed collection. Replaces any element in the given index or name if the position exists; otherwise, it creates all the positions between the last element in the collection and the specified position by setting null entries. Indexed indices start from 1. Collection cannot be null.

Signature


Collection:SetElementAtIndex($collection , $index , $element) : Nothing

Parameters

  • $collection (mandatory)
    Indexed Collection.
    Type: Any:indexed
    Example: $persons
  • $index (mandatory)
    Index where the element is set.
    Type: Integer
    Example: 5
  • $element (mandatory)
    Element to be set in the collection.
    Type: Any
    Example: $person

Return Value

  • Sets an element in an Indexed Collection.
    Type: Nothing

Examples

Collection:SetElementAtIndex($persons, 5, $person)

Collection:SetElementWithName

Sets the given element in the given name of the given Named collection. Replaces any element in the given name if the position exists; Named names should not be null. Collection cannot be null.

Signature


Collection:SetElementWithName($collection , $name , $element) : Nothing

Parameters

  • $collection (mandatory)
    Named Collection.
    Type: Any:mapped
    Example: $addresses
  • $name (mandatory)
    Name where the element is set.
    Type: String
    Example: 'Main'
  • $element (mandatory)
    Element to be set in the collection.
    Type: Any
    Example: $address

Return Value

  • Sets an element in a Named Collection.
    Type: Nothing

Examples

Collection:SetElementWithName($addresses, 'Main', $address)

Collection:Size

Gets the size of the given Indexed or Named Collection. Returns 0 for both null and empty collections.

Signature


Collection:Size($collection) : Integer

Parameters

  • $collection (mandatory)
    Indexed or Named Collection whose size is returned.
    Type: Any:indexed
    Example: $indexed
    $named

Return Value

  • Gets the size of the given Indexed or Named Collection.
    Type: Integer

Examples

Collection:Size($indexed)
Collection:Size($named)

Collection:Sort

Sorts an Indexed collection using a custom Comparator Function. Given Indexed collection can be null.

Signature


Collection:Sort($collection , $function , $variable1 , $variable2 , $inplace , $ignoreComparisonErrors) : Any:indexed

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $function (mandatory)
    Name of Comparator Function or Comparator Expression.
    Type: Any
    Example: 'PERSONSORT'
    $person1.age - $person2.age
  • $variable1 (optional)
    Variable 1.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $person1
  • $variable2 (optional)
    Variable 2.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $person2
  • $inplace (optional)
    If set to true, the collection is sorted in place.
    Type: Boolean
    Example: false
  • $ignoreComparisonErrors (optional)
    If set to true, exceptions during comparison will be ignored.
    Type: Boolean
    Example: false

Return Value

  • Sorts an Indexed collection.
    Type: Any:indexed

Examples

Collection:Sort($persons, 'PERSONSORT')
Collection:Sort($persons, $person.age, $person)
Collection:Sort($persons, $person1.age - $person2.age, $person1, $person2)

Collection:Union

Returns an Indexed collection containing the union of the given collections. Given Indexed collections cannot be null. The type of the returned collection is the one of the closest ancestor of the given collection types, or Any if the given types are unrelated. The cardinality of each element in the returned collection is equal to the maximum cardinality of that element in the two given collections. There is no specific sorting of elements in the returned collection.

Signature


Collection:Union($collection1 , $collection2) : Any:indexed

Parameters

  • $collection1 (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $oldAddresses
  • $collection2 (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $updatedAddresses

Return Value

  • Returns the Union of the two Indexed collections.
    Type: Any:indexed

Examples

Collection:Union($oldAddresses, $updatedAddresses)

CommitBusinessObject

Commit the businessobject with the given id and type, return true if commited.

Signature


CommitBusinessObject($id , $type , $comment) : Boolean

Parameters

  • $id (mandatory)
    The id of the business object.
    Type: String
    Example: 'NofiyOwners'
  • $type (mandatory)
    The type of the business object.
    Type: String
    Example: 'Rule'
  • $comment (optional)
    The commit comment.
    Type: String
    Example: 'very well'

Return Value

  • Commit the businessobject with the given id and type, return true if commited.
    Type: Boolean

Examples

CommitBusinessObject($id, $type)

CommitBusinessObjects

Commit the business objects given in the indexed collection parameter as object version references, return true if committed.

Signature


CommitBusinessObjects($objectVersionRefs , $comment) : Boolean

Parameters

  • $objectVersionRefs (mandatory)
    Indexed collection of type Any with ObjectVersionRef for the objects to be committet.
    Type: Any:indexed
    Example: SelectBusinessObjects(null,'UncommittetFilter')
  • $comment (optional)
    The commit comment.
    Type: String
    Example: 'very well'

Return Value

  • Commit the business objects given in the indexed collection parameter as object version references, return true if committed.
    Type: Boolean

Examples

CommitBusinessObjects($businessObjectsList, $comment)

CommitProcessInstance

Commit thread-local changes related to the given process instance.

Signature


CommitProcessInstance($processInstanceId) : Nothing

Parameters

  • $processInstanceId (mandatory)
    The ID of the process instance to commit.
    Type: String
    Example: '1414515505935'

Return Value

  • Commit thread-local changes related to the given process instance.
    Type: Nothing

Examples

CommitProcessInstance('1414515505935')

COMPONENTPATH

Returns the current component path. If the function is not called in a Screen context, null is returned.

Signature


COMPONENTPATH() : String

Parameters
None
Return Value

  • Component Path.
    Type: String

Examples


COMPONENTPATH() = '/root/3/2/root/4/[5]/10'

CompressFile

Compresses a file.

Signature


CompressFile($sourcePath , $targetPath , $method) : Nothing

Parameters

  • $sourcePath (mandatory)
    The path to the file to compress.
    Type: String
    Example: 'work/tmp/mydatafile.xml'
  • $targetPath (mandatory)
    The path to the compressed file to write.
    Type: String
    Example: 'work/tmp/mydatafile.gz'
  • $method (optional)
    The compression method ('gz' or 'bzip2'). Default = 'gz'.
    Type: String
    Example: 'gz'

Return Value

  • Compresses a file.
    Type: Nothing

Examples

CompressFile($sourcePath, $targetPath)

CONCAT

Return the concatenation of the three arguments, i.e. a new string consisting of the three given strings.

Signature


CONCAT($arg1 , $arg2 , $arg3) : String

Parameters

  • $arg1 (mandatory)
    A string.
    Type: String
    Example: '1'
  • $arg2 (mandatory)
    A string added between the values of arg1 and arg3 if they are none empty.
    Type: String
    Example: '-'
  • $arg3 (mandatory)
    A string.
    Type: String
    Example: '2'

Return Value

  • The concatenation of the three arguments.
    Type: String

Examples


CONCAT('1','-','2')='1-2'


CONCAT('John',' ','Woo')='John Woo'

CONF

Get the configuration value associated to the given key, return the default value if the key was not found.

Signature


CONF($key , $default) : String

Parameters

  • $key (mandatory)
    The property name.
    Type: String
    Example: 'nm.data.home'
  • $default (optional)
    The default value, returned if the key is not found.
    Type: String
    Example: 'some value'

Return Value

  • The configuration value associated to the given key, return the default value if the key was not found.
    Type: String

Examples


CONF('nm.data.home','some value') = path to NM home

CONTAINS

Return true if the given string-delimited list contains the given element. Only use this function to compare lists; to compare strings, use the MATCH function.

Signature


CONTAINS($arg1 , $arg2 , $delim) : Boolean

Parameters

  • $arg1 (mandatory)
    The list string to search for arg2.
    Type: String
    Example: '1|2|3'
  • $arg2 (mandatory)
    Value to search for in arg1.
    Type: String
    Example: '2'
  • $delim (optional)
    The optional delimiter value, default is '|'.
    Type: String
    Example: '|'

Return Value

  • True if the string-delimited list arg1 contains arg2.
    Type: Boolean

Examples


CONTAINS('1|2|3','2','|')=true


CONTAINS('John;Jack;James','Jim',';')=false

CONTEXT (Deprecated)

Get the Nm context. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2026 OR LATER.

Signature


CONTEXT() : Any

Parameters
None
Return Value

  • Get the Nm context.
    Type: Any

Examples

CONTEXT()

CONTEXTPATH

Returns the web application's context path. If the web application doesn't have a context path, an empty string is returned. If the context path can not be determined (e.g. because the function is not called within a HTTP request context), null is returned.

Signature


CONTEXTPATH() : String

Parameters
None
Return Value

  • Context path of the web application.
    Type: String

Examples


CONTEXTPATH() = '/nm5'

ConvertImage

Convert an Image into an other format. Supported input formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP. Supported output formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP.

Signature


ConvertImage($file1 , $file2) : Nothing

Parameters

  • $file1 (mandatory)
    Input image file path.
    Type: String
    Example: 'uploads/image021.jpg'
  • $file2 (mandatory)
    Output image file path.
    Type: String
    Example: 'uploads/logo.png'

Return Value

  • Type: Nothing

Examples

ConvertImage($file1, $file2)

CopyBinaryDataToStream

Copies the given binary data to the given stream.

Signature


CopyBinaryDataToStream($data , $stream) : Nothing

Parameters

  • $data (mandatory)
    Base64 encoded binary data.
    Type: String
    Example: $data
  • $stream (mandatory)
    The stream to be copied to, i.e. HTTPRESPONSE(). GetOutputStream().
    Type: Any
    Example: HTTPRESPONSE().getOutputStream()

Return Value

  • Copies the given binary data to the given stream.
    Type: Nothing

Examples

CopyFileToStream($data, $stream)

COPYDIRECTORY

Copy a directory to a new location. If the target directory already exists, this function will merge the source directory into the target directory. If the parent directory of the target directory doesn't exist, it will be created. Relative paths are interpreted relative to the Data Home.

Signature


COPYDIRECTORY($sourcePath , $targetPath) : Boolean

Parameters

  • $sourcePath (mandatory)
    The directory to copy.
    Type: String
    Example: 'uploads/2006'
  • $targetPath (mandatory)
    The target location.
    Type: String
    Example: 'uploads/archive/2006'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

COPYDIRECTORY('uploads/2006', 'uploads/archive/2006')

COPYFILE

Copy a file to a new location. If the target file already exists, this function will overwrite it. If the target is a directory, a file with the same name like the source file will be created in it. If the directory of the target file doesn't exist, it will be created. Relative paths are interpreted relative to the Data Home.

Signature


COPYFILE($sourcePath , $targetPath) : Boolean

Parameters

  • $sourcePath (mandatory)
    The file to copy.
    Type: String
    Example: 'infos.xml'
  • $targetPath (mandatory)
    The target location.
    Type: String
    Example: 'content/infos.xml'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

COPYFILE('infos.xml', 'content/infos.xml')

CopyFileToStream

Copies the file at the given location to the given stream.

Signature


CopyFileToStream($filepath , $stream) : Nothing

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'work/tmp/mydatafile.bin'
  • $stream (mandatory)
    The stream to be copied to, i.e. HTTPRESPONSE(). GetOutputStream().
    Type: Any
    Example: HTTPRESPONSE().getOutputStream()

Return Value

  • Copies the file at the given location to the given stream.
    Type: Nothing

Examples

CopyFileToStream($filepath, $stream)

COS

Cosine.

Signature


COS($value) : Double

Parameters

  • $value (mandatory)
    Angle.
    Type: Double
    Example: PI()

Return Value

  • Cosine.
    Type: Double

Examples

COS(PI())

CREATEDIRECTORY

Create a directory. Parent directories are created if needed. If the directory already exists, this function does nothing. Relative paths are interpreted relative to the Data Home.

Signature


CREATEDIRECTORY($path) : Boolean

Parameters

  • $path (mandatory)
    The directory to create.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

CREATEDIRECTORY('uploads/2006')

CreateNotificationTopic

Create a notification topic with the given Id. If the topic already exists, a warning is logged.

Signature


CreateNotificationTopic($topic , $description , $name) : Nothing

Parameters

  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'new-american-client'
  • $description (optional)
    A user-readable description of the topic.
    Type: String
    Example: 'A new client from the US is onboarded.'
  • $name (optional)
    A user-readable name for the topic.
    Type: String
    Example: 'New American Client'

Return Value

  • Create a notification topic with the given Id. If the topic already exists, a warning is logged.
    Type: Nothing

Examples

CreateNotificationTopic('new-american-client')

CreateProcessInstanceIndex

Function that creates an index for process instances.

Signature


CreateProcessInstanceIndex($name , $type , $info) : Any

Parameters

  • $name (mandatory)
    Index name. Must be unique otherwise an exception will be thrown.
    Type: String
    Example: PIGroup
  • $type (mandatory)
    Index type. Must be one of the following: [ProcessInstanceMember, ProcessInstanceAttribute, ProcessTokenMember, ProcessTokenAttribute].
    Type: String
    Example: ProcessInstanceAttribute
  • $info (mandatory)
    Index info. The name or the name and the value of the field that needs to be indexed.E. g. 'group' or 'mustMatch=true'.
    Type: String
    Example: group

Return Value

  • Returns true if the index was created successfully.
    Type: Any

Examples

CreateProcessInstanceIndex($name, $type, $info)

CREATEPROTOTYPE

A null initialized object.

Signature


CREATEPROTOTYPE($className) : Any

Parameters

  • $className (mandatory)
    The name of the dataclass.
    Type: Any
    Example: Person

Return Value

  • A null initialized object.
    Type: Any

Examples

CREATEPROTOTYPE(ClassName)

CreateUser (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:Create instead.

Signature


CreateUser($userId) : User

Parameters

  • $userId (mandatory)
    The userId of the user to be created.
    Type: String
    Example: 'testUserId'

Return Value

  • Creates a User object. This function does not add a created user to the system. Use User:AddUser function for this.
    Type: User

Examples

CreateUser('userId')

CreateWorkflowToken

Signature


CreateWorkflowToken($workflowInstanceId , $elementId) : Boolean

Parameters

  • $workflowInstanceId (mandatory)
    Workflow Instance or Sub-Workflow Token Id.
    Type: String
    Example: $workitem.getWorkflowInstanceId()
  • $elementId (mandatory)
    Workflow Element Id.
    Type: Integer
    Example: 33

Return Value

  • Type: Boolean

Examples

CreateWorkflowToken($workflowTokenId)

CreateXmlDocument

Create a new XML document element.

Signature


CreateXmlDocument() : XmlDocument

Parameters
None
Return Value

  • Create a new XML document element.
    Type: XmlDocument

Examples

CreateXmlDocument

CropImage

Crop an image to a given area. Supported input formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP. Supported output formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP.

Signature


CropImage($file1 , $file2 , $top , $left , $width , $height) : Nothing

Parameters

  • $file1 (mandatory)
    Input image file path.
    Type: String
    Example: 'uploads/image021.jpg'
  • $file2 (mandatory)
    Output image file path (pass null to overwrite input file).
    Type: String
    Example: 'uploads/logo.jpg'
  • $top (mandatory)
    X position of clipping region.
    Type: Integer
    Example: 10
  • $left (mandatory)
    Y position of clipping region.
    Type: Integer
    Example: 10
  • $width (mandatory)
    Width of clipping region.
    Type: Integer
    Example: 200
  • $height (mandatory)
    Height of clipping region.
    Type: Integer
    Example: 120

Return Value

  • Type: Nothing

Examples

CropImage($file1, $file2, 10, 10, 200, 120)

CustomListById

Returns a CustomList given a CustomList ID.

Signature


CustomListById($customListId) : CustomList

Parameters

  • $customListId (mandatory)
    The CustomList's ID (note that this is different from its display name).
    Type: String
    Example: $myCustomList.getId()

Return Value

  • Returns a CustomList given a CustomList ID.
    Type: CustomList

Examples

$myNewCustomList := CustomListById($myCustomList.getId())

CustomListChildren

Given a CustomList, this function returns all of its children (i.e. CustomLists which appear immediately below the given CustomList in the Business Object Browser Custom List tree view).

Signature


CustomListChildren($customList) : CustomList:indexed

Parameters

  • $customList (mandatory)
    The CustomList whose children should be returned.
    Type: CustomList
    Example: $myCustomList

Return Value

  • Returns an Indexed List of CustomLists.
    Type: CustomList:indexed

Examples

$children := CustomListChildren($myCustomList)

CustomListContent

Given a CustomList, this function returns the BusinessObjects it contains (i.e. BusinessObjects which appear when clicking on the given CustomList in the Business Object Browser Custom List tree view).

Signature


CustomListContent($customList) : BusinessObject:indexed

Parameters

  • $customList (mandatory)
    The CustomList whose content should be returned.
    Type: CustomList
    Example: $myCustomList

Return Value

  • Returns an Indexed List of BusinessObjects.
    Type: BusinessObject:indexed

Examples

$content := CustomListContent($myCustomList)

CustomListRoot

Get an Indexed List containing all root Custom Lists.

Signature


CustomListRoot() : CustomList:indexed

Parameters
None
Return Value

  • Returns an Indexed List containing all root Custom Lists.
    Type: CustomList:indexed

Examples

CustomListRoot()

CustomProcessLogEntry (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 9 OR LATER. It always returns 0.

Signature


CustomProcessLogEntry($logLevel , $event , $value) : Long

Parameters

  • $logLevel (mandatory)
    Log level.
    Type: String
    Example: 'WorkflowInstance'
  • $event (mandatory)
    Event.
    Type: String
    Example: 'Forward'
  • $value (optional)
    Value.
    Type: Any
    Example: $forwardUser

Return Value

  • Create a custom log entry in the Process Log.
    Type: Long

Examples

CustomProcessLogEntry('WorkflowInstance', 'Forward', WORKFLOWINSTANCEID(), $forwardUser)

CypherText (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. Use EncryptText, DecryptText instead.

Signature


CypherText($text , $pw , $encrypt) : String

Parameters

  • $text (mandatory)
    The text to be en-/de-crypted.
    Type: String
    Example: 'Hello World'
  • $pw (optional)
    The cypher password.
    Type: String
    Example: 'mypw'
  • $encrypt (optional)
    If set to false the given text will be de-crypted otherwise en-crypted (default: true -> encryption).
    Type: Boolean
    Example: true

Return Value

  • Encrypt or Decrypt the given text.
    Type: String

Examples

CypherText($text, $encrypt)

DataClass:GetInstanceId

Returns the ID of the given Data Class instance. Please note: This ID is only stable within the current context, e.g. within the current Value Store or within a local Script execution. If a Data Class instance is stored outside the current context, e.g. in a Process Message, or if the Data Class instance is cloned, this ID might change.

Signature


DataClass:GetInstanceId($dataClassInstance) : String

Parameters

  • $dataClassInstance (mandatory)
    The Data Class instance for which the ID should be returned (must not be null). This can also be an instance of a Named or Indexed Collection or an instance of a Primitive Type.
    Type: Any
    Example: $person

Return Value

  • The ID of the given Data Class instance (never null).
    Type: String

Examples

DataClass:GetInstanceId($person)

DataClass:NewReference

Creates a Business Object Reference of type DataClass:Reference.

Signature


DataClass:NewReference($id) : DataClass:Reference

Parameters

  • $id (mandatory)
    DataClass ID.
    Type: String
    Example: 'myDataClass'

Return Value

  • Creates a Business Object Reference of type DataClass:Reference.
    Type: DataClass:Reference

Examples

DataClass:NewReference('myDataClass')

DataEntityDeepSearch

Searches for nested occurrences of data entities that match the filter expression and returns an indexed collection of the same type as the iteration variable.

Signature


DataEntityDeepSearch($root , $filter , $variable) : Any:indexed

Parameters

  • $root (mandatory)
    The root object where searching should start.
    Type: Any
    Example: $root
  • $filter (mandatory)
    The filter expression (should evaluate to Boolean).
    Type: Boolean
    Example: $item isa Person
  • $variable (mandatory)
    The iteration variable (needs to be defined beforehand).
    Type: Any
    Example: $item

Return Value

  • Searches for nested occurrences of data entities that match the filter expression and returns an indexed collection of the same type as the iteration variable.
    Type: Any:indexed

Examples

Indexed Person $allPeople := DataEntityDeepSearch($kyc, $item isa Person, $person, Person)

DataEntityToXml

Create an xml document from the given data entity.

Signature


DataEntityToXml($dataEntity) : XmlDocument

Parameters

  • $dataEntity (mandatory)
    The dataEntity to be put into a xml document.
    Type: Any
    Example: $dataEntity

Return Value

  • Create an xml document from the given data entity.
    Type: XmlDocument

Examples

DataEntityToXml($dataEntity)

DATAHANDLEURL

Build an URL to access a data handle given the type and id of the business object and the property name of the data handle. The return value starts with /resource/datahandle and doesn't contain the context path.

Signature


DATAHANDLEURL($type , $id , $property , $filter) : String

Parameters

  • $type (mandatory)
    Business object type.
    Type: String
    Example: 'PdfOutput'
  • $id (mandatory)
    Business object id.
    Type: String
    Example: 'D02319-en'
  • $property (mandatory)
    Business object property.
    Type: String
    Example: 'pdfFile'
  • $filter (optional)
    Version filter.
    Type: String
    Example: 'LatestCommittedFilter'

Return Value

  • URL without host and context path.
    Type: String

Examples


DATAHANDLEURL('PdfOutput','D02319-en','pdfFile') = '/resource/datahandle/PdfOutput/D02319-en/LatestCommittedFilter/pdfFile'

DataLogic:CreateAndEvaluateContext

Runs the Data Engine once using the Data Logic with the given ID and the given variable assignments. Returns the resulting Data Context.

Signature


DataLogic:CreateAndEvaluateContext($dataLogicId , $variableAssignments) : DataLogic:DataContext

Parameters

  • $dataLogicId (mandatory)
    The ID of the Data Logic to be used.
    Type: String
    Example: 'MyPackage:DataLogic'
  • $variableAssignments (optional)
    The variable assignments for the Data Logic
    Type: Named Any
    Example: {'var' = 'value'}

Return Value

  • The Data Context resulting from the run of the Data Engine.
    Type: DataLogic:DataContext

Examples

DataLogic:CreateAndEvaluateContext('MyPackage:ClientDataLogic')
DataLogic:CreateAndEvaluateContext('MyPackage:ClientDataLogic', {'client'=NewObject('MyPackage:Client')}:Any)

DataLogic:EvaluateDataRules

Runs the Data Engine once using the Data Logic with the given ID and the given variable assignments. Returns the result of Data Rules evaluation.

Signature


DataLogic:EvaluateDataRules($dataLogicId , $variableAssignments) : DataRules:DataRulesInfo

Parameters

  • $dataLogicId (mandatory)
    The ID of the Data Logic to be used.
    Type: String
    Example: 'AccountOpening:ClientDataRules'
  • $variableAssignments (optional)
    The variable assignments for the Data Logic
    Type: Named Any
    Example: {'var' = 'value'}:Any

Return Value

  • The DataRulesInfo resulting from the run of the Data Engine.
    Type: DataRules:DataRulesInfo

Examples

DataLogic:EvaluateDataRules('AccountOpening:ClientDataRules')
DataLogic:EvaluateDataRules('AccountOpening:ClientDataRules', {'client'=NewObject('AccountOpening:Client')}:Any)

DataLogic:EvaluateFilteredDataRules

Runs the Data Engine once using the provided Data Logic containing Data Rules and the one containing Controls and the corresponding variable assignments. Returns the result of the evaluation of the Data Rules Data Logic considering only Data Rules which have a corresponding visible Control returned by the Controls Data Logic.

Signature


DataLogic:EvaluateFilteredDataRules($dataRulesDataLogicId , $dataRulesVariableAssignments , $controlsDataLogicId , $controlsVariableAssignments) : DataRules:DataRulesInfo

Parameters

  • $dataRulesDataLogicId (mandatory)
    The ID of the Data Logic containing the Data Rules to be evaluated.
    Type: String
    Example: 'AccountOpening:ClientDataRules'
  • $dataRulesVariableAssignments (mandatory)
    The variable assignments for the Data Rules Data Logic
    Type: Named Any
    Example: {'var' = 'value'}:Any
  • $controlsDataLogicId (mandatory)
    The ID of the Data Logic containing the Controls to be used for filtering Data Rules information.
    Type: String
    Example: 'AccountOpening:ClientControls'
  • $controlsVariableAssignments (mandatory)
    The variable assignments for the Controls Data Logic
    Type: Named Any
    Example: {'var' = 'value'}:Any

Return Value

  • The DataRulesInfo resulting from the run of the Data Engine.
    Type: DataRules:DataRulesInfo

Examples

DataLogic:EvaluateFilteredDataRules('AccountOpening:ClientDataRules', {'client'=$client}:Any, 'AccountOpening:ClientControls', {'client'=$client}:Any)

DataLogic:HasDataRuleViolations

Runs the Data Engine once using the Data Logic with the given ID and the given variable assignments and evaluates the Data Rules specified by the given filter. Returns true if there is at least one violation in the filtered Data Rules.

Signature


DataLogic:HasDataRuleViolations($dataLogicId , $variableAssignments , $dataRulesFilter) : Boolean

Parameters

  • $dataLogicId (mandatory)
    The ID of the Data Logic to be used.
    Type: String
    Example: 'AccountOpening:ClientDataRules'
  • $variableAssignments (optional)
    The variable assignments for the Data Logic
    Type: Named Any
    Example: {'var' = 'value'}:Any
  • $dataRulesFilter (optional)
    The filtering criteria that define the subset of Data Rules to be evaluated.
    Type: DataRules:Filter
    Example: $dataRulesFilter

Return Value

  • True if there is at least one violation in the filtered Data Rules, false otherwise.
    Type: Boolean

Examples

DataLogic:HasDataRuleViolations('AccountOpening:ClientDataRules', {'client'=NewObject('AccountOpening:Client')}:Any)
DataLogic:HasDataRuleViolations('AccountOpening:ClientDataRules', {'client'=NewObject('AccountOpening:Client')}:Any, $dataRulesFilter)

DataLogic:IsDataLogicContext

Checks if the script is executed in the context of a Data Logic Task or a Data Logic Screen.

Signature


DataLogic:IsDataLogicContext() : Boolean

Parameters
None
Return Value

  • True if the script is executed in the context of a Data Logic Task or a Data Logic Screen, false otherwise.
    Type: Boolean

Examples

DataLogic:IsDataLogicContext()

DATAPATH

Build the absolute path of a file in the Nm Data Home.

Signature


DATAPATH($path) : String

Parameters

  • $path (mandatory)
    The relative path inside the Nm Data Home.
    Type: String
    Example: 'conf/content.properties'

Return Value

  • The absolute path of a file in the Nm Data Home.
    Type: String

Examples

DATAPATH('conf/content.properties')

DataRules:GetPhoneNumberCountry

Returns the value set as country code metadata for the given path (e.g. $client. PhoneNumber), if available. Otherwise returns null.

Signature


DataRules:GetPhoneNumberCountry($phoneNumberDataPath) : String

Parameters

  • $phoneNumberDataPath (mandatory)
    The path of the phone number from which the country code metadata must be obtained.
    Type: Any
    Example: $client.phoneNumber

Return Value

  • The value set as country code metadata for the given path, if available.
    Type: String

Examples

DataRules:GetPhoneNumberCountry($client.phoneNumber)

DataRules:SetPhoneNumberCountry

Sets the provided countryCode as metadata of the given path (e.g. $client. PhoneNumber).

Signature


DataRules:SetPhoneNumberCountry($phoneNumberDataPath , $countryCode) : Nothing

Parameters

  • $phoneNumberDataPath (mandatory)
    The path of the phone number on which the country code metadata must be set.
    Type: Any
    Example: $client.phoneNumber
  • $countryCode (mandatory)
    The country code metadata to be set on the given path.
    Type: String
    Example: US
    CH

Return Value

  • Type: Nothing

Examples

DataRules:SetPhoneNumberCountry($client.phoneNumber, 'US')

DataTableModel

An instance of a Data Class Model.

Signature


DataTableModel($type , $id) : Any

Parameters

  • $type (mandatory)
    The Data Class.
    Type: Any
    Example: MyDataTableModel
  • $id (mandatory)
    The id of the Data Class Model instance.
    Type: String
    Example: $id

Return Value

  • An instance of a Data Class Model.
    Type: Any

DATEADD (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 9 OR LATER. Use TIMEADD instead.

Signature


DATEADD($date , $amount , $unit) : Date

Parameters

  • $date (mandatory)
    The date to which we add the units.
    Type: Date
    Example: '2006-1-1'
  • $amount (mandatory)
    The amount to be added to the given date.
    Type: Integer
    Example: 2
  • $unit (optional)
    The amount's unit [Y: year, M: month, D: day, h: hour, m: minute, s: second, S: millisecond].
    Type: String
    Example: 'Y'

Return Value

  • The date that results from adding the given value to the given date.
    Type: Date

Examples


DATEADD(PARSEDATE('2006-1-1'),2,'Y')='2008-1-1'


DATEADD(PARSEDATE('2006-1-1'),2,'M')='2006-3-1'


DATEADD(PARSEDATE('2006-1-1'),2,'D')='2006-1-3'

DATECOMPARE

Compare two dates A and B. The Function returns a negative value if A is before B; 0 if A and B are at the same time; and positive value if A is after B. Use the following abbreviations for precision: Y/y for year, M for month, W/w for week, D/d for day, H/h for hour, m for minute, s for second and S for millisecond.

Signature


DATECOMPARE($date1 , $date2 , $nullLast , $precision) : Integer

Parameters

  • $date1 (mandatory)
    The first date.
    Type: Date
    Example: '2001-01-01'
  • $date2 (mandatory)
    The second date.
    Type: Date
    Example: '2006-01-01'
  • $nullLast (optional)
    Null values after all other dates.
    Type: Boolean
    Example: true
  • $precision (optional)
    Unit of precision.
    Type: String
    Example: null

Return Value

  • -1 if date1<date2, 0 if date1==date2, 1 if date1>date2.
    Type: Integer

Examples


DATECOMPARE('2001-01-01','2006-01-01')=-1


DATECOMPARE('2001-01-01','2001-01-01')=0


DATECOMPARE('2001-01-01','2000-01-01')=1

DATEFIELD

Get a field value of a date. Valid units: y for year, M for month, w for week in year, W for week in month, D for day in year, d for day in month, F for day of week in month, E for day in week, a for AP/PM, H for hour in day (0-23), k for hour in day (1-24), K for hour in AM/PM (0-11), h for hour in AM/PM (1-12), m for minute, s for second, S for millisecond and Z for time zone offset.

Signature


DATEFIELD($date , $unit) : Integer

Parameters

  • $date (mandatory)
    Input date.
    Type: Date
    Example: NOW()
  • $unit (mandatory)
    Unit to return.
    Type: String
    Example: d

Return Value

  • The date that results from adding the given timespan to the given date.
    Type: Integer

Examples


DATEFIELD('2006-01-01','y')=2006


DATEFIELD('2006-01-01 13:27:21','H')=13

DATEFORMAT

Format a date according to a pattern. Valid pattern letters: y for year (1996, 96), M for month in year (July, Jul, 07, 7), w for week in year (27), W for week in month (2), D for day in year (187), d for day in month (10), u for day number in week (1 = Monday, 2 = Tuesday etc. ), F for day of week in month (2), E for day of week (Tuesday, Tue), a for AM/PM marker, H for hour in day (0-23), k for hour in day (1-24), K for hour in am/pm (0-11), h for hour in am/pm (1-12), m for minute in hour, s for second in minute, S for millisecond (0-999), z for general time zone, Z for RFC 822 time zone, X for ISO 8061 time zone, Y for week year (do not confuse with 'y', use only if you fully understand the concept).

Signature


DATEFORMAT($date , $pattern , $locale , $timeZone) : String

Parameters

  • $date (mandatory)
    The date that will be formatted.
    Type: Date
    Example: NOW()
  • $pattern (mandatory)
    The pattern specifying the format.
    Type: String
    Example: 'dd.MM.yyyy'
  • $locale (optional)
    The language code.
    Type: String
    Example: 'de'
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: 'US/Eastern', 'Europe/Zurich', 'GMT'

Return Value

  • Format a date according to the given arguments.
    Type: String

Examples


DATEFORMAT(NOW(),'dd.MM.yyyy','ch') = 01.02.2006


DATEFORMAT(TODAY(),'MM/dd/yyyy','ch') = 02/01/2006

DATEPARSE

Parse a date according to a pattern. Valid pattern letters: y for year (1996, 96), M for month in year (July, Jul, 07, 7), w for week in year (27), W for week in month (2), D for day in year (187), d for day in month (10), u for day number in week (1 = Monday, 2 = Tuesday etc. ), F for day of week in month (2), E for day of week (Tuesday, Tue), a for AM/PM marker, H for hour in day (0-23), k for hour in day (1-24), K for hour in am/pm (0-11), h for hour in am/pm (1-12), m for minute in hour, s for second in minute, S for millisecond (0-999), z for general time zone, Z for RFC 822 time zone, X for ISO 8061 time zone, Y for week year (do not confuse with 'y', use only if you fully understand the concept).

Signature


DATEPARSE($dateString , $pattern , $locale , $timeZone) : Date

Parameters

  • $dateString (mandatory)
    The date string.
    Type: String
    Example: '2006-01-23'
  • $pattern (mandatory)
    The date pattern.
    Type: String
    Example: 'yyyy-MM-dd'
  • $locale (optional)
    The language code.
    Type: String
    Example: 'de'
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: 'US/Eastern', 'Europe/Zurich', 'GMT'

Return Value

  • The parsed date.
    Type: Date

Examples


DATEPARSE('2006-01-23','yyyy-MM-dd')=the date

DAYSSINCE

Calculate the days since the given date.

Signature


DAYSSINCE($date) : Double

Parameters

  • $date (mandatory)
    The date.
    Type: Date
    Example: '2006-01-23'

Return Value

  • Calculate the days since the given date.
    Type: Double

Examples


DAYSSINCE(Date.parse('2006-01-23'))=number of days

DebugNonSplittableValueStore (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ValueStore:DebugNonSplittable instead.

Signature


DebugNonSplittableValueStore($processInstanceId) : Any

Parameters

  • $processInstanceId (mandatory)
    The Process Instance ID of the Value Store that must be debugged.
    Type: String
    Example: $processInstanceId

Return Value

  • Returns details about the given Value Store, if it is splittable or not.
    Type: Any

Examples

DebugNonSplittableValueStore($valueStoreId)

DECODETEXT

Decode text encoded with Hex, Base32, Base64, Quoted Printable, URL, MIME, MIME-Q or MIME-B codec.

Signature


DECODETEXT($text , $encoding , $codec) : String

Parameters

  • $text (mandatory)
    The text to be decoded.
    Type: String
    Example: 'Hello'
  • $encoding (optional)
    Encoding (UTF-8 by default).
    Type: String
    Example: 'UTF-8'
  • $codec (optional)
    Hex, Base32, Base64, Quoted, URL, MIME, MIME-Q or MIME-B codec (Hex by default).
    Type: String
    Example: 'hex'

Return Value

  • Decode text encoded with Hex, Base32 or Base64.
    Type: String

Examples


DECODETEXT('48656c6c6f','UTF-8','hex') = 'Hello'


DECODETEXT('SGVsbG8=','ISO-8859-1','base64') = 'Hello'

DecompressFile

Decompresses a file.

Signature


DecompressFile($sourcePath , $targetPath , $method) : Nothing

Parameters

  • $sourcePath (mandatory)
    The path to the file to decompress.
    Type: String
    Example: 'work/tmp/mydatafile.gz'
  • $targetPath (mandatory)
    The path to the decompressed file to write.
    Type: String
    Example: 'work/tmp/mydatafile.xml'
  • $method (optional)
    The compression method ('gz' or 'bzip2'). Default = 'gz'.
    Type: String
    Example: 'gz'

Return Value

  • Decompresses a file.
    Type: Nothing

Examples

DecompressFile($sourcePath, $targetPath)

DecryptText

Decrypt the given text using the given encryption-key-alias.

Signature


DecryptText($keyAlias , $encryptedText , $salt) : String

Parameters

  • $keyAlias (mandatory)
    The encryption key alias to be used for decryption.
    Type: String
    Example: 'my-key-alias'
  • $encryptedText (mandatory)
    The text to be decrypted.
    Type: String
    Example: 'as67d5d87f6fasdf876'
  • $salt (optional)
    Crypto salt to be used for decryption.
    Type: String
    Example: '8wEodqTRNN11sJxP9Ybd'

Return Value

  • Decrypt the given text using the given encryption-key-alias.
    Type: String

Examples

DecryptText('my-key-alias', 'text to be decrypted')

DELETECLUSTERFILE

Delete the cluster file at the given filepath. If the file does not exist, nothing is done.

Signature


DELETECLUSTERFILE($filepath) : Nothing

Parameters

  • $filepath (mandatory)
    The path to the file to delete.
    Type: String
    Example: 'foo/bar/thefile.txt'

Return Value

  • Delete the cluster file at the given filepath. If the file does not exist, nothing is done.
    Type: Nothing

Examples

DELETECLUSTERFILE('foo/bar/thefile.txt')

DELETEDIRECTORY

Delete a directory. Relative paths are interpreted relative to the Data Home.

Signature


DELETEDIRECTORY($path) : Boolean

Parameters

  • $path (mandatory)
    The directory to delete.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

DELETEDIRECTORY('uploads/2006')

DELETEFILE

Delete a file. Relative paths are interpreted relative to the Data Home.

Signature


DELETEFILE($path) : Boolean

Parameters

  • $path (mandatory)
    The file to delete.
    Type: String
    Example: 'infos.xml'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

DELETEFILE('infos.xml')

DeleteKey

Delete the key with the given alias. Returns true if successful.

Signature


DeleteKey($keyAlias , $masterPassword) : String

Parameters

  • $keyAlias (mandatory)
    The encryption key alias to be deleted.
    Type: String
    Example: 'my-key-alias'
  • $masterPassword (mandatory)
    The master password.
    Type: String
    Example: 'secret'

Return Value

  • Delete the key with the given alias. Returns true if successful.
    Type: String

Examples

DeleteKey('my-key-alias', 'secret')

DeleteNotificationTopic

Delete the notification topic (and all its subscriptions) with the given Id. If the topic does not exists, a warning is logged.

Signature


DeleteNotificationTopic($topic) : Nothing

Parameters

  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'new-american-client'

Return Value

  • Delete the notification topic (and all its subscriptions) with the given Id. If the topic does not exists, a warning is logged.
    Type: Nothing

Examples

DeleteNotificationTopic('new-american-client')

DeleteProcessInstance

Delete a Process Instance.

Signature


DeleteProcessInstance($processInstanceId) : Nothing

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '129409273901'

Return Value

  • Type: Nothing

Examples

DeleteProcessInstance('129409273901')

DeleteProcessInstanceIndex

Function that deletes an index for process instances.

Signature


DeleteProcessInstanceIndex($name) : Any

Parameters

  • $name (mandatory)
    Index name.
    Type: String
    Example: PIGroup

Return Value

  • Returns true if the index was deleted successfully and all exiting indexed data was cleaned.
    Type: Any

Examples

DeleteProcessInstanceIndexFunction($name)

DeleteUser (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:Delete instead.

Signature


DeleteUser($userId) : Nothing

Parameters

  • $userId (mandatory)
    The User ID of the user to be deleted.
    Type: String
    Example: 'testUserId'

Return Value

  • Delete the user with the given User ID.
    Type: Nothing

DeleteWorkflowToken

Signature


DeleteWorkflowToken($workflowTokenId) : Boolean

Parameters

  • $workflowTokenId (mandatory)
    Workflow Token Id.
    Type: String
    Example: $workitem.getTokenId()

Return Value

  • Type: Boolean

Examples

DeleteWorkflowToken($workflowTokenId)

DESERIALIZE

Deserialize the given data.

Signature


DESERIALIZE($data) : Any

Parameters

  • $data (mandatory)
    The data to be deserialized.
    Type: String
    Example: $data

Return Value

  • Deserialize the given data.
    Type: Any

Examples

DESERIALIZE($data)

DIFFERENCE

Calculate the difference (subtraction) of two indexed collections.

Signature


DIFFERENCE($collection , $collection) : Any:indexed

Parameters

  • $collection (mandatory)
    An indexed collection.
    Type: Any:indexed
    Example: $collection1
  • $collection (mandatory)
    An indexed collection.
    Type: Any:indexed
    Example: $collection2

Return Value

  • Difference (subtract) of two indexed collections.
    Type: Any:indexed

Examples

DIFFERENCE($collection1, $collection2)

DIR

Get the content of the given directory.

Signature


DIR($pathToDirectory , $filter) : Any:indexed

Parameters

  • $pathToDirectory (mandatory)
    The path to the directory.
    Type: String
    Example: '{DATA_HOME}/tmp'
  • $filter (optional)
    Expression used for filtering the content.
    Type: Any
    Example: $file.getName().endsWith('.xml')

Return Value

  • The content of the given directory.
    Type: Any:indexed

Examples

DIR('{DATA_HOME}/tmp')

DIRECTORYEXISTS

Check if a directory exists. Relative paths are interpreted relative to the Data Home.

Signature


DIRECTORYEXISTS($path) : Boolean

Parameters

  • $path (mandatory)
    The directory to check.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns true if the directory already exists.
    Type: Boolean

Examples

DIRECTORYEXISTS('uploads/2006')

DIRECTORYSIZE

Returns the size of a directory in bytes. If the directory doesn't exist or if path denotes a file, -1 is returned. Relative paths are interpreted as relative to the Data Home.

Signature


DIRECTORYSIZE($path) : Long

Parameters

  • $path (mandatory)
    The directory path.
    Type: String
    Example: 'content'

Return Value

  • Returns the size of a directory in bytes.
    Type: Long

Examples

DIRECTORYSIZE('content') == 2131231

DIV

Divide two real (floating point) numbers.

Signature


DIV($dividend , $divisor) : Number

Parameters

  • $dividend (mandatory)
    The number that has to be divided.
    Type: Number
    Example: 12
  • $divisor (mandatory)
    The number through which the dividend is divided.
    Type: Number
    Example: 2

Return Value

  • The division result.
    Type: Number

Examples


DIV(12.0,2.0)=6.0


DIV(13.0,2.0)=6.5

DIVV

Calculate the integer division of the given arguments.

Signature


DIVV($dividend , $divisor) : Integer

Parameters

  • $dividend (mandatory)
    The number that will be divided.
    Type: Number
    Example: 13
  • $divisor (mandatory)
    The number that divides the dividend.
    Type: Integer
    Example: 2

Return Value

  • The integer division result.
    Type: Integer

Examples


DIVV(12,2)=6


DIVV(13,2)=6


DIVV(13.0,2.0)=6


DIVV(13.9,2)=error (13.9 can't be converted to an integer)


DIVV(13,2)=6

DNSLookup

Lookup a Hostname and return am IP Address. If the Hostname cannot be resolved, null is returned.

Signature


DNSLookup($hostname) : String

Parameters

  • $hostname (mandatory)
    Hostname.
    Type: String
    Example: 'client021.bank.local'

Return Value

  • IP Address.
    Type: String

Examples


DNSReverseLookup('client021.bank.local') = '172.16.3.211'

DNSReverseLookup

Lookup an IP Address and return a fully qualified Hostname (FQDN). If the IP Address cannot be resolved, either null or the IP Address is returned.

Signature


DNSReverseLookup($ipAddress) : String

Parameters

  • $ipAddress (mandatory)
    IP Address.
    Type: String
    Example: '172.16.3.211'

Return Value

  • Fully qualified Hostname.
    Type: String

Examples


DNSReverseLookup('172.16.3.211') = 'client021.bank.local'

DocumentCategory:GetFromDocument

Returns a Reference to the Document Category BO configured on the Document Behavior of the given instance, if any.

Signature


DocumentCategory:GetFromDocument($document) : DocumentCategory:Reference

Parameters

  • $document (mandatory)
    The Document instance from which the Document Category is read.
    Type: Any
    Example: $document

Return Value

  • A Reference to the Document Category BO configured on the Document Behavior of the given instance, if any.
    Type: DocumentCategory:Reference

Examples

DocumentCategory:GetFromDocument($document)

DocumentCategory:GetIconUrl

Returns the URL corresponding to the icon selected for the provided Document Category.

Signature


DocumentCategory:GetIconUrl($documentCategoryReference) : String

Parameters

  • $documentCategoryReference (mandatory)
    The Document Category whose icon URL should be returned.
    Type: DocumentCategory:Reference
    Example: DocumentCategory:NewReference('Categories:Contracts')

Return Value

  • The URL that allows accessing the icon (Appway Icon or Resource) selected for the provided Document Category. The URL includes the Version Filter for Resource Business Objects.
    Type: String

Examples

DocumentCategory:GetIconUrl(DocumentCategory:NewReference('Categories:Contracts'))

DocumentCategory:NewReference

Creates a Business Object Reference of type DocumentCategory:Reference.

Signature


DocumentCategory:NewReference($id) : DocumentCategory:Reference

Parameters

  • $id (mandatory)
    DocumentCategory ID.
    Type: String
    Example: 'myDocumentCategory'

Return Value

  • Creates a Business Object Reference of type DocumentCategory:Reference.
    Type: DocumentCategory:Reference

Examples

DocumentCategory:NewReference('myDocumentCategory')

DOCUMENTSETACTIONS

Generate a list of Action objects based on the contents of a Document Set.

Signature


DOCUMENTSETACTIONS($documentSetId , $input , $output , $recursive) : Action:indexed

Parameters

  • $documentSetId (mandatory)
    Document Set Id.
    Type: String
    Example: $documentSetId
  • $input (optional)
    Create Screen Actions.
    Type: Boolean
    Example: $input
  • $output (optional)
    Create PDF Output Actions.
    Type: Boolean
    Example: $output
  • $recursive (optional)
    Include nested Document Sets.
    Type: Boolean
    Example: $recursive

Return Value

  • Return a list of Action objects for a given Document Set.
    Type: Action:indexed

Examples

DOCUMENTSETACTIONS('Switzerland', true, false, true)

DROPSTRUCTURE

Remove the given structure from the system.

Signature


DROPSTRUCTURE($structure) : Nothing

Parameters

  • $structure (mandatory)
    The name of the structure.
    Type: String
    Example: 'Person'

Return Value

  • Nothing.
    Type: Nothing

Examples

DROPSTRUCTURE('Person')

EMPTY

Check if the given text is an empty string.

Signature


EMPTY($argument) : Boolean

Parameters

  • $argument (mandatory)
    The text we want to check.
    Type: String
    Example: EMPTY('')=true

Return Value

  • True if the given argument is an empty string.
    Type: Boolean

Examples


EMPTY('')=true


EMPTY('John')=false

ENCODETEXT

Encode text with Hex, Base32, Base64, Quoted Printable, URL, MIME, MIME-Q or MIME-B codec.

Signature


ENCODETEXT($text , $encoding , $codec) : String

Parameters

  • $text (mandatory)
    The text to be encoded.
    Type: String
    Example: 'Hello'
  • $encoding (optional)
    Encoding (UTF-8 by default).
    Type: String
    Example: 'UTF-8'
  • $codec (optional)
    Hex, Base32, Base64, Quoted, URL, MIME, MIME-Q or MIME-B codec (Hex by default).
    Type: String
    Example: 'hex'

Return Value

  • Encode text with Hex, Base32 or Base64.
    Type: String

Examples


ENCODETEXT('Hello','UTF-8','hex') = '48656c6c6f'


ENCODETEXT('Hello','ISO-8859-1','base64') = 'SGVsbG8='

ENCODETEXTMD5

Encode text as MD5 with Hex, Base32 or Base64.

Signature


ENCODETEXTMD5($text , $encoding , $codec) : String

Parameters

  • $text (mandatory)
    The text to be encoded.
    Type: String
    Example: 'Hello'
  • $encoding (optional)
    Encoding (UTF-8 by default).
    Type: String
    Example: 'UTF-8'
  • $codec (optional)
    Hex, Base32 or Base64 codec (Hex by default).
    Type: String
    Example: 'hex'

Return Value

  • Encode text as MD5 with Hex, Base32 or Base64.
    Type: String

Examples


ENCODETEXTMD5('Hello','UTF-8','hex') = '8b1a9953c4611296a827abf8c47804d7'


ENCODETEXTMD5('Hello','ISO-8859-1','base64') = 'ixqZU8RhEpaoJ6v4xHgE1w=='

ENCODEURL

Encode URL special characters.

Signature


ENCODEURL($text , $encoding) : String

Parameters

  • $text (mandatory)
    The text to be encoded.
    Type: String
    Example: 'Hello World'
  • $encoding (optional)
    The encoding. The text will first be transformed to the given encoding and then encoded. Note: The World Wide Web Consortium Recommendation states that 'UTF-8' should be used. Not doing so may introduce incompatibilities. (Default = 'UTF-8').
    Type: String
    Example: 'ISO-8859-1'

Return Value

  • Encode URL special characters.
    Type: String

Examples


ENCODEURL('Hello World')='Hello%20World'

ENCRYPTPATH

Encrypt a file system path. This function can be used to pass a path to streaming components like FileSystemServlet or ImageScaler.

Signature


ENCRYPTPATH($path) : String

Parameters

  • $path (mandatory)
    The path to be encrypted.
    Type: String
    Example: 'D:/uploads/image.gif'

Return Value

  • Encrypted Path.
    Type: String

Examples


ENCRYPTPATH('D:/uploads/image.gif')='rial82ja23lsd9asldk9das'

EncryptPDF

Generate an Encrypted PDF Document using a PdfRenderConfiguration.

Signature


EncryptPDF($inputPdfFilePath , $pdfConfiguration) : Boolean

Parameters

  • $inputPdfFilePath (mandatory)
    Path of the pdf file to be encrypted.
    Type: String
    Example: /work/document.pdf
  • $pdfConfiguration (mandatory)
    PdfRenderConfiguration.
    Type: PdfRenderConfiguration
    Example: $pdfConfiguration

Return Value

  • Return true if the encryption process worked.
    Type: Boolean

Examples

EncryptPDF($pdfRenderConfiguration)

EncryptText

Encrypt the given text using the given encryption-key-alias.

Signature


EncryptText($keyAlias , $text , $salt) : String

Parameters

  • $keyAlias (mandatory)
    The encryption key alias to be used for encryption.
    Type: String
    Example: 'my-key-alias'
  • $text (mandatory)
    The text to be encrypted.
    Type: String
    Example: 'encrypt me please!'
  • $salt (optional)
    Crypto salt to be used for encryption.
    Type: String
    Example: '8wEodqTRNN11sJxP9Ybd'

Return Value

  • Encrypt the given text using the given encryption-key-alias.
    Type: String

Examples

EncryptText('my-key-alias', 'text to be encrypted')

EncryptUserPassword (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:HashPassword instead.

Signature


EncryptUserPassword($password) : String

Parameters

  • $password (mandatory)
    The cleartext password to be hashed.
    Type: String
    Example: 'mySecretPass'

Return Value

  • Returns the hash of a password.
    Type: String

Examples

EncryptUserPassword('mySecretPass')

EndDataTask

Ends a Data Task with the given token ID.

Signature


EndDataTask($tokenID , $endDataTaskControlId) : String

Parameters

  • $tokenID (mandatory)
    The token ID associated with the Data Task to end.
    Type: String
    Example: $tokenID
  • $endDataTaskControlId (mandatory)
    The ID of the EndDataTask Control to take in account when ending the Data Task.
    Type: String
    Example: '24', '$controlId'

Return Value

  • The ID of the token reached after ending the Data Task or, if there is no next token, the string 'no_more_token'.
    Type: String

Examples

EndDataTask($tokenID, '0')

ENDSWITH

Check if a text ends with a given postfix.

Signature


ENDSWITH($text , $prefix) : Boolean

Parameters

  • $text (mandatory)
    Text.
    Type: String
    Example: 'file.xml'
  • $prefix (mandatory)
    Postfix.
    Type: String
    Example: '.xml'

Return Value

  • True if the text ends with the given postfix.
    Type: Boolean

Examples


ENDSWITH('file.xml','.xml')=true


STARTSWITH('John Peter','John')=false

EQUAL

Return true if all arguments are equal.

Signature


EQUAL($object , $object , $object) : Boolean

Parameters

  • $object (mandatory)
    The first object that should be compared.
    Type: java.lang.Object
    Example: 1
  • $object (mandatory)
    The second object that should be compared.
    Type: java.lang.Object
    Example: 1
  • $object (optional)
    The third object that should be compared.
    Type: java.lang.Object
    Example: 1

Return Value

  • True if all paramters are equal.
    Type: Boolean

Examples


EQUAL(1,1)=true


EQUAL(1,1,1)=true


EQUAL(1,2)=false


EQUAL(1,1,2)=false

ERROR

Evaluate the first argument and return its value if no error occurs, otherwise evaluate the second argument and return its value. The implicit variable $exception can be used to access the exception object.

Signature


ERROR($expr1 , $expr2) : Any

Parameters

  • $expr1 (mandatory)
    The expression that could throw an error.
    Type: Any
    Example: ?
  • $expr2 (mandatory)
    The expression returned in case an error was thrown by expr1.
    Type: Any
    Example: ?

Return Value

  • The value of the first expression if no error occured while evaluating it, otherwise the value of the second expression.
    Type: Any

Examples

ERROR(expr1, expr2)

ESCAPEHTML

Escape HTML special characters.

Signature


ESCAPEHTML($string) : String

Parameters

  • $string (mandatory)
    The text to be escaped.
    Type: String
    Example: '<b>hello</b>'

Return Value

  • Escape HTML special characters.
    Type: String

Examples


ESCAPEHTML('5 > 3')='5 > 3'


ESCAPEHTML('hello')='<b>hello</b>'

ESCAPEJAVASCRIPT

Escape JavaScript special characters.

Signature


ESCAPEJAVASCRIPT($string) : String

Parameters

  • $string (mandatory)
    The text to be escaped.
    Type: String
    Example: "I don't like coffee"

Return Value

  • Escape JavaScript special characters.
    Type: String

Examples


ESCAPEJAVASCRIPT("I don't like coffee")="I don\'t like coffee"


ESCAPEJAVASCRIPT('He said: "Stopp!"')='He said: \"Stopp!\"'

EscapeRegex

Escape Regex special characters.

Signature


EscapeRegex($string) : String

Parameters

  • $string (mandatory)
    Text to be escaped.
    Type: String
    Example: '?'

Return Value

  • Escaped text.
    Type: String

Examples


EscapeRegex('?') = '\Q?\E'

ESCAPEXML

Escape XML special characters.

Signature


ESCAPEXML($string) : String

Parameters

  • $string (mandatory)
    The text to be escaped.
    Type: String
    Example: '<b>hello</b>'

Return Value

  • Escape XML special characters.
    Type: String

Examples


ESCAPEXML('5 > 3')='5 > 3'


ESCAPEXML('hello')='<b>hello</b>'

EVAL

Evaluate the argument string containing an Expression and return the evalution's result.

Signature


EVAL($expressionString) : Any

Parameters

  • $expressionString (mandatory)
    The string with the expression that must be evaluated.
    Type: String
    Example: '1+2'
    'EVAL("1+2")'

Return Value

  • The result of the evaluation of the argument string.
    Type: Any

Examples


EVAL('1+2')=3


EVAL('EVAL("1+2")')=3

EVALUATERULE

Evaluates the given Rule and returns the actions that were triggered. Returns an empty Indexed if the Rule was not found.

Signature


EVALUATERULE($ruleRef , $variableAssignments) : Action:indexed

Parameters

  • $ruleRef (mandatory)
    Rule Reference.
    Type: Rule:Reference
    Example: Rule:NewReference('ruleId')
  • $variableAssignments (optional)
    possible variable assignments
    Type: Any:mapped
    Example: {'var1'='test', 'var2'=false}:Any

Return Value

  • Evaluates the given Rule and returns the actions that were triggered. If the Rule is not found, returns an empty Indexed.
    Type: Action:indexed

Examples

EVALUATERULE(Rule:NewReference('ruleId'))

EVALUATERULESET (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. The RuleSet Business Object is deprecated. Evaluates the given RuleSet and returns the actions that were triggered. Throws an exception if the RuleSet was not found.

Signature


EVALUATERULESET($ruleSetRef) : Action:indexed

Parameters

  • $ruleSetRef (mandatory)
    Rule Set Reference.
    Type: RuleSet:Reference
    Example: RuleSet:NewReference('ruleSetId')

Return Value

  • Evaluates the given ruleset and returns the actions that were triggered. If the RuleSet is not found, throws an exception.
    Type: Action:indexed

Examples

EVALUATERULESET(RuleSet:NewReference('ruleSetId'))

ExceptionRootCause

Root cause.

Signature


ExceptionRootCause($exception) : Exception

Parameters

  • $exception (mandatory)
    Exception.
    Type: Exception
    Example: $exception

Return Value

  • Root cause.
    Type: Exception

Examples

ExceptionRootCause($exception)

ExcludeFromNotificationSubscription

Exclude the given user from the subscription of a group/role to the given topic via the given channel. If no delivery channel is supplied, the exclusion will affect the Appway delivery channel.

Signature


ExcludeFromNotificationSubscription($userId , $subscriberId , $topic , $deliveryChannelId) : Nothing

Parameters

  • $userId (mandatory)
    The Id of the user to exclude from the subscription.
    Type: String
    Example: USERID()
  • $subscriberId (mandatory)
    The Id of the group/role from whose subscription to exclude the given user.
    Type: String
    Example: 'GROUP:accountManagersUSA'
  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'new-american-client'
  • $deliveryChannelId (optional)
    The Id of the notification delivery channel. Default is 'appway'.
    Type: String
    Example: 'appway'

Return Value

  • Exclude the given user from the subscription of a group/role to the given topic via the given channel. If no delivery channel is supplied, the exclusion will affect the Appway delivery channel.
    Type: Nothing

Examples

ExcludeFromNotificationSubscription(USERID(), 'GROUP:accountManagersUSA', 'new-american-client')

ExecuteDistributed

Execute the given script as a task via Hazelcast on all nodes of a cluster.

Signature


ExecuteDistributed($expression , $parameter , $retryable) : Any:indexed

Parameters

  • $expression (mandatory)
    The expression to be executed.
    Type: Any
    Example: UpdateLocalCache()
  • $parameter (optional)
    Parameter collection for the expression to be executed.
    Type: Any:mapped
    Example: {'a'='hello'}:Any
  • $retryable (optional)
    Specifies if a failed execution should be retried if possible. The default is false.
    Type: Boolean
    Example: true

Return Value

  • Indexed collection of results of the distributed execution.
    Type: Any:indexed

Examples

ExecuteDistributed($expression, $params)

EXECUTIONCONTEXT

Get the execution context.

Signature


EXECUTIONCONTEXT() : ExecutionContext

Parameters
None
Return Value

  • Execution context.
    Type: ExecutionContext

Examples

EXECUTIONCONTEXT()

EXECUTIONCONTEXTATTRIBUTE

Get the value of an execution context attribute. The function returns null if attribute is not defined.

Signature


EXECUTIONCONTEXTATTRIBUTE($name) : Any

Parameters

  • $name (mandatory)
    Name of the execution context attribute.
    Type: String
    Example: 'javax.servlet.http.HttpServletRequest'

Return Value

  • Value of the execution context attribute.
    Type: Any

Examples

EXECUTIONCONTEXTATTRIBUTE('javax.servlet.http.HttpServletRequest')

ExistsBusinessObject

Check if the a version of the requested BusinessObject exists.

Signature


ExistsBusinessObject($type , $id , $versionFilter) : Boolean

Parameters

  • $type (mandatory)
    The type of the requested BusinessObject.
    Type: String
    Example: 'DataType')
  • $id (mandatory)
    The id of the requested BusinessObject.
    Type: String
    Example: 'String'
  • $versionFilter (optional)
    The version filter for searching the business object.
    Type: Any
    Example: VersionFilter()

Return Value

  • Check if the a version of the requested BusinessObject exists.
    Type: Boolean

Examples

ExistsBusinessObject('DataType', 'String')

ExistsDataClass

Check if the dataclass with the given name already exists.

Signature


ExistsDataClass($name) : Boolean

Parameters

  • $name (mandatory)
    The name of the Data Class.
    Type: String
    Example: 'String')

Return Value

  • Check if the dataclass with the given name already exists.
    Type: Boolean

Examples

ExistsDataClass('String')

EXN

The execution tree of the given expression.

Signature


EXN($expression) : Any

Parameters

  • $expression (mandatory)
    The expression whose execution tree must be returned.
    Type: Any
    Example: $a + $b

Return Value

  • The execution tree of the given expression.
    Type: Any

Examples

EXN($a + $b)

EXP

Return Euler's number 'e' raised to the power of the argument value.

Signature


EXP($argument) : Number

Parameters

  • $argument (mandatory)
    The exponent.
    Type: Double
    Example: 2

Return Value

  • Returns Euler's number 'e' raised to the power of the argument value.
    Type: Number

Examples


EXP(2)=e^2

FAIL

Throw an exception.

Signature


FAIL($message) : Nothing

Parameters

  • $message (optional)
    The message that should appear in the log.
    Type: String
    Example: 'some text'

Return Value

  • This function always throws an exception.
    Type: Nothing

Examples

FAIL()
FAIL('An unrecoverable error occured while squaring a circle')

File:Checksum

Checksum for a file as an hexadecimal string.

Signature


File:Checksum($path , $algorithm , $provider) : String

Parameters

  • $path (mandatory)
    The path to the file to build the checksum from.
    Type: String
    Example: 'C:\Temp\file.dat'
  • $algorithm (optional)
    The algorithm to use (default: 'MD5').
    Type: String
    Example: '1.0.10118.3.0.55' (BC)
    '1.2.804.2.1.1.1.1.2.2.1' (BC)
    '1.2.804.2.1.1.1.1.2.2.2' (BC)
    '1.2.804.2.1.1.1.1.2.2.3' (BC)
    '2.16.840.1.101.3.4.2.10' (BC)
    '2.16.840.1.101.3.4.2.11' (BC)
    '2.16.840.1.101.3.4.2.12' (BC)
    '2.16.840.1.101.3.4.2.7' (BC)
    '2.16.840.1.101.3.4.2.8' (BC)
    '2.16.840.1.101.3.4.2.9' (BC)
    'BLAKE2B-160' (BC)
    'BLAKE2B-256' (BC)
    'BLAKE2B-384' (BC)
    'BLAKE2B-512' (BC)
    'BLAKE2S-128' (BC)
    'BLAKE2S-160' (BC)
    'BLAKE2S-224' (BC)
    'BLAKE2S-256' (BC)
    'BLAKE3-256' (BC)
    'DSTU7564-256' (BC)
    'DSTU7564-384' (BC)
    'DSTU7564-512' (BC)
    'GOST3411' (BC)
    'GOST3411-2012-256' (BC)
    'GOST3411-2012-512' (BC)
    'HARAKA-256' (BC)
    'HARAKA-512' (BC)
    'KECCAK-224' (BC)
    'KECCAK-256' (BC)
    'KECCAK-288' (BC)
    'KECCAK-384' (BC)
    'KECCAK-512' (BC)
    'MD2' (BC)
    'MD2' (SUN)
    'MD4' (BC)
    'MD5' (BC)
    'MD5' (SUN)
    'OID.1.0.10118.3.0.55' (BC)
    'OID.1.2.804.2.1.1.1.1.2.2.1' (BC)
    'OID.1.2.804.2.1.1.1.1.2.2.2' (BC)
    'OID.1.2.804.2.1.1.1.1.2.2.3' (BC)
    'OID.2.16.840.1.101.3.4.2.10' (BC)
    'OID.2.16.840.1.101.3.4.2.11' (BC)
    'OID.2.16.840.1.101.3.4.2.12' (BC)
    'OID.2.16.840.1.101.3.4.2.7' (BC)
    'OID.2.16.840.1.101.3.4.2.8' (BC)
    'OID.2.16.840.1.101.3.4.2.9' (BC)
    'PARALLELHASH128-256' (BC)
    'PARALLELHASH256-512' (BC)
    'RIPEMD128' (BC)
    'RIPEMD160' (BC)
    'RIPEMD256' (BC)
    'RIPEMD320' (BC)
    'SHA' (SUN)
    'SHA-1' (BC)
    'SHA-224' (BC)
    'SHA-224' (SUN)
    'SHA-256' (BC)
    'SHA-256' (SUN)
    'SHA-384' (BC)
    'SHA-384' (SUN)
    'SHA-512' (BC)
    'SHA-512' (SUN)
    'SHA-512/224' (BC)
    'SHA-512/224' (SUN)
    'SHA-512/256' (BC)
    'SHA-512/256' (SUN)
    'SHA3-224' (BC)
    'SHA3-224' (SUN)
    'SHA3-256' (BC)
    'SHA3-256' (SUN)
    'SHA3-384' (BC)
    'SHA3-384' (SUN)
    'SHA3-512' (BC)
    'SHA3-512' (SUN)
    'SHAKE128-256' (BC)
    'SHAKE256-512' (BC)
    'SM3' (BC)
    'Skein-1024-1024' (BC)
    'Skein-1024-384' (BC)
    'Skein-1024-512' (BC)
    'Skein-256-128' (BC)
    'Skein-256-160' (BC)
    'Skein-256-224' (BC)
    'Skein-256-256' (BC)
    'Skein-512-128' (BC)
    'Skein-512-160' (BC)
    'Skein-512-224' (BC)
    'Skein-512-256' (BC)
    'Skein-512-384' (BC)
    'Skein-512-512' (BC)
    'TIGER' (BC)
    'TUPLEHASH128-256' (BC)
    'TUPLEHASH256-512' (BC)
    'Tiger' (BC)
    'WHIRLPOOL' (BC)
  • $provider (optional)
    The Cryptographic Service Provider to use (default: none).
    Type: String
    Example: 'BC'
    'SUN'

Return Value

  • Checksum for a file as an hexadecimal string.
    Type: String

Examples


File:Checksum('C:\Temp\file.dat') = '8b1a9953c4611296a827abf8c47804d7'


File:Checksum('C:\Temp\file.dat', 'MD5') = '8b1a9953c4611296a827abf8c47804d7'


File:Checksum('C:\Temp\file.dat', 'MD5', 'SUN') = '8b1a9953c4611296a827abf8c47804d7'

File:DetectMediaType

Analyzes the content and name of a file and returns its media type.

Signature


File:DetectMediaType($path) : String

Parameters

  • $path (mandatory)
    File path.
    Type: String
    Example: 'files/data.xml'

Return Value

  • Media type of file, or null if media type is unknown.
    Type: String

Examples

File:DetectMediaType('files/data.xml') == 'text/xml'

File:ListDirectoryContent

Get the content of the given directory.

Signature


File:ListDirectoryContent($pathToDirectory , $filter) : LocalFile:indexed

Parameters

  • $pathToDirectory (mandatory)
    The path to the directory.
    Type: String
    Example: '{DATA_HOME}/tmp'
  • $filter (optional)
    Expression used for filtering the content. The variable $file used in the filter expression must be of type LocalFile.
    Type: Boolean
    Example: $file.getName().endsWith('.xml')

Return Value

  • The content of the given directory.
    Type: LocalFile:indexed

Examples

File:ListDirectoryContent('{DATA_HOME}/tmp')

File:ScanForVirus

Scans the given file for virus presence.

Signature


File:ScanForVirus($pathToFile) : String

Parameters

  • $pathToFile (mandatory)
    The path to the file.
    Type: String
    Example: '{DATA_HOME}/file.txt'

Return Value

  • File virus scan result.
    Type: String

Examples

File:ScanForVirus('{DATA_HOME}/file.txt')

FileChecksum (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2023 OR LATER. Use File:Checksum instead.

Signature


FileChecksum($path , $algorithm , $provider) : String

Parameters

  • $path (mandatory)
    The path to the file to build the checksum from.
    Type: String
    Example: 'C:\Temp\file.dat'
  • $algorithm (optional)
    The algorithm to use (default: 'MD5').
    Type: String
    Example: '1.0.10118.3.0.55' (BC)
    '1.2.804.2.1.1.1.1.2.2.1' (BC)
    '1.2.804.2.1.1.1.1.2.2.2' (BC)
    '1.2.804.2.1.1.1.1.2.2.3' (BC)
    '2.16.840.1.101.3.4.2.10' (BC)
    '2.16.840.1.101.3.4.2.11' (BC)
    '2.16.840.1.101.3.4.2.12' (BC)
    '2.16.840.1.101.3.4.2.7' (BC)
    '2.16.840.1.101.3.4.2.8' (BC)
    '2.16.840.1.101.3.4.2.9' (BC)
    'BLAKE2B-160' (BC)
    'BLAKE2B-256' (BC)
    'BLAKE2B-384' (BC)
    'BLAKE2B-512' (BC)
    'BLAKE2S-128' (BC)
    'BLAKE2S-160' (BC)
    'BLAKE2S-224' (BC)
    'BLAKE2S-256' (BC)
    'BLAKE3-256' (BC)
    'DSTU7564-256' (BC)
    'DSTU7564-384' (BC)
    'DSTU7564-512' (BC)
    'GOST3411' (BC)
    'GOST3411-2012-256' (BC)
    'GOST3411-2012-512' (BC)
    'HARAKA-256' (BC)
    'HARAKA-512' (BC)
    'KECCAK-224' (BC)
    'KECCAK-256' (BC)
    'KECCAK-288' (BC)
    'KECCAK-384' (BC)
    'KECCAK-512' (BC)
    'MD2' (BC)
    'MD2' (SUN)
    'MD4' (BC)
    'MD5' (BC)
    'MD5' (SUN)
    'OID.1.0.10118.3.0.55' (BC)
    'OID.1.2.804.2.1.1.1.1.2.2.1' (BC)
    'OID.1.2.804.2.1.1.1.1.2.2.2' (BC)
    'OID.1.2.804.2.1.1.1.1.2.2.3' (BC)
    'OID.2.16.840.1.101.3.4.2.10' (BC)
    'OID.2.16.840.1.101.3.4.2.11' (BC)
    'OID.2.16.840.1.101.3.4.2.12' (BC)
    'OID.2.16.840.1.101.3.4.2.7' (BC)
    'OID.2.16.840.1.101.3.4.2.8' (BC)
    'OID.2.16.840.1.101.3.4.2.9' (BC)
    'PARALLELHASH128-256' (BC)
    'PARALLELHASH256-512' (BC)
    'RIPEMD128' (BC)
    'RIPEMD160' (BC)
    'RIPEMD256' (BC)
    'RIPEMD320' (BC)
    'SHA' (SUN)
    'SHA-1' (BC)
    'SHA-224' (BC)
    'SHA-224' (SUN)
    'SHA-256' (BC)
    'SHA-256' (SUN)
    'SHA-384' (BC)
    'SHA-384' (SUN)
    'SHA-512' (BC)
    'SHA-512' (SUN)
    'SHA-512/224' (BC)
    'SHA-512/224' (SUN)
    'SHA-512/256' (BC)
    'SHA-512/256' (SUN)
    'SHA3-224' (BC)
    'SHA3-224' (SUN)
    'SHA3-256' (BC)
    'SHA3-256' (SUN)
    'SHA3-384' (BC)
    'SHA3-384' (SUN)
    'SHA3-512' (BC)
    'SHA3-512' (SUN)
    'SHAKE128-256' (BC)
    'SHAKE256-512' (BC)
    'SM3' (BC)
    'Skein-1024-1024' (BC)
    'Skein-1024-384' (BC)
    'Skein-1024-512' (BC)
    'Skein-256-128' (BC)
    'Skein-256-160' (BC)
    'Skein-256-224' (BC)
    'Skein-256-256' (BC)
    'Skein-512-128' (BC)
    'Skein-512-160' (BC)
    'Skein-512-224' (BC)
    'Skein-512-256' (BC)
    'Skein-512-384' (BC)
    'Skein-512-512' (BC)
    'TIGER' (BC)
    'TUPLEHASH128-256' (BC)
    'TUPLEHASH256-512' (BC)
    'Tiger' (BC)
    'WHIRLPOOL' (BC)
  • $provider (optional)
    The Cryptographic Service Provider to use (default: none).
    Type: String
    Example: 'BC'
    'SUN'

Return Value

  • Checksum for a file as an hexadecimal string.
    Type: String

Examples


FileChecksum('C:\Temp\file.dat') = '8b1a9953c4611296a827abf8c47804d7'


FileChecksum('C:\Temp\file.dat', 'MD5') = '8b1a9953c4611296a827abf8c47804d7'


FileChecksum('C:\Temp\file.dat', 'MD5', 'SUN') = '8b1a9953c4611296a827abf8c47804d7'

FILEEXISTS

Check if a file exists. Relative paths are interpreted relative to the Data Home.

Signature


FILEEXISTS($path) : Boolean

Parameters

  • $path (mandatory)
    The file to check.
    Type: String
    Example: 'infos.xml'

Return Value

  • Returns true if the file already exists.
    Type: Boolean

Examples

FILEEXISTS('infos.xml')

FILEEXTENSION

Returns the file extension of a file given its path.

Signature


FILEEXTENSION($path) : String

Parameters

  • $path (mandatory)
    The file path.
    Type: String
    Example: 'content/infos.xml'

Return Value

  • Returns the file extension of a file given its path.
    Type: String

Examples

FILEEXTENSION('content/infos.xml') == 'xml'

FILEMODIFICATIONTIME

Returns the modification time of a file or directory as timestamp. If the file or directory doesn't exist, -1 is returned. Relative paths are interpreted as relative to the Data Home.

Signature


FILEMODIFICATIONTIME($path) : Long

Parameters

  • $path (mandatory)
    The file path.
    Type: String
    Example: 'content/infos.xml'

Return Value

  • Returns the modification time of a file or directory as timestamp.
    Type: Long

Examples

FILEMODIFICATIONTIME('content/infos.xml') == 10552131231

FILENAME

Returns the name of a file or directory (the part of the path after the last path separator).

Signature


FILENAME($path) : String

Parameters

  • $path (mandatory)
    The file path.
    Type: String
    Example: 'content/infos.xml'

Return Value

  • Returns the name of a file or directory given its path.
    Type: String

Examples

FILENAME('content/infos.xml') == 'infos.xml'

FILESIZE

Returns the size of a file in bytes. If the file doesn't exist or if path denotes a directory, -1 is returned. Relative paths are interpreted as relative to the Data Home.

Signature


FILESIZE($path) : Long

Parameters

  • $path (mandatory)
    The file path.
    Type: String
    Example: 'content/infos.xml'

Return Value

  • Returns the size of a file in bytes.
    Type: Long

Examples

FILESIZE('content/infos.xml') == 2131231

FILESYSTEMURL

Build an URL to access a file on the file system given the path to the file. Relative paths are interpreted as relative to the data home. The return value starts with /filesystem and doesn't contain the context path.

Signature


FILESYSTEMURL($path) : String

Parameters

  • $path (mandatory)
    Path to file.
    Type: String
    Example: 'uploads/image.png'

Return Value

  • URL without host and context path.
    Type: String

Examples


FILESYSTEMURL('uploads/image.png') = '/filesystem/212318a0382eb20/image.png'

FILTER

Create a filtered collection according to the filter expression.

Signature


FILTER($collection , $filter , $itemVariable , $inplace) : Any:indexed

Parameters

  • $collection (mandatory)
    The collection that must be filtered.
    Type: Any:indexed
    Example: $collection
  • $filter (mandatory)
    The filter expression.
    Type: Boolean
    Example: filter
  • $itemVariable (optional)
    The name of the variable used for a single item of the list.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: item
  • $inplace (optional)
    If set to true, the collection is filtered in place.
    Type: Boolean
    Example: false

Return Value

  • Filter an indexed collection according to the filter expression.
    Type: Any:indexed

Examples

FILTER($collection, filter, $item)

FindWorkitem

Active Task Workitem.

Signature


FindWorkitem($workflowInstanceId) : Workitem

Parameters

  • $workflowInstanceId (mandatory)
    Workflow Instance Id.
    Type: String
    Example: $workflowInstanceId

Return Value

  • Active Task Workitem.
    Type: Workitem

Examples

FindWorkitem($workflowInstanceId)

FLOOR

Round the given value to the nearest lower integer.

Signature


FLOOR($value) : Integer

Parameters

  • $value (mandatory)
    The value to be rounded.
    Type: Number
    Example: 1.234

Return Value

  • Round the given value to the nearest lower integer.
    Type: Integer

Examples


FLOOR(1.234)=1


FLOOR(10.99)=10

FOCUS

Set the focus.

Signature


FOCUS($htmlId) : Boolean

Parameters

  • $htmlId (mandatory)
    HTML Id of the element.
    Type: String
    Example: 'MyTextField'

Return Value

  • Set the focus.
    Type: Boolean

Examples

FOCUS('MyTextField')

Format:NewReference

Creates a Business Object Reference of type Format:Reference.

Signature


Format:NewReference($id) : Format:Reference

Parameters

  • $id (mandatory)
    Format ID.
    Type: String
    Example: 'myFormat'

Return Value

  • Creates a Business Object Reference of type Format:Reference.
    Type: Format:Reference

Examples

Format:NewReference('myFormat')

Format:Number

This function formats a number according to a Format Business Object. It accepts 1 or 2 arguments. The first argument is always the number to be formatted. When invoked with 2 arguments, the second argument is a Format:Reference to a Format Business Object. When invoked with 1 argument, the argument must be a Data Class property with an assigned Format Business Object.

Signature


Format:Number($number , $pattern) : String

Parameters

  • $number (mandatory)
    The numeric value to be formatted.
    Type: Integer
    Example: (Integer) 120230
    (Long) 600000000
    (Float) 12.3
    (Double) 1234567981234.123
  • $pattern (optional)
    The reference to the Format Business Object.
    Type: Format:Reference
    Example: new Format:Reference('MyPackage:SomeFormatId')

Return Value

  • The number that is formatted.
    Type: String

Examples

Format:Number(1234.5678, new Format:Reference('MyPackage:SomeFormatId'))
Format:Number($object.property)

FROMLIST (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 9 OR LATER. Use ToIndexed instead.

Signature


FROMLIST($dataArray , $list) : Any:indexed

Parameters

  • $dataArray (mandatory)
    The data array to be filled with the elements of the given list.
    Type: Any:indexed
    Example: $tmp.addresses
  • $list (mandatory)
    The collection containing the elements for the data array.
    Type: java.util.Collection
    Example: [...]

Return Value

  • Clear the given data array and fill it with the elemets of the given list.
    Type: Any:indexed

Examples


FROMLIST($tmp.addresses,[...])

GENERATEPDF

Generate a PDF Document according to the list of Actions and the PdfRenderConfiguration.

Signature


GENERATEPDF($actions , $conf) : String

Parameters

  • $actions (mandatory)
    Collection of PdfActions.
    Type: Action:indexed
    Example: $actions
  • $conf (optional)
    PdfRenderConfiguration.
    Type: PdfRenderConfiguration
    Example: $pdfConfiguration

Return Value

  • Return the file location of the PDF.
    Type: String

Examples

GENERATEPDF($actions, $pdfRenderConfiguration)

GETBUSINESSOBJECT

Get a Business Object from the Business Object Repository. If no Version Filter is specified, the current Version Filter will be used.

Signature


GETBUSINESSOBJECT($type , $id , $versionFilter) : BusinessObject

Parameters

  • $type (mandatory)
    Business Object Type.
    Type: String
    Example: 'com.nm.sdk.data.documents.Document'
  • $id (mandatory)
    Business Object Id.
    Type: String
    Example: 'T0012'
  • $versionFilter (optional)
    Version Filter used to select Business Object version.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter('HeadFilter')

Return Value

  • A Business Object Instance or null if the object is not found.
    Type: BusinessObject

Examples

GETBUSINESSOBJECT('com.nm.sdk.data.documents.Document', 'T0012')

GETBUSINESSOBJECTS

Get all Business Objects of a specific Type from the Business Object Repository. If no Version Filter is specified, the current Version Filter will be used.

Signature


GETBUSINESSOBJECTS($type , $versionFilter) : BusinessObject:indexed

Parameters

  • $type (mandatory)
    The name of the Business Object Type that must be fetched.
    Type: String
    Example: 'Rule'
  • $versionFilter (optional)
    Version Filter used to select Business Object version.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter('HeadFilter')

Return Value

  • Get the Business Objects of a specific Type.
    Type: BusinessObject:indexed

Examples

$objects := GETBUSINESSOBJECTS('Rule', VersionFilter('HeadFilter'))

GetCalendar

Get a Calendar instance.

Signature


GetCalendar() : String

Parameters
None
Return Value

  • The locale for which the calendar is generated.
    Type: String

Examples

'de_CH'

GETCOLENTITY

Get a Pointer to the requested collection value.

Signature


GETCOLENTITY($pointer , $property) : com.nm.sdk.data.expeval.Pointer

Parameters

  • $pointer (mandatory)
    The pointer to the object from which we want to get the collection element.
    Type: com.nm.sdk.data.expeval.Pointer
    Example: $entity
  • $property (mandatory)
    The property's index or key.
    Type: java.lang.Object
    Example: 2

Return Value

  • A Pointer to the requested collection value.
    Type: com.nm.sdk.data.expeval.Pointer

Examples

$entity[2]

GetDataContext

Given a token ID associated with a Data Task, the function returns its Data Context.

Signature


GetDataContext($tokenID) : DataLogic:DataContext

Parameters

  • $tokenID (mandatory)
    The token ID for which to retrieve the Data Context.
    Type: String
    Example: $tokenID

Return Value

  • The Data Context for the given token ID.
    Type: DataLogic:DataContext

Examples

GetDataContext($tokenID)

GETDEPENDENCIES

Returns the dependencies of the given business object as an indexed collections of com.nm.sdk.data.references.Reference objects.

Signature


GETDEPENDENCIES($bo , $incoming) : Any:indexed

Parameters

  • $bo (mandatory)
    The business object whose dependency must be searched.
    Type: BusinessObject
    Example: GETBUSINESSOBJECT('Process','Portal');
  • $incoming (optional)
    Specifies if incoming (true) or outgoing (false, is the default value) dependencies must be fetched.
    Type: Boolean
    Example: true

Return Value

  • Returns the dependencies of the given business object as an indexed collections of com.nm.sdk.data.references.Reference objects.
    Type: Any:indexed

Examples

$refs := GETDEPENDENCIES($bo)

GETENTITY

Get the data entity with the given id.

Signature


GETENTITY($entityId) : Any

Parameters

  • $entityId (mandatory)
    The identifier of the data entity that must be retrieved.
    Type: String
    Example: '123123123'

Return Value

  • Get the data entity with the given id.
    Type: Any

Examples

GETENTITY('123123123')

GetIconIds

Return an indexed list of all icons currently registered in Appway.

Signature


GetIconIds() : String:indexed

Parameters
None
Return Value

  • Returns an indexed collection of all registered icon IDs.
    Type: String:indexed

Examples

$ids := GetIconIds()

GetIconUrl

Return a URL to an icon (either as SVG or PNG, depending on the system configuration) for the given icon id, and the given optional size. If no size is given, 32 is used as the default value. Note that Appway may not have the specific icon size you're requesting. If that's the case, the next higher size is returned. For example, if you request an icon that's 70 pixels wide and high, Appway may return one that is 128 pixels wide and high.

Signature


GetIconUrl($string , $number) : String

Parameters

  • $string (mandatory)
    The id of the icon you want.
    Type: String
    Example: 'ext.componentextension.notificationbell'
  • $number (optional)
    The desired size of the icon in pixels (defaults to 32).
    Type: Number
    Example: 512

Return Value

  • Return the URL for the given icon ID.
    Type: String

Examples


GetIconUrl('ext.componentextension.notificationbell')='/resource/(...)/icons/notification_bell/32.png'


GetIconUrl('ext.componentextension.notificationbell',70)='/resource/(...)/icons/notification_bell/128.png'

GetInstalledExtensions

Returns the list of installed Extensions.

Signature


GetInstalledExtensions() : AdapterContainer:indexed

Parameters
None
Return Value

  • Returns the list of installed Extensions.
    Type: AdapterContainer:indexed

Examples

GetInstalledExtensions()

GetLicenseReports

Returns the available license reports for the interval which was requested. The first and the last months will be included in the interval. A maximum number of 12 license reports can be retrieved at once.

Signature


GetLicenseReports($startMonth , $endMonth) : Named String

Parameters

  • $startMonth (mandatory)
    The start year and month of the interval.
    Type: String
    Example: '2018-01'
  • $endMonth (mandatory)
    The end year and month of the interval.
    Type: String
    Example: '2018-05'

Return Value

  • Returns the available license reports for the interval which was requested. The first and the last months will be included in the interval.
    Type: Named String

Examples

GetLicenseReports('2018-01', '2018-05')

GetNotificationReceivers

Get the set of receivers (user Ids) for a given list of topics and a delivery channel. The returned set contains exactly the users who would receive a notification with the given topics sent via SendPubSubNotification.

Signature


GetNotificationReceivers($topics , $deliveryChannelId) : String:indexed

Parameters

  • $topics (mandatory)
    Indexed collection of topic IDs. Users subscribed to at least one of the topics will be part of the result set.
    Type: String:indexed
    Example: ['new-american-client']:String
  • $deliveryChannelId (optional)
    Delivery channel based on whose subscribers the receivers should be computed. If this is not supplied or null, the standard 'appway' delivery channel is used.
    Type: String
    Example: 'appway'

Return Value

  • Get the set of receivers (user Ids) for a given list of topics and a delivery channel. The returned set contains exactly the users who would receive a notification with the given topics sent via SendPubSubNotification.
    Type: String:indexed

Examples

GetNotificationReceivers(['new-american-client']:String, 'appway')

GetNotificationSubscriptions

Get the subscription records matching the given notification subscription filter.

Signature


GetNotificationSubscriptions($filter) : NotificationSubscriptionRecord:indexed

Parameters

  • $filter (mandatory)
    Filter defining which subscriptions to retrieve.
    Type: NotificationSubscriptionFilter
    Example: $filter

Return Value

  • Get the subscription records matching the given notification subscription filter.
    Type: NotificationSubscriptionRecord:indexed

Examples

GetNotificationSubscriptions($filter)

GetNotificationTopicDescription

Get the description of a given topic. If the topic does not exist, or has no description, null is returned.

Signature


GetNotificationTopicDescription($topic) : String

Parameters

  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'myTopic'

Return Value

  • Get the description of a given topic. If the topic does not exist, or has no description, null is returned.
    Type: String

Examples

GetNotificationTopicDescription('myTopic')

GetNotificationTopicIds

Get the Ids of all notification topics in the system.

Signature


GetNotificationTopicIds() : String:indexed

Parameters
None
Return Value

  • Get the Ids of all notification topics in the system.
    Type: String:indexed

Examples

GetNotificationTopicIds()

GetNotificationTopicName

Get the name of a given topic. If the topic does not exist, or has no name, null is returned.

Signature


GetNotificationTopicName($topic) : String

Parameters

  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'myTopic'

Return Value

  • Get the name of a given topic. If the topic does not exist, or has no name, null is returned.
    Type: String

Examples

GetNotificationTopicName('myTopic')

GetNumUnreadNotifications

Get the number of unread notifications for the given user.

Signature


GetNumUnreadNotifications($userId , $inbox) : Integer

Parameters

  • $userId (mandatory)
    The Id of the user.
    Type: String
    Example: USERID()
  • $inbox (optional)
    The type of notification inbox to consider for the given user. If this is not supplied or null, the default inbox is used. Other inboxes are defined by the function configured in nm.usermessaging.notification.inbox.function
    Type: String
    Example: 'alerts'

Return Value

  • Get the number of unread notifications for the given user.
    Type: Integer

Examples

GetNumUnreadNotifications(USERID())
GetNumUnreadNotifications(USERID(), 'alerts')

GetProcessStatistics (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 9 OR LATER. It always returns an empty named collection.

Signature


GetProcessStatistics($processId , $versionUuid) : ProcessStatistics:mapped

Parameters

  • $processId (mandatory)
    Process Id.
    Type: String
    Example: 'OrderProcess'
  • $versionUuid (mandatory)
    Process Version UUId (BusinessObject. GetVersionUuid()).
    Type: String
    Example: 'de64622-....-453e'

Return Value

  • Type: ProcessStatistics:mapped

Examples

GetProcessStatistics('OrderProcess')

GetProcessToken

Retrieves token information given the corresponding ID.

Signature


GetProcessToken($tokenID) : Process:Token

Parameters

  • $tokenID (mandatory)
    The ID of the token to retrieve.
    Type: String
    Example: $tokenID

Return Value

  • The Token information given the corresponding ID.
    Type: Process:Token

Examples


GetProcessToken($tokenID).

GETPROPERTY

Get a Pointer to the requested property value.

Signature


GETPROPERTY($entityPointer , $property) : com.nm.sdk.data.expeval.Pointer

Parameters

  • $entityPointer (mandatory)
    The pointer to the value from which we want to get the property.
    Type: com.nm.sdk.data.expeval.Pointer
    Example: $entity
  • $property (mandatory)
    The property name.
    Type: String
    Example: name

Return Value

  • A Pointer to the requested property value.
    Type: com.nm.sdk.data.expeval.Pointer

Examples

$entity.name

GETSCROLLOFFSETVERTICAL

Get the current vertical scroll offset.

Signature


GETSCROLLOFFSETVERTICAL() : Integer

Parameters
None
Return Value

  • Get the current vertical scroll offset.
    Type: Integer

Examples

GETSCROLLOFFSETVERTICAL()

GetSensorStates

Returns the most recent sensor states for the requested sensors or for all sensors if no parameter is specified. When the query parameter is set to true, the sensors will be queried before returning the result. If the states of the sensors have to be retrieved on all cluster nodes, this function can be passed as an argument to the ExecuteDistributed() function.

Signature


GetSensorStates($query , $sensorIds) : SensorState:indexed

Parameters

  • $query (optional)
    True if the sensors should be queried before returning the result.
    Type: Boolean
    Example: GetSensorStates(true)
  • $sensorIds (optional)
    Comma separated list of sensor ids.
    Type: String
    Example: GetSensorStates(false, 'JavaThreads,CPUUsage')

Return Value

  • Returns a list of the most recent sensor states.
    Type: SensorState:indexed

Examples

GetSensorStates()

GetSubWorkflowTokenId

Returns the sub workflow token id of the requested workflow.

Signature


GetSubWorkflowTokenId($workItem , $workflowRef) : String

Parameters

  • $workItem (mandatory)
    The workitem whose sub-workflow token id must be fetched.
    Type: Workitem
    Example: WORKITEM()
  • $workflowRef (mandatory)
    The reference of the sub workflow whose token id must be fetched.
    Type: Process:Reference
    Example: Process:NewReference('AccountOpening')

Return Value

  • Returns the sub workflow token id of the requested workflow.
    Type: String

Examples

GetSubWorkflowTokenId($workItem, $workflowRef)

GetUser (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:Get instead. Pay attention to different null handling. This deprecated function returns null when argument is null, while new User:Get returns current user ID when argument is null.

Signature


GetUser($userId) : User

Parameters

  • $userId (mandatory)
    The user ID of the user to be returned.
    Type: String
    Example: 'testUserId'

Return Value

  • Returns the user with the specified ID.
    Type: User

Examples

GetUser('userId')

GetUserGroups (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:ListGroupIds instead.

Signature


GetUserGroups($user) : String:indexed

Parameters

  • $user (mandatory)
    The user whose groups has to be returned.
    Type: User
    Example: User:Get()

Return Value

  • Returns the list of groups the user belongs to.
    Type: String:indexed

Examples

GetUserGroups(User:Get())

GetUserRO (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:GetReadOnly instead. Pay attention to different null handling. This deprecated function returns null when argument is null, while new User:GetReadOnly returns current user when argument is null.

Signature


GetUserRO($userId) : User

Parameters

  • $userId (mandatory)
    The user ID of the user to be returned.
    Type: String
    Example: 'testUserId'

Return Value

  • Returns the user with the specified ID for reading only.
    Type: User

Examples

GetUserRO('userId')

GetUserRoles (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:ListRoleIds instead.

Signature


GetUserRoles($user) : String:indexed

Parameters

  • $user (mandatory)
    The user whose roles has to be returned.
    Type: User
    Example: USER()

Return Value

  • Returns the list of roles the user belongs to.
    Type: String:indexed

Examples

GetUserRoles(USER())

GetUsers (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use the User:ListIds together with the User:Get or User:GetReadOnly function.

Signature


GetUsers() : User:indexed

Parameters
None
Return Value

  • Returns the collection with all the users.
    Type: User:indexed

Examples

GetUsers()

GetValuestoreId

Get the id of the current valuestore.

Signature


GetValuestoreId($workflowInstanceId) : String

Parameters

  • $workflowInstanceId (mandatory)
    The workflow instance id.
    Type: String
    Example: '133245342534'

Return Value

  • Get the id of the current valuestore.
    Type: String

Examples

GetValuestoreId($workflowInstanceId)

GREATER

Return true if each argument is greater than its right-hand sibling.

Signature


GREATER($argument1 , $argument2 , $argument3) : Boolean

Parameters

  • $argument1 (mandatory)
    The first object that should be compared.
    Type: Any
    Example: 1
  • $argument2 (mandatory)
    The second object that should be compared.
    Type: Any
    Example: 2
  • $argument3 (optional)
    The third object that should be compared.
    Type: Any
    Example: 1

Return Value

  • Expr1 > expr2 (> expr3).
    Type: Boolean

Examples


GREATER(2,1)=true


GREATER(1,1)=false


GREATER(1,2)=false


GREATER(2,1,0)=true


GREATER(2,1,1)=false

GREATEREQUAL

Return true if each argument is greater than or equal to its right-hand sibling.

Signature


GREATEREQUAL($argument1 , $argument2 , $argument3) : Boolean

Parameters

  • $argument1 (mandatory)
    The first object that should be compared.
    Type: Any
    Example: 1
  • $argument2 (mandatory)
    The second object that should be compared.
    Type: Any
    Example: 2
  • $argument3 (optional)
    The third object that should be compared.
    Type: Any
    Example: 1

Return Value

  • Expr1 >= expr2.
    Type: Boolean

Examples


GREATEREQUAL(2,1)=true


GREATEREQUAL(1,1)=true


GREATEREQUAL(1,2)=false


GREATEREQUAL(2,1,0)=true


GREATEREQUAL(2,1,1)=true

HasKey

Returns true if the key exists.

Signature


HasKey($keyAlias) : String

Parameters

  • $keyAlias (mandatory)
    The encryption key alias.
    Type: String
    Example: 'my-key-alias'

Return Value

  • Returns true if the key exists.
    Type: String

Examples

HasKey('my-key-alias')

Http:ReadRequest

Read the body of the current HTTP request and return it as a String. Note: This only works if the HTTP request was not processed before.

Signature


Http:ReadRequest() : String

Parameters
None
Return Value

  • The body of the current HTTP request.
    Type: String

Examples

Http:ReadRequest()

HTTPCOOKIEGET

Get the value of an HTTP cookie by name. Returns null if the cookie doesn't exist.

Signature


HTTPCOOKIEGET($name) : String

Parameters

  • $name (mandatory)
    Cookie name.
    Type: String
    Example: 'language'

Return Value

  • Cookie value.
    Type: String

Examples


HTTPCOOKIEGET('language') = 'de'

HTTPCOOKIESET

Set a HTTP cookie. Returns true if the cookie has been set. Pass null as value to delete the cookie.

Signature


HTTPCOOKIESET($name , $value , $maxAge , $domain , $path , $secure) : Boolean

Parameters

  • $name (mandatory)
    Cookie name.
    Type: String
    Example: 'language'
  • $value (mandatory)
    Cookie value.
    Type: String
    Example: 'de'
  • $maxAge (optional)
    Max age of the cookie in seconds, -1 (default) for a non-persistent (session) cookie.
    Type: Integer
    Example: 3600
  • $domain (optional)
    Cookie domain (null for no value).
    Type: String
    Example: 'www.numcom.com'
  • $path (optional)
    Cookie path.
    Type: String
    Example: '/'
  • $secure (optional)
    Cookie secure flag.
    Type: Boolean
    Example: false

Return Value

  • Set an HTTP cookie.
    Type: Boolean

Examples

HTTPCOOKIESET('language', 'de', -1)

HTTPGET

Execute a HTTP Get Request to an URL. The function returns the HTTP status code of the response. Important status codes: 200 ok, 304 not modified, 401 unauthorized, 403 forbidden, 404 not found, 500 internal server error. A negative result means an non-HTTP error: -1 unknown I/O error, -2 malformed URL, -3 unknown host, -4 socket timeout, -10 unknown socket error, -11 connection error, -12 no route to host, -13 port unreachable, -14 SSL client authentication failed, -15 Security Issue accessing KeyStores.

Signature


HTTPGET($url , $file , $username , $password , $timeout , $proxyHost , $proxyPort , $proxyUsername , $proxyPassword , $certificateAlias) : Integer

Parameters

  • $url (mandatory)
    URL.
    Type: String
    Example: 'http://www.numcom.com'
  • $file (optional)
    File path to save the response. A relative path is considered relative to the Data Home. If the path refers to an existing directory, the function uses the HTTP header 'Content-Disposition' (if present) to determine a file name. If no path is specified, the HTTP response body is not saved.
    Type: String
    Example: work/tmp/download.tmp
  • $username (optional)
    Username.
    Type: String
    Example: 'User001'
  • $password (optional)
    Password.
    Type: String
    Example: 'changeit'
  • $timeout (optional)
    Timeout in seconds (default is 30 seconds).
    Type: Integer
    Example: 120
  • $proxyHost (optional)
    Host name or IP address of proxy server.
    Type: String
    Example: proxy.domain.local
  • $proxyPort (optional)
    Proxy server port (default is 8008).
    Type: Integer
    Example: 8008
  • $proxyUsername (optional)
    Username for proxy server.
    Type: String
    Example: 'T02312211'
  • $proxyPassword (optional)
    Password for proxy server.
    Type: String
    Example: 'letmepass'
  • $certificateAlias (optional)
    The keystore alias to be used for SSL authentication.
    Type: String
    Example: 'appway'

Return Value

  • HTTP status code.
    Type: Integer

Examples

HTTPGET('http://www.numcom.com', $file)

HTTPPOST

Execute a HTTP Post Request to an URL. The function returns the HTTP status code of the response. A negative result means an non-HTTP error: -1 unknown I/O error, -2 malformed URL, -3 unknown host, -4 socket timeout, -10 unknown socket error, -11 connection error, -12 no route to host, -13 port unreachable, -14 SSL client authentication failed, -15 Security Issue accessing KeyStores. Set the key 'PostBodyText' to a string or the key 'PostBodyFile' to a file path in order to specify the POST request body manually (all other keys will be ignored in this case).

Signature


HTTPPOST($url , $data , $file , $username , $password , $timeout , $proxyHost , $proxyPort , $proxyUsername , $proxyPassword , $contentCharset , $certificateAlias) : Integer

Parameters

  • $url (mandatory)
    URL.
    Type: String
    Example: 'http://twitter.com/statuses/update.xml'
  • $data (optional)
    POST data as named collection.
    Type: Any:mapped
    Example: $data
  • $file (optional)
    File path to save the response. A relative path is considered relative to the Data Home. If the path refers to an existing directory, the function uses the HTTP header 'Content-Disposition' (if present) to determine a file name. If no path is specified, the HTTP response body is not saved.
    Type: String
    Example: work/tmp/download.tmp
  • $username (optional)
    Username.
    Type: String
    Example: 'User001'
  • $password (optional)
    Password.
    Type: String
    Example: 'changeit'
  • $timeout (optional)
    Timeout in seconds (default is 30 seconds).
    Type: Integer
    Example: 120
  • $proxyHost (optional)
    Host name or IP address of proxy server.
    Type: String
    Example: proxy.domain.local
  • $proxyPort (optional)
    Proxy server port (default is 8008).
    Type: Integer
    Example: 8008
  • $proxyUsername (optional)
    Username for proxy server.
    Type: String
    Example: 'T02312211'
  • $proxyPassword (optional)
    Password for proxy server.
    Type: String
    Example: 'letmepass'
  • $contentCharset (optional)
    Content Charset (default: ISO-8859-1).
    Type: String
    Example: 'UTF-8'
  • $certificateAlias (optional)
    The keystore alias to be used for SSL authentication.
    Type: String
    Example: 'appway'

Return Value

  • HTTP status code.
    Type: Integer

Examples

HTTPPOST('http://twitter.com/statuses/update.xml', null, $file)

HTTPREQUEST

Get the Http Request object.

Signature


HTTPREQUEST() : HttpRequest

Parameters
None
Return Value

  • Get the Http Request object.
    Type: HttpRequest

Examples

HTTPREQUEST()

HTTPRESPONSE

Get the Http Response object.

Signature


HTTPRESPONSE() : HttpResponse

Parameters
None
Return Value

  • Get the Http Response object.
    Type: HttpResponse

Examples

HTTPRESPONSE()

HTTPSESSION (Deprecated)

Get the current user's HTTP session. Returns null if the session doesn't exist. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2026 OR LATER.

Signature


HTTPSESSION($create) : HttpSession

Parameters

  • $create (optional)
    Create session if it doesn't exist (default: true).
    Type: Boolean
    Example: true

Return Value

  • HTTP session.
    Type: HttpSession

Examples

HTTPSESSION()

HttpSession:GetHashedId

Get the hash of the current user's HTTP session ID. Returns null if the session doesn't exist.

Signature


HttpSession:GetHashedId() : String

Parameters
None
Return Value

  • The hash of the current user's HTTP session ID.
    Type: String

Examples

HttpSession:GetHashedId()

HttpSession:GetId

Get the current user's HTTP session ID. Returns null if the session doesn't exist. For security reasons, consider using HttpSession:GetHashedId() if the real HTTP session ID is not required.

Signature


HttpSession:GetId() : String

Parameters
None
Return Value

  • The current user's HTTP session ID.
    Type: String

Examples

HttpSession:GetId()

HTTPSESSIONGET (Deprecated)

Get the value of an HTTP session attribute by name. Returns null if the session doesn't exist. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2026 OR LATER.

Signature


HTTPSESSIONGET($name) : Any

Parameters

  • $name (mandatory)
    Attribute name.
    Type: String
    Example: 'language'

Return Value

  • Attribute value.
    Type: Any

Examples


HTTPSESSIONGET('language') = 'de'

HTTPSESSIONSET (Deprecated)

Set an HTTP session attribute. Returns true if the attribute has been set. Pass null as value to remove the attribute. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2026 OR LATER.

Signature


HTTPSESSIONSET($name , $value) : Boolean

Parameters

  • $name (mandatory)
    Attribute name.
    Type: String
    Example: 'language'
  • $value (mandatory)
    Attribute value.
    Type: Any
    Example: 'de'

Return Value

  • Set an HTTP session attribute.
    Type: Boolean

Examples

HTTPSESSIONSET('language', 'de')

HTTPURL

Get the URL of the last HTTP request. All GET and POST parameters will be added to the URL as query parameters.

Signature


HTTPURL() : String

Parameters
None
Return Value

  • URL string.
    Type: String

Examples

HTTPURL()

IF

If the first argument ist true, execute and return the second argument. If the first argument is false, execute and return the third argument.

Signature


IF($booleanArgument , $caseTrue , $caseFalse) : Any

Parameters

  • $booleanArgument (mandatory)
    The boolean argument.
    Type: Boolean
    Example: true
  • $caseTrue (mandatory)
    Executed if boolean argument is true.
    Type: Any
    Example: expression
  • $caseFalse (optional)
    Executed if boolean argument is false.
    Type: Any
    Example: expression

Return Value

  • Execute and return the second argument if booleanArgument evaluates to true. Otherwise, execute and return the third argument.
    Type: Any

Examples


IF(true,'hello','world')='hello'


IF(false,'hello','world')='world'

ImageInfo

Get information about an image: width, height, format etc.

Signature


ImageInfo($file , $versionFilter) : ImageInfo

Parameters

  • $file (mandatory)
    Image file path or resource id.
    Type: String
    Example: 'uploads/logo.gif'
  • $versionFilter (optional)
    Version filter.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter('HeadFilter')

Return Value

  • ImageInfo object.
    Type: ImageInfo

Examples

ImageInfo($file)

INCOMINGDEPENDENCIES

Returns an indexed collection of dependency sources (type 'Any') which depend on the Object of the given type and id. Dependencies from non-head objects or deleted objects will not be returned.

Signature


INCOMINGDEPENDENCIES($type , $id) : Any:indexed

Parameters

  • $type (mandatory)
    The Business Object's type.
    Type: String
    Example: 'Screen'
  • $id (mandatory)
    The Business Object's id.
    Type: String
    Example: 'Portal'

Return Value

  • Returns an indexed collection of dependency sources (type 'Any') which depend on the Object of the given type and id.
    Type: Any:indexed

Examples

INCOMINGDEPENDENCIES('Screen', 'Portal')

INDEXOF (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2023 OR LATER. Use Collection:GetIndexOf instead.

Signature


INDEXOF($element , $collection) : Integer

Parameters

  • $element (mandatory)
    Element.
    Type: Any
    Example: $element
  • $collection (mandatory)
    Collection.
    Type: Any:indexed
    Example: $collection

Return Value

  • Get the index of an element in an indexed collection.
    Type: Integer

Examples

INDEXOF($element, $collection)

InjectVariable

Inject a variable in the given scope.

Signature


InjectVariable($scope , $varName , $varType , $value) : Nothing

Parameters

  • $scope (mandatory)
    The scope where the variable must be injected.
    Type: Any
    Example: $scope
  • $varName (mandatory)
    The name of the variable.
    Type: String
    Example: 'a'
  • $varType (mandatory)
    The type of the variable e.g. String, Indexed Integer.
    Type: String
    Example: 'Named Any'
  • $value (mandatory)
    The value of the variable.
    Type: Any
    Example: '123'

Return Value

  • Inject a variable in the given scope.
    Type: Nothing

Examples

InjectVariable($scope, $name, $type, $value)

INPREVIEW

Return true if expression is evaluated in Screen preview mode, false otherwise.

Signature


INPREVIEW() : Boolean

Parameters
None
Return Value

  • Return true if expression is evaluated in Screen preview mode, false otherwise.
    Type: Boolean

Examples

INPREVIEW()
IF(INPREVIEW(), 'You are using the preview mode', 'You are not using the preview mode')

INTERSECTION

Calculate the intersection of two indexed collections.

Signature


INTERSECTION($collection , $collection) : Any:indexed

Parameters

  • $collection (mandatory)
    Collection.
    Type: Any:indexed
    Example: $collection1
  • $collection (mandatory)
    Collection.
    Type: Any:indexed
    Example: $collection2

Return Value

  • Intersection of two indexed collections.
    Type: Any:indexed

Examples

INTERSECTION($collection1, $collection2)

INTERSECTION(['a','b'],['b','c']) = ['b']

ISA

Return true if argument 1 is an instance of the class given in argument 2.

Signature


ISA($instance , $type) : Boolean

Parameters

  • $instance (mandatory)
    The instance whose type must be checked.
    Type: Any
    Example: $b
  • $type (mandatory)
    The type that must be checked.
    Type: String
    Example: Person

Return Value

  • True if param1 is an instance of the class given in param2.
    Type: Boolean

Examples

ISA($b, Person)

IsAjaxUpdateRequest

This function checks whether the current HTTP request is an Ajax Update request. If it is called with an HTML id pattern as argument, it also checks whether an area with a matching HTML id is updated.

Signature


IsAjaxUpdateRequest($htmlIdPattern) : Boolean

Parameters

  • $htmlIdPattern (optional)
    Regular expression pattern for an HTML id of an Ajax Update area.
    Type: String
    Example: 'PersonTable'
    'Menu.*'

Return Value

  • True if the current HTTP request is an Ajax Update request (for the area with a matching HTML id), false otherwise.
    Type: Boolean

Examples


IsAjaxUpdateRequest() = true


IsAjaxUpdateRequest('PersonTable') = false

IsDataEntity

Check if the given path points to a dataentity of the given type.

Signature


IsDataEntity($dataPath , $type , $throw) : java.lang.Boolean

Parameters

  • $dataPath (mandatory)
    The location to be checked.
    Type: Any
    Example: $a.b
  • $type (mandatory)
    The expected type.
    Type: String
    Example: 'String'
    'Any'
    'Person'
  • $throw (optional)
    If true throw an exception.
    Type: Boolean
    Example: false

Return Value

  • Check if the given path points to a dataentity of the given type.
    Type: java.lang.Boolean

Examples

IsDataEntity($a.b, 'Any')

IsDataPlaceholder

Returns true if the given path points to a DataPlaceholder (of the given type, if any was provided); false otherwise. It throws an exception if one or more nodes in the path are a DataPlaceholder themself (excluded the leaf node).

Signature


IsDataPlaceholder($dataPath , $dataPlaceholderOrigin) : Boolean

Parameters

  • $dataPath (mandatory)
    The location to be checked.
    Type: Any
    Example: $entity.propertyName
  • $dataPlaceholderOrigin (optional)
    The expected origin for the DataPlaceholder.
    Type: String
    Example: 'ExtensionABC'

Return Value

  • True if the given path points to a DataPlaceholder (of the given type, if any was provided); false otherwise.
    Type: Boolean

Examples

IsDataPlaceholder($entity.propertyName, 'ExtensionABC')

IsDefined

Return true if a variable with the given name is defined.

Signature


IsDefined($variableName) : Boolean

Parameters

  • $variableName (mandatory)
    The name of the variable to be checked, not the variable itself!
    Type: String
    Example: 'variable

Return Value

  • True if a variable with the given name is defined.
    Type: Boolean

Examples

IsDefined('variable')

IsPrimitiveType

Check if the provided type is a Primitive. If so true is returned, false otherwise.

Signature


IsPrimitiveType($type) : Boolean

Parameters

  • $type (mandatory)
    The type to be checked.
    Type: String
    Example: COB:Client

Return Value

  • True if the provided type is a Primitive, false otherwise.
    Type: Boolean

Examples

Boolean $isPrimitiveType := IsPrimitiveType('COB:Client')

ISRECENTLYUSED

Returns whether the given object was recently used by the given user.

Signature


ISRECENTLYUSED($type , $id , $userId) : Boolean

Parameters

  • $type (mandatory)
    The Business Object's type.
    Type: String
    Example: 'Screen'
  • $id (mandatory)
    The Business Object's id.
    Type: String
    Example: 'Portal'
  • $userId (mandatory)
    The User's id.
    Type: String
    Example: 'john'

Return Value

  • Whether the given object was recently used by the given user.
    Type: Boolean

Examples

ISRECENTLYUSED('Screen', 'Portal', 'john')

JaasLoginTest

Test whether the given user is accepted by a JAAS application.

Signature


JaasLoginTest($appName , $userId , $password) : Boolean

Parameters

  • $appName (mandatory)
    JAAS application name.
    Type: String
    Example: 'appway'
  • $userId (mandatory)
    User id.
    Type: String
    Example: $userid
  • $password (mandatory)
    Password.
    Type: String
    Example: $password

Return Value

  • Type: Boolean

Examples

JaasLoginTest('appway', $userid, $password)

JOIN

Join all arguments into one text, appending them to each other.

Signature


JOIN($string , $string) : String

Parameters

  • $string (mandatory)
    A string.
    Type: String
    Example: 'hello'
  • $string (optional)
    A string.
    Type: String
    Example: 'hello'

Return Value

  • Join all string arguments.
    Type: String

Examples


JOIN('hello',' ','world')='hello world'


JOIN('John','; ','Jill','; ','James')='John; Jill; James'

JOINLIST

Join an list of strings into a single string. Use the reverse function SPLIT to split a string into a list of strings.

Signature


JOINLIST($list , $string) : String

Parameters

  • $list (mandatory)
    List with string elements.
    Type: String:indexed
    Example: $texts
  • $string (optional)
    Separator string.
    Type: String
    Example: '|'

Return Value

  • Join a list of strings.
    Type: String

Examples


JOINLIST($texts, '|')='hello|world'


JOINLIST(['James','John','Jim'], ';')='James;John;Jim'

JOINPATH

Join all path elements into one path, appending them to each other using / as separator.

Signature


JOINPATH($string , $string) : String

Parameters

  • $string (mandatory)
    A path.
    Type: String
    Example: 'data'
  • $string (optional)
    A path.
    Type: String
    Example: 'content'

Return Value

  • Join a path.
    Type: String

Examples


JOINPATH('content','files')='content/files'


JOIN('/nm/data','backups\2007/','/10')='/nm/data/backups/2007/10'

KEY

Find the key of a given element in a named collection.

Signature


KEY($element , $collection) : String

Parameters

  • $element (mandatory)
    Element.
    Type: Any
    Example: $element
  • $collection (mandatory)
    Collection.
    Type: Any:mapped
    Example: $collection

Return Value

  • Get the key of an element in a named collection.
    Type: String

Examples

KEY($element, $collection)

KEYS

Get all keys in a named collection.

Signature


KEYS($collection) : String:indexed

Parameters

  • $collection (mandatory)
    Named collection.
    Type: Any:mapped
    Example: $collection

Return Value

  • Return all keys in a named collection.
    Type: String:indexed

Examples

KEYS($collection)

KEYS(['name':'John';'street':'Hollywood Boulevard']) = ['name','street']

Label:NewReference

Creates a Business Object Reference of type Label:Reference.

Signature


Label:NewReference($id) : Label:Reference

Parameters

  • $id (mandatory)
    Label ID.
    Type: String
    Example: 'myLabel'

Return Value

  • Creates a Business Object Reference of type Label:Reference.
    Type: Label:Reference

Examples

Label:NewReference('myLabel')

Label:Translate

Translate a Label Business Object with the assigned variables (optional) and according to the Language (optional).

Signature


Label:Translate($labelReference , $assignedVariables , $language) : String

Parameters

  • $labelReference (mandatory)
    The Label:Reference identifying the Label Business Object.
    Type: Label:Reference
    Example: Label:NewReference('MyPackage:MyLabel')
  • $assignedVariables (optional)
    (optional) a Named String of pairs variable-value used by the Label.
    Type: Named String
    Example: {'varName1'='value', 'varName2'='another value'}:String
  • $language (optional)
    (optional) Language to use in the translation, defaults to the current user's language.
    Type: String
    Example: 'de' or 'de_CH'

Return Value

  • The text of the translated Label.
    Type: String

Examples


Label:Translate(Label:NewReference('MyPackage:MyLabel'), {'varName1'='value'}:String, 'de') -> 'Translated Text'

LANGUAGE

Returns the current translation language.

Signature


LANGUAGE() : String

Parameters
None
Return Value

  • Translation language.
    Type: String

Examples


LANGUAGE() = 'fr'

LeftPad

Make sure the given string has at least the given length.

Signature


LeftPad($text , $length , $paddingChar) : String

Parameters

  • $text (mandatory)
    The text to be padded.
    Type: String
    Example: 'bar'
  • $length (mandatory)
    The minimal length.
    Type: Integer
    Example: 5
  • $paddingChar (optional)
    The character that is used for padding (default is ' '.
    Type: String
    Example: ' '

Return Value

  • Make sure the given string has at least the given length.
    Type: String

Examples


LeftPad('bar',5)='  bar'


LeftPad('barfoo',5)='barfoo'

LENGTH

Calculate the length of the given string argument.

Signature


LENGTH($string) : Integer

Parameters

  • $string (mandatory)
    The string whose length we want.
    Type: String
    Example: 'hello'

Return Value

  • Return the length of the given string argument.
    Type: Integer

Examples


LENGTH('hello')=5

LESS

Return true if each argument is less than its right-hand sibling.

Signature


LESS($argument , $argument , $argument) : Boolean

Parameters

  • $argument (mandatory)
    The first object that should be compared.
    Type: Any
    Example: 1
  • $argument (mandatory)
    The second object that should be compared.
    Type: Any
    Example: 2
  • $argument (optional)
    The third object that should be compared.
    Type: Any
    Example: 1

Return Value

  • Expr1 < expr2 (< expr3).
    Type: Boolean

Examples


LESS(1,2,3)=true


LESS(1,2,2)=false


LESS(2,2,2)=false


LESS(2,2,1)=false

LESSEQUAL

Return true if each argument is less than or equal to its right-hand sibling.

Signature


LESSEQUAL($argument , $argument , $argument) : Boolean

Parameters

  • $argument (mandatory)
    The first object that should be compared.
    Type: Any
    Example: 1
  • $argument (mandatory)
    The second object that should be compared.
    Type: Any
    Example: 2
  • $argument (optional)
    The third object that should be compared.
    Type: Any
    Example: 1

Return Value

  • Expr1 <= expr2 (<= expr3).
    Type: Boolean

Examples


LESSEQUAL(1,2,3)=true


LESSEQUAL(1,2,2)=true


LESSEQUAL(2,2,2)=true


LESSEQUAL(2,2,1)=false

LIST

Search the given catalog for the given value in the column 'searchColumn' and return the value from column 'selectColumn'.

Signature


LIST($searchValue , $catalogRef , $selectColumn , $searchColumn , $variableAssignments) : String

Parameters

  • $searchValue (mandatory)
    The value we are looking for in the list.
    Type: String
    Example: 'thevalue'
  • $catalogRef (mandatory)
    The reference to the catalog in which we are searching.
    Type: Catalog:Reference
    Example: Catalog:NewReference('catalog')
  • $selectColumn (optional)
    The column whose value should be returned, default is 'id'.
    Type: String
    Example: 'column'
  • $searchColumn (optional)
    The column in which we search the value, default is 'id'.
    Type: String
    Example: 'column'
  • $variableAssignments (optional)
    possible variable assignments
    Type: Any:mapped
    Example: {'var1'='test', 'var2'=false}:Any

Return Value

  • Search the given catalog for the given value in the column 'searchColumn' and return the value from column 'selectColumn'.
    Type: String

Examples

LIST(searchValue, catalogRef, selectColumn, searchColumn)

ListClusterFiles

Lists all cluster file IDs (paths), optionally filtered with a given regular expression.

Signature


ListClusterFiles($filterExpression) : ClusterFile:indexed

Parameters

  • $filterExpression (optional)
    A regular expression that is used to filter the cluster file paths.
    Type: String
    Example: 'foo/bar/.*'

Return Value

  • An indexed collection of cluster files.
    Type: ClusterFile:indexed

Examples

ListClusterFiles(null)

LISTCONTENT

Get an indexed collection of file and directory names contained in a directory. Names are ordered case insensitive. If the directory doesn't exists, null is returned. Relative paths are interpreted relative to the Data Home.

Signature


LISTCONTENT($path) : String:indexed

Parameters

  • $path (mandatory)
    The directory to list the content from.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns an indexed collection of file and directory names.
    Type: String:indexed

Examples

LISTCONTENT('uploads/2006')

LISTDIRECTORIES

Get an indexed collection of directory names contained in a directory. Directories are ordered by name (case insensitive). If the directory doesn't exists, null is returned. Relative paths are interpreted relative to the Data Home.

Signature


LISTDIRECTORIES($path) : String:indexed

Parameters

  • $path (mandatory)
    The directory to list the subdirectories from.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns an indexed collection of directory names.
    Type: String:indexed

Examples

LISTDIRECTORIES('uploads/2006')

LISTFILES

Get an indexed collection of file names contained in a directory. Files are ordered by name (case insensitive). If the directory doesn't exists, null is returned. Relative paths are interpreted relative to the Data Home.

Signature


LISTFILES($path) : String:indexed

Parameters

  • $path (mandatory)
    The directory to list the files from.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns an indexed collection of file names.
    Type: String:indexed

Examples

LISTFILES('uploads/2006')

ListProcessInstanceIndexDefinitions

Function that lists the available process instance indexes.

Signature


ListProcessInstanceIndexDefinitions() : Any

Parameters
None
Return Value

  • Returns a list with existing process instance indexes.
    Type: Any

Examples

ListProcessInstanceIndexDefinitionsFunction()

LN

Return the natural logarithm (base e) of the argument value.

Signature


LN($value) : Double

Parameters

  • $value (mandatory)
    The value.
    Type: Double
    Example: 2.489

Return Value

  • Returns the natural logarithm (base e) of the argument value.
    Type: Double

Examples


LN(EXP(2))=2.0

LOADFROMCSV

Get a collection of entities generated from the given csv file.

Signature


LOADFROMCSV($dataclass , $file , $separator , $escape , $quote , $encoding , $skipLines) : Any:indexed

Parameters

  • $dataclass (mandatory)
    The name of the dataclass.
    Type: String
    Example: 'Person'
  • $file (mandatory)
    The name of the csv file.
    Type: String
    Example: 'f.txt'
  • $separator (optional)
    The field separator character. Default: ';'.
    Type: String
    Example: ';'
  • $escape (optional)
    The escape character. Default: '"'.
    Type: String
    Example: '"'
  • $quote (optional)
    The quote character. Default: the same as the escape character.
    Type: String
    Example: '"'
  • $encoding (optional)
    The file encoding. Default: the system default encoding.
    Type: String
    Example: 'UTF-8'
  • $skipLines (optional)
    Numbers of lines to skip from the beginning of the file. Default: 0.
    Type: Integer
    Example: 0

Return Value

  • Get a collection of entities generated from the given csv file.
    Type: Any:indexed

Examples

$anyIndexed := LOADFROMCSV('DataClass', 'file')

LoadNotifications

Load the newest notifications of the given user (read and unread).

Signature


LoadNotifications($userId , $n , $unreadOnly , $inbox) : Notification:indexed

Parameters

  • $userId (mandatory)
    The Id of the user whose notifications to load.
    Type: String
    Example: USERID()
  • $n (mandatory)
    The maximal number of notifications to return. If this is -1, all notifications are returned.
    Type: Integer
    Example: 10
  • $unreadOnly (optional)
    If this is set to true, only unread notifications are returned. Default is false.
    Type: Boolean
    Example: true
  • $inbox (optional)
    The type of notification inbox to load for the given user. If this is not supplied or null, the default inbox is used. Other inboxes are defined by the function configured in nm.usermessaging.notification.inbox.function
    Type: String
    Example: alerts

Return Value

  • Load the newest notifications of the given user (read and unread).
    Type: Notification:indexed

Examples

LoadNotifications(USERID(), 10)

LOADTESTDATA

Load a test data set. The loader searches for variables in the current scope hierarchy and assigns the values of corresponding variables in the testset if available.

Signature


LOADTESTDATA($testDataId , $deprecated) : Nothing

Parameters

  • $testDataId (mandatory)
    The id of the Test Data.
    Type: String
    Example: 'Persons'
  • $deprecated (optional)
    Deprecated, do not use this parameter anymore.
    Type: Boolean
    Example: true

Return Value

  • Load a test data set.
    Type: Nothing

Examples

LOADTESTDATA('id of test data')

LocalProcessInstanceIds

Get the IDs of all locally owned process instances matching the criteria defined on the given predicate. Return the IDs of all locally owned process instances if no predicate is given.

Signature


LocalProcessInstanceIds($processInstancePredicate) : String:indexed

Parameters

  • $processInstancePredicate (optional)
    The predicate on which the search criteria have been defined.
    Type: ProcessInstancePredicate
    Example: See below.

Return Value

  • Get the IDs of all locally owned process instances matching the criteria defined on the given predicate. Return the IDs of all locally owned process instances if no predicate is given.
    Type: String:indexed

Examples

ProcessInstancePredicate $pip := new ProcessInstancePredicate;
$pip.addQueueName(USERID());
LocalProcessInstanceIds($pip);

LocationPath

The LocationElement path for the given workitem id.

Signature


LocationPath($workitemId , $type) : LocationPathElement:indexed

Parameters

  • $workitemId (mandatory)
    The id workitem. TokenId.
    Type: String
    Example: $workitemId
  • $type (optional)
    The type of the id: 'Process' (default), 'Screen'.
    Type: String
    Example: 'Process'

Return Value

  • The LocationElement path for the given workitem id.
    Type: LocationPathElement:indexed

Examples

LocationPath($workitemId)

LocationStack

Get the current Location Stack.

Signature


LocationStack() : Any:indexed

Parameters
None
Return Value

  • Location Stack.
    Type: Any:indexed

Examples

LocationStack()

LOG

Return the first argument value's logarithm using the second argument value as the base.

Signature


LOG($value , $base) : Double

Parameters

  • $value (mandatory)
    The value.
    Type: Double
    Example: 2.489
  • $base (optional)
    The base value.
    Type: Integer
    Example: 10

Return Value

  • Returns the first argument value's logarithm to the second argument value.
    Type: Double

Examples


LOG(100,10)=2

LOGGER

Write a message to a logger with a given priority.

Signature


LOGGER($priority , $message , $logger) : Nothing

Parameters

  • $priority (mandatory)
    The message's priority: 'fatal','error','warn','info', 'debug', or 'trace'.
    Type: String
    Example: 'info'
  • $message (mandatory)
    The message.
    Type: Any
    Example: 'hello logger'
  • $logger (optional)
    logger name, default is 'com.nm.exprlang.functions.LoggerFunction'
    Type: String
    Example: 'com.nm.exprlang.functions.LoggerFunction'

Return Value

  • Write the given message with the given priority to a logger.
    Type: Nothing

Examples

LOGGER('info', 'hello')

LOGIN

Login a user given its username and password. This function must be called in a context where an HTTP request is available. The function returns true if login was successful. The function returns false if there is no HTTP request available or if the username or the password is not correct.

Signature


LOGIN($username , $password) : Boolean

Parameters

  • $username (mandatory)
    User name.
    Type: String
    Example: $username
  • $password (mandatory)
    Password.
    Type: String
    Example: $password

Return Value

  • True if login was successful, false otherwise.
    Type: Boolean

Examples

LOGIN($username, $password)

LOGOUT

Logout the current user by invalidating its HTTP session. Returns true if logout has been successful.

Signature


LOGOUT() : Boolean

Parameters
None
Return Value

  • Type: Boolean

Examples

LOGOUT()

LONG

Return the long date format of the given date and locale.

Signature


LONG($date , $locale , $timeZone) : String

Parameters

  • $date (mandatory)
    The date we want to format.
    Type: Date
    Example: NOW()
  • $locale (optional)
    The language code.
    Type: String
    Example: 'de'
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: 'US/Eastern', 'Europe/Zurich', 'GMT'

Return Value

  • Returns the long date format of the given date and locale.
    Type: String

Examples


LONG(NOW())=....

LOWERCASE

Convert all of the characters in the String to lower case.

Signature


LOWERCASE($string) : String

Parameters

  • $string (mandatory)
    The string.
    Type: String
    Example: 'HELLO'

Return Value

  • Converts all of the characters in the String to lower case.
    Type: String

Examples


LOWERCASE('HELLO')='hello'


LOWERCASE('John Woo')='john woo'

Mail:CreateIncomingMailConfiguration

Creates an Incoming Mail Configuration.

Signature


Mail:CreateIncomingMailConfiguration($incomingMailConfiguration) : Nothing

Parameters

  • $incomingMailConfiguration (mandatory)
    Instance of a Mail:IncomingMailConfiguration.
    Type: Mail:IncomingMailConfiguration
    Example: $incomingMailConfiguration

Return Value

  • Type: Nothing

Examples

Mail:CreateIncomingMailConfiguration($incomingMailConfiguration)

Mail:CreateOutgoingMailConfiguration

Creates an Outgoing Mail Configuration.

Signature


Mail:CreateOutgoingMailConfiguration($outgoingMailConfiguration) : Nothing

Parameters

  • $outgoingMailConfiguration (mandatory)
    Instance of a Mail:OutgoingMailConfiguration.
    Type: Mail:OutgoingMailConfiguration
    Example: $outgoingMailConfiguration

Return Value

  • Type: Nothing

Examples

Mail:CreateOutgoingMailConfiguration($outgoingMailConfiguration)

Mail:DeleteIncomingMailConfiguration

Delete Incoming Mail Configuration with given Id.

Signature


Mail:DeleteIncomingMailConfiguration($incomingMailConfigurationId) : Nothing

Parameters

  • $incomingMailConfigurationId (mandatory)
    Id of the incoming mail configuration.
    Type: String
    Example: $incomingMailConfigurationId

Return Value

  • Type: Nothing

Examples

Mail:DeleteIncomingMailConfiguration($incomingMailConfigurationId)

Mail:DeleteOutgoingMailConfiguration

Delete Outgoing Mail Configuration with given Id.

Signature


Mail:DeleteOutgoingMailConfiguration($outgoingMailConfigurationId) : Nothing

Parameters

  • $outgoingMailConfigurationId (mandatory)
    Id of the outgoing mail configuration.
    Type: String
    Example: $outgoingMailConfigurationId

Return Value

  • Type: Nothing

Examples

Mail:DeleteOutgoingMailConfiguration($outgoingMailConfigurationId)

Mail:GetIncomingMailConfiguration

Retrieves Incoming Mail Configuration with given Id.

Signature


Mail:GetIncomingMailConfiguration($incomingMailConfigurationId) : Mail:IncomingMailConfiguration

Parameters

  • $incomingMailConfigurationId (mandatory)
    Id of the incoming mail configuration.
    Type: String
    Example: $incomingMailConfigurationId

Return Value

  • Type: Mail:IncomingMailConfiguration

Examples

Mail:GetIncomingMailConfiguration($incomingMailConfigurationId)

Mail:GetOutgoingMailConfiguration

Retrieves Outgoing Mail Configuration with given Id.

Signature


Mail:GetOutgoingMailConfiguration($outgoingMailConfigurationId) : Mail:OutgoingMailConfiguration

Parameters

  • $outgoingMailConfigurationId (mandatory)
    Id of the outgoing mail configuration.
    Type: String
    Example: outgoingMailConfigurationId

Return Value

  • Type: Mail:OutgoingMailConfiguration

Examples

Mail:GetOutgoingMailConfiguration($outgoingMailConfigurationId)

Mail:UpdateIncomingMailConfiguration

Updates an Incoming Mail Configuration.

Signature


Mail:UpdateIncomingMailConfiguration($incomingMailConfiguration) : Nothing

Parameters

  • $incomingMailConfiguration (mandatory)
    Instance of a Mail:IncomingMailConfiguration.
    Type: Mail:IncomingMailConfiguration
    Example: $incomingMailConfiguration

Return Value

  • Type: Nothing

Examples

Mail:UpdateIncomingMailConfiguration($incomingMailConfiguration)

Mail:UpdateOutgoingMailConfiguration

Updates an Outgoing Mail Configuration.

Signature


Mail:UpdateOutgoingMailConfiguration($outgoingMailConfiguration) : Nothing

Parameters

  • $outgoingMailConfiguration (mandatory)
    Instance of a Mail:OutgoingMailConfiguration.
    Type: Mail:OutgoingMailConfiguration
    Example: $outgoingMailConfiguration

Return Value

  • Type: Nothing

Examples

Mail:UpdateOutgoingMailConfiguration($outgoingMailConfiguration)

MakeUppercaseTexts

Convert all texts in the given Data Entity to uppercase. Possible Data Placeholders are ignored and do not trigger an exception.

Signature


MakeUppercaseTexts($entity) : Nothing

Parameters

  • $entity (mandatory)
    The entity whose texts must be converted.
    Type: Any
    Example: $person

Return Value

  • Convert all texts in the given Data Entity to uppercase. Possible Data Placeholders are ignored and do not trigger an exception.
    Type: Nothing

Examples

MakeUppercaseTexts($person)

MAP

Apply a transformation expression to every item in an indexed collection, and return a new list containing the newly created items.

Signature


MAP($collection , $transformation , $variable , $type) : Any:indexed

Parameters

  • $collection (mandatory)
    Indexed collection to be transformed.
    Type: Any:indexed
    Example: $persons
  • $transformation (mandatory)
    Transformation expression.
    Type: Any
    Example: $person.FullName()
  • $variable (optional)
    Transformation variable, default is $item.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $person
  • $type (optional)
    Data Type of the elements in the transformed collection, default is 'Any'.
    Type: String
    Example: 'String'

Return Value

  • Transformed indexed collection.
    Type: Any:indexed

Examples

MAP($persons, $person.FullName(), $person, 'String')

MAP(['peter','john','sam'], LENGTH($item), $item, 'Integer') = [5, 4, 3]

Markdown

Render text written using the Markdown language to HTML.

Signature


Markdown($string) : String

Parameters

  • $string (mandatory)
    A string written in Markdown.
    Type: String
    Example: 'I **love** Markdown!'

Return Value

  • Rendered HTML for given Markdown text.
    Type: String

Examples


Markdown('This is *important*!')='This is important!'

MarkNotificationRead

Mark the notification with the given Id read for the given user.

Signature


MarkNotificationRead($userId , $notificationId , $inbox) : Nothing

Parameters

  • $userId (mandatory)
    The Id of the user who has read the notification.
    Type: String
    Example: USERID()
  • $notificationId (mandatory)
    The message Id of the notification that was read.
    Type: String
    Example: 'some/notification/message/id'
  • $inbox (optional)
    The type of notification inbox to remove the given notification from. If this is not supplied or null, the default inbox is used. Other inboxes are defined by the function configured in nm.usermessaging.notification.inbox.function
    Type: String
    Example: alerts

Return Value

  • Mark the notification with the given Id read for the given user.
    Type: Nothing

Examples

MarkNotificationRead(USERID(), 'some/notification/message/id')

MATCH

Check if a text matches a pattern.

Signature


MATCH($text , $pattern) : Boolean

Parameters

  • $text (mandatory)
    The text we want match with the pattern.
    Type: String
    Example: 'aabbaabb'
  • $pattern (mandatory)
    The pattern we want to check.
    Type: String
    Example: 'ab'

Return Value

  • Check if the given text matches the given pattern.
    Type: Boolean

Examples


MATCH('aabbaabb','ab')=true


MATCH('000-1234','[0-9]{3}-[0-9]{4}')=true


MATCH('abc-1234','[0-9]{3}-[0-9]{4}')=false


MATCH('1234-1234','[0-9]{3}-[0-9]{4}')=true

MATCHCOUNT

Count the number of times a text matches a pattern.

Signature


MATCHCOUNT($text , $pattern) : Integer

Parameters

  • $text (mandatory)
    The text in which we want to find the pattern.
    Type: String
    Example: 'aabbaabb'
  • $pattern (mandatory)
    The pattern we want to count.
    Type: String
    Example: 'ab'

Return Value

  • Count the number of matches of the second argument in the first argument.
    Type: Integer

Examples


MATCHCOUNT('aabbaabb','ab')=2


MATCHCOUNT('John,James,Jim,Jack','Ja') = 2


MATCHCOUNT('The 23. chapter','[0-9]') = 2

MatchingStrings

An Indexed List of all Strings matching a given Regular Expression.

Signature


MatchingStrings($text , $regex) : String:indexed

Parameters

  • $text (mandatory)
    The text you want to search for the regex.
    Type: String
    Example: 'I just ate a donut, it was good!''
  • $regex (mandatory)
    The regular expression used to search through the string (multiline).
    Type: String
    Example: \W[a-z]{3}\W

Return Value

  • An Indexed List of all Strings matching a given Regular Expression.
    Type: String:indexed

Examples


MatchingStrings('I just ate a donut, it was good!','\W[a-z]{3}\W') = [' ate ',' was ']

MAX

Find the highest number in a given list of numbers.

Signature


MAX($number , $number) : Number

Parameters

  • $number (mandatory)
    A number.
    Type: Number
    Example: 3.9
  • $number (optional)
    A number.
    Type: Number
    Example: 3.9

Return Value

  • Find the maximum of the given number list.
    Type: Number

Examples


MAX(1,2,3)=3


MAX(-1,1)=1


MAX(1.1,1)=1.1

MEDIUM

Return the medium date format of the given date and locale.

Signature


MEDIUM($date , $locale , $timeZone) : String

Parameters

  • $date (mandatory)
    The date that must be formated.
    Type: Date
    Example: TODAY()
  • $locale (optional)
    The language code.
    Type: String
    Example: 'de'
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: 'US/Eastern', 'Europe/Zurich', 'GMT'

Return Value

  • Returns the medium date format of the given date and locale.
    Type: String

Examples


MEDIUM(TODAY(),'de') = '01.04.2005'

MemoryUsage:GetThreadAllocatedBytes

Returns the total memory that was allocated by the current thread. Note 1: Since many threads are re-used, this function should be mainly used to
only compute the memory allocation difference between two steps.E. g. Long $allocatedBytes1 := MemoryUsage:GetThreadAllocatedBytes();
// do some task
Long $allocatedBytes2 := MemoryUsage:GetThreadAllocatedBytes();
Long $allocatedMemoryMB := -1;
If $allocatedBytes1 > -1 && $allocatedBytes1 > -1 Then
$allocatedMemoryMB := ($allocatedBytes2 - $allocatedBytes1) / 1024. 0 / 1024. 0;
End
Return $allocatedMemoryMB;Note 2: Measuring the memory allocation has a certain overhead, so use this
functionality only for large blocks (that allocate more than a couple of MB).

Signature


MemoryUsage:GetThreadAllocatedBytes() : Long

Parameters
None
Return Value

  • Returns the total memory in bytes that was allocated by the current thread or -1 if the memory allocation cannot be computed.
    Type: Long

Examples

MemoryUsage:GetThreadAllocatedBytes()

MemoryUsageStatistics

Prints details about memory usage.

Signature


MemoryUsageStatistics() : String

Parameters
None
Return Value

  • Statistics about known memory holders.
    Type: String

Examples

MemoryUsageStatistics()

MergePDFFiles (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. Use Pdf:Join instead.

Signature


MergePDFFiles($inputFiles , $outputFile , $optimized) : Nothing

Parameters

  • $inputFiles (mandatory)
    Indexed collection with the file paths of the PDF files to merge.
    Type: String:indexed
    Example: ['work/tmp/file1.pdf','work/tmp/file2.pdf']:String
  • $outputFile (mandatory)
    Output file path.
    Type: String
    Example: 'work/tmp/out.pdf'
  • $optimized (optional)
    If this parameter is set to true, the merge operation checks whether there are common resources (like images or fonts) in the PDF files to merge, and includes them only once in the output PDF file (which is then smaller). Default: true.
    Type: Boolean
    Example: false

Return Value

  • Type: Nothing

Examples

MergePDFFiles($inputFiles, $outputFile)

MergeValueStore (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use ValueStore:Merge instead.

Signature


MergeValueStore($processInstanceId) : Any

Parameters

  • $processInstanceId (mandatory)
    The process instance id of the value store that must be merged.
    Type: String
    Example: $processInstanceId

Return Value

  • Returns true if the value store has been merged successfully. It will always merge the detached entities regardless if value store splitting is enabled or not.
    Type: Any

Examples

MergeValueStore($processInstanceId)

METHODCALL

Build a function pointer and associate it with the given arguments.

Signature


METHODCALL($pointer , $methodName , $expression) : java.lang.Object

Parameters

  • $pointer (mandatory)
    The object whose method must be called.
    Type: com.nm.sdk.data.expeval.Pointer
    Example: pointer
  • $methodName (mandatory)
    The name of the method that must be called.
    Type: String
    Example: methoName
  • $expression (optional)
    The expression for the argument.
    Type: com.nm.sdk.data.expeval.Pointer
    Example: 1+1

Return Value

  • Build a function pointer and associate it with the given arguments.
    Type: java.lang.Object

Examples


METHODCALL(pointer,methodName,arg1,arg2,...,argN)

Migration:AlignTimestampFilters

Align Timestamp Version Filters of local Process Instances with commit timestamps.

Signature


Migration:AlignTimestampFilters($simulate) : String

Parameters

  • $simulate (optional)
    Enable or disable simulation mode. By default, simulation mode is enabled.
    Type: Boolean
    Example: true

Return Value

  • Report in text format.
    Type: String

Examples

Migration:AlignTimestampFilters(false)

Migration:ExecNullSafe

Returns null if 1st argument is null, otherwise returns the result of executing the 2nd argument.

Signature


Migration:ExecNullSafe($mightBeNull , $lambda) : Any

Parameters

  • $mightBeNull (mandatory)
    The first argument is null-checked.
    Type: Any
    Example: $map
  • $lambda (mandatory)
    The second argument is a lambda function that is executed if the first argument is not null.
    Type: Any
    Example: Collection:ListValues($map)

Return Value

  • Returns null if 1st argument is null, otherwise returns the result of executing the 2nd argument.
    Type: Any

Examples

Migration:ExecNullSafe($map, Collection:ListValues($map))

Migration:MigrateFunctions

Performs migration and returns an indexed collection of Business Object IDs where at least one function has been migrated.

Signature


Migration:MigrateFunctions($packageId) : String:indexed

Parameters

  • $packageId (mandatory)
    Package ID.
    Type: String
    Example: 'Base'

Return Value

  • Performs migration and returns an indexed collection of Business Object IDs where at least one function has been migrated.
    Type: String:indexed

Examples

Migration:MigrateFunctions('SomePackage')

MIN

Find the smallest number in a given list of numbers.

Signature


MIN($number , $number) : Number

Parameters

  • $number (mandatory)
    A number.
    Type: Number
    Example: 3.9
  • $number (optional)
    A number.
    Type: Number
    Example: 3.9

Return Value

  • Find the minimum of the given number list.
    Type: Number

Examples


MIN(1,2,3)=1


MIN(-1,1)=-1


MIN(1,1.1)=1

MOD

Calculate the Integer rest of the Integer division.

Signature


MOD($dividend , $divisor) : Number

Parameters

  • $dividend (mandatory)
    The number that will be divided.
    Type: Number
    Example: 13
  • $divisor (mandatory)
    The number that divides the dividend.
    Type: Integer
    Example: 2

Return Value

  • The integer rest of the integer division.
    Type: Number

Examples


MOD(13,2)=1


MOD(8.5,4)=0

MOVEDIRECTORY

Move a directory to a new location. If the target directory already exists, this function will merge the source directory into the target directory. If the parent directory of the target directory doesn't exist, it will be created. Relative paths are interpreted relative to the Data Home.

Signature


MOVEDIRECTORY($sourcePath , $targetPath) : Boolean

Parameters

  • $sourcePath (mandatory)
    The directory to move.
    Type: String
    Example: 'uploads/2006'
  • $targetPath (mandatory)
    The target location.
    Type: String
    Example: 'uploads/archive/2006'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

MOVEDIRECTORY('uploads/2006', 'uploads/archive/2006')

MOVEFILE

Move a file to a new location. If the target file already exists, this function will overwrite it. If the target is a directory, a file with the same name like the source file will be created in it. If the directory of the target file doesn't exist, it will be created. Relative paths are interpreted relative to the Data Home.

Signature


MOVEFILE($sourcePath , $targetPath) : Boolean

Parameters

  • $sourcePath (mandatory)
    The file to move.
    Type: String
    Example: 'infos.xml'
  • $targetPath (mandatory)
    The target location.
    Type: String
    Example: 'content/infos.xml'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

MOVEFILE('infos.xml', 'content/infos.xml')

MUL

Multiply all given values.

Signature


MUL($term , $term) : Number

Parameters

  • $term (mandatory)
    The term that is to be multiplied.
    Type: Number
    Example: 2
  • $term (optional)
    The term that is to be multiplied.
    Type: Number
    Example: 3

Return Value

  • The result of the multiplication.
    Type: Number

Examples


MUL(2,3)=6


MUL(2.2,3)=6.6


MUL(2,3,4)=24

NEG

Return the argument multiplied by -1.

Signature


NEG($argument) : Number

Parameters

  • $argument (mandatory)
    The number that is tobe negated.
    Type: Number
    Example: -3.0

Return Value

  • Return the argument multiplied with -1.
    Type: Number

Examples


NEG(-3.0)=3.0


NEG(3)=-3


NEG(NEG(1))=1

NEW (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 9 OR LATER. Use NewObject instead. Create a data instance of the given type. All properties are set according to their default value.

Signature


NEW($className , $argument) : Any

Parameters

  • $className (mandatory)
    The name of the type for which the instance must be created.
    Type: String
    Example: Person
  • $argument (optional)
    An argument for the class function 'NEW'.
    Type: Any
    Example: '1'

Return Value

  • A data instance of the given class.
    Type: Any

Examples

NEW(Person)

NewIndexed

Create a new indexed data collection of the given type.

Signature


NewIndexed($elementType) : Any:indexed

Parameters

  • $elementType (mandatory)
    The type of the indexed data elements.
    Type: String
    Example: Person

Return Value

  • A new indexed data collection.
    Type: Any:indexed

Examples

NewIndexed(Person)

NEWLINE

Returns a newline character.

Signature


NEWLINE() : String

Parameters
None
Return Value

  • Returns a newline character.
    Type: String

Examples

NEWLINE()

NewNamed

Create a new named data collection of the given type.

Signature


NewNamed($elementType) : Any:mapped

Parameters

  • $elementType (mandatory)
    The type of the map elements.
    Type: String
    Example: Person

Return Value

  • A new named data collection.
    Type: Any:mapped

Examples

NewNamed(Person)

NewObject

Create a data instance of the given type. All properties are set according to their default value.

Signature


NewObject($className , $argument) : Any

Parameters

  • $className (mandatory)
    The name of the type for which the instance must be created.
    Type: String
    Example: Person
  • $argument (optional)
    An argument for the class function 'NEW'.
    Type: Any
    Example: '1'

Return Value

  • A data instance of the given class.
    Type: Any

Examples

NewObject(Person)

NextDayOfMonth

Returns next day of month as specified in $dayOfMonth (1-31).

Signature


NextDayOfMonth($date , $dayOfMonth , $mustBeAfterToday) : Date

Parameters

  • $date (mandatory)
    The date from which the next $dayOfMonth should be found.
    Type: Date
    Example: TODAY()
  • $dayOfMonth (mandatory)
    The day of week to be found (1-31).
    Type: Integer
    Example: 31
  • $mustBeAfterToday (optional)
    If true (default), a month will be added if $date is already the day of month specified in $dayOfMonth.
    Type: Boolean
    Example: true

Return Value

  • Returns next day of month as specified in $dayOfMonth (1-31).
    Type: Date

Examples

NextDayOfMonth(TODAY(), 7)

NextDayOfWeek

Returns next day of week as specified in $dayOfWeek (1=Monday, 7=Sunday).

Signature


NextDayOfWeek($date , $dayOfWeek , $mustBeAfterToday) : Date

Parameters

  • $date (mandatory)
    The date from which the next $dayOfWeek should be found.
    Type: Date
    Example: TODAY()
  • $dayOfWeek (mandatory)
    The day of week to be found (1=Monday, 7=Sunday).
    Type: Integer
    Example: 7
  • $mustBeAfterToday (optional)
    If true (default), a week will be added if $date is already the day of week specified in $dayOfWeek.
    Type: Boolean
    Example: true

Return Value

  • Returns next day of week as specified in $dayOfWeek (1=Monday, 7=Sunday).
    Type: Date

Examples

NextDayOfWeek(TODAY(), 7)

NOT

Return the boolean negation of the argument.

Signature


NOT($booleanArgument) : Boolean

Parameters

  • $booleanArgument (mandatory)
    The boolean arguments that must be negated.
    Type: Boolean
    Example: false

Return Value

  • Returns the boolean negation of the argument.
    Type: Boolean

Examples


NOT(false)=true


NOT(true)=false


NOT(NOT(a))=a

NotEmpty

True if the given argument is a non-empty String.

Signature


NotEmpty($argument) : Boolean

Parameters

  • $argument (mandatory)
    The String we want to check.
    Type: String
    Example: NotEmpty('') = false

Return Value

  • True if the given argument is a non-empty String.
    Type: Boolean

Examples


NotEmpty('') = false


NotEmpty(null) = false


NotEmpty('John') = true

NOTEQUAL

Return true if all paramters are equal.

Signature


NOTEQUAL($object , $object , $object) : Boolean

Parameters

  • $object (mandatory)
    The object that should be compared.
    Type: Any
    Example: 1
  • $object (mandatory)
    The object that should be compared.
    Type: Any
    Example: 1
  • $object (optional)
    The object that should be compared.
    Type: Any
    Example: 1

Return Value

  • True if at least one paramters is not equal to one of the others.
    Type: Boolean

Examples


NOTEQUAL(1,2)=true


NOTEQUAL(5,5,5,5,'John')=true


NOTEQUAL(4,MUL(2,2))=false


NOTEQUAL(5,MUL(2,2))=true

NOW

Returns the current date, including the current time.

Signature


NOW() : Date

Parameters
None
Return Value

  • Returns the current date, including the current time.
    Type: Date

Examples

NOW()

NUMBERFORMAT

Format the given number according to the pattern given in the second argument.

Signature


NUMBERFORMAT($number , $pattern , $locale) : String

Parameters

  • $number (mandatory)
    The number to be formated.
    Type: Double
    Example: 1234.5678
  • $pattern (mandatory)
    The format pattern.
    Type: String
    Example: '#,##0.00'
  • $locale (optional)
    the locale code. Default: nm.default.locale or System's default Locale
    Type: String
    Example: 'de_CH'

Return Value

  • Formats the given number according to the pattern given in the second argument.
    Type: String

Examples

NUMBERFORMAT(1234.5678, '#,##0.00', 'de_CH')

OR

Retrun true if any of the boolean expression in the argument list is true, false otherwise.

Signature


OR($booleanValue , $booleanValue) : Boolean

Parameters

  • $booleanValue (mandatory)
    A boolean value.
    Type: Boolean
    Example: 1==2
  • $booleanValue (optional)
    A boolean value.
    Type: Boolean
    Example: 2==2

Return Value

  • True if any of the boolean expression in the argument list is true, false otherwise.
    Type: Boolean

Examples


OR(true,true,true) = true


OR(true,true,false) = false


OR(1==1,2==3) = true


OR(1==1,OR(true,false)) = true

OUTGOINGDEPENDENCIES

Returns an indexed collection of dependency targets (type 'Any') on which the Object of the given type and id depends.

Signature


OUTGOINGDEPENDENCIES($type , $id) : Any:indexed

Parameters

  • $type (mandatory)
    The Business Object's type.
    Type: String
    Example: 'Screen'
  • $id (mandatory)
    The Business Object's id.
    Type: String
    Example: 'Portal'

Return Value

  • Returns an indexed collection of dependency targets (type 'Any') on which the Object of the given type and id depends.
    Type: Any:indexed

Examples

OUTGOINGDEPENDENCIES('Screen', 'Portal')

Package:CompareVersionsReport

Creates a CSV report listing the differences among all the Business Objects contained in two different versions of the same Package. Note: If there are duplicate versions of a Package (with same version number) in the Package history, the comparison considers only the most recent version. Note: By default, if a Package was deleted and then re-imported in a given environment, the comparison ignores all the Package versions before deletion. However, you can include deleted Package versions in the comparison by using the $includeDeletedPackageVersions parameter.

Signature


Package:CompareVersionsReport($packageId , $fromVersion , $toVersion , $filePath , $includeUnchangedBO , $includeDeletedPackageVersions , $noIndent) : Nothing

Parameters

  • $packageId (mandatory)
    Package ID.
    Type: String
    Example: 'MyPackage'
  • $fromVersion (mandatory)
    Version number from or versionUuid from.
    Type: String
    Example: 'head', '1.2.3-alpha', '098a0c48-5149-46b7-8fe8-f860d3c39067'
  • $toVersion (mandatory)
    Version number to or versionUuid to.
    Type: String
    Example: 'head', '4.5.6-beta', 'a734ae74-5d0b-4d62-a50e-5be1c55c9ca3'
  • $filePath (mandatory)
    CSV file path.
    Type: String
    Example: '{DATA_HOME}/work/tmp/package-versions-report.csv'
  • $includeUnchangedBO (optional)
    Include unchanged business objects. Default: false.
    Type: Boolean
    Example: false
  • $includeDeletedPackageVersions (optional)
    Search also for deleted package versions. Default: false.
    Type: Boolean
    Example: false
  • $noIndent (optional)
    Indentation mode. If true, it won't render rows containing the indented path to a change. Default: false.
    Type: Boolean
    Example: true

Return Value

  • Type: Nothing

Examples

Package:CompareVersionsReport('MyPackage', '1.2.3-dev', 'head', '{DATA_HOME}/work/tmp/package-versions-report.csv')

Package:NewReference

Creates a Business Object Reference of type Package:Reference.

Signature


Package:NewReference($id) : Package:Reference

Parameters

  • $id (mandatory)
    Package ID.
    Type: String
    Example: 'myPackage'

Return Value

  • Creates a Business Object Reference of type Package:Reference.
    Type: Package:Reference

Examples

Package:NewReference('myPackage')

PARENTDIRECTORY

Get the path to the parent directory of a directory or file. This function always returns an absolute path.

Signature


PARENTDIRECTORY($path) : String

Parameters

  • $path (mandatory)
    File or directory path.
    Type: String
    Example: 'uploads/2006'

Return Value

  • Returns the parent directory of a directory or file.
    Type: String

Examples

PARENTDIRECTORY('uploads/2006')

PARSEDATE

Parse a date according to internal date conversion scheme. Returns Nothing if the date is not recognized.

Signature


PARSEDATE($dateString , $timeZone) : Date

Parameters

  • $dateString (mandatory)
    A date.
    Type: String
    Example: '2006-12-24'
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: 'US/Eastern', 'Europe/Zurich', 'GMT'

Return Value

  • A date according to the internal date conversion scheme, or Nothing if it is not recognized.
    Type: Date

Examples

PARSEDATE('2006-12-24')

ParseJSON

Parse a text with JSON code and return a data structure with nested Named and Indexed collections.

Signature


ParseJSON($json) : Any

Parameters

  • $json (mandatory)
    JSON code.
    Type: String
    Example: '{"name": "Test", "valid" : true}'

Return Value

  • A data structure of Named and Indexed Collections.
    Type: Any

Examples

ParseJSON($json)

ParseXmlDocument

Parse the given xml string and return a XmlDocument.

Signature


ParseXmlDocument($xmlText , $namespaceAware) : XmlDocument

Parameters

  • $xmlText (mandatory)
    The xml text.
    Type: String
    Example: <?xml version="1.0" ....
  • $namespaceAware (optional)
    True if parsing must be namespace aware, default is false (non namespace aware).
    Type: Boolean
    Example: true

Return Value

  • Parse the given xml string and return a XmlDocument.
    Type: XmlDocument

Examples

ParseXmlDocument($xmlText)

PAUSE

Wait for a given time until execution continues.

Signature


PAUSE($time) : Boolean

Parameters

  • $time (mandatory)
    Time to wait in milliseconds.
    Type: Long
    Example: 2000

Return Value

  • False if the thread has been interrupted during sleep, true otherwise.
    Type: Boolean

Examples

PAUSE(2000)

Pdf:CountPages

The number of pages of a PDF file.

Signature


Pdf:CountPages($filePath) : Integer:none

Parameters

  • $filePath (mandatory)
    Path to the PDF file.
    Type: String
    Example: 'work/tmp/fax.pdf'

Return Value

  • The number of pages of a PDF file.
    Type: Integer:none

Examples

Pdf:CountPages('work/tmp/fax.pdf')

Pdf:Decrypt

Given a PDF file encrypted with Document Open Password (User Password) or Permissions Password (Owner Password), generates an unencrypted PDF file with the same content as the input file. If the input file is not encrypted, or if the password does not match the encryption passwords, an exception is thrown.

Signature


Pdf:Decrypt($inputFilePath , $outputFilePath , $password) : Nothing

Parameters

  • $inputFilePath (mandatory)
    Input PDF file path. The file must be encrypted with Document Open Password (User Password) and/or with Permissions Password (Owner Password).
    Type: String
    Example: 'work/tmp/input.pdf'
  • $outputFilePath (mandatory)
    Output PDF file path, where the resulting unencrypted file will be saved.
    Type: String
    Example: 'work/tmp/output.pdf'
  • $password (mandatory)
    Password used to decrypt the input PDF file. If the document is encrypted both with Permission and Document Open Passwords, the password must match either of the two.
    Type: String
    Example: 'the password'

Return Value

  • Type: Nothing

Examples


Pdf:Decrypt('work/tmp/input.pdf', 'work/tmp/output.pdf', 'the password').

Pdf:HasDocumentOpenPassword

Given a PDF file, returns true if the file is encrypted with a Document Open Password (User Password).

Signature


Pdf:HasDocumentOpenPassword($filePath) : Boolean:none

Parameters

  • $filePath (mandatory)
    Input PDF file path.
    Type: String
    Example: 'work/tmp/input.pdf'

Return Value

  • Returns true if the PDF is encrypted with Document Open Password (User Password), returns false otherwise.
    Type: Boolean:none

Examples


Pdf:HasDocumentOpenPassword('work/tmp/input.pdf').

Pdf:HasPermissionsPassword

Given a PDF file, returns true if the file is encrypted with a Permissions Password (Owner Password).

Signature


Pdf:HasPermissionsPassword($filePath) : Boolean:none

Parameters

  • $filePath (mandatory)
    Input PDF file path.
    Type: String
    Example: 'work/tmp/input.pdf'

Return Value

  • Returns true if the PDF is encrypted with a Permissions Password (Owner Password), returns false otherwise. If the file is encrypted with a Document Open Password (User Password), the function will raise an error because it cannot perform the check.
    Type: Boolean:none

Examples


Pdf:HasPermissionsPassword('work/tmp/input.pdf').

Pdf:IsEncrypted

True, if the PDF is encrypted, false otherwise. A PDF is considered encrypted if it has set an owner password, a user password or both.

Signature


Pdf:IsEncrypted($pdfFilePath) : Boolean:none

Parameters

  • $pdfFilePath (mandatory)
    Path to the PDF file. A relative path is interpreted relative to the Data Home folder.
    Type: String
    Example: 'work/tmp/fax.pdf'

Return Value

  • True, if the PDF is encrypted, false otherwise. A PDF is considered encrypted if it has set an owner password, a user password or both.
    Type: Boolean:none

Examples

Pdf:IsEncrypted('work/tmp/fax.pdf')

Pdf:Join

Given multiple PDF files, it returns a single PDF file containing all the input files in order. PDF files encrypted with Document Open Password are not supported and cannot be joined. If the input PDF files contain AcroFields with the same ID, the clashing IDs will be replaced.

Signature


Pdf:Join($inputFilesPaths , $outputFilePath) : Nothing

Parameters

  • $inputFilesPaths (mandatory)
    Indexed collection with the paths to the PDF files to join.
    Type: String:indexed
    Example: ['work/tmp/file1.pdf','work/tmp/file2.pdf']:String
  • $outputFilePath (mandatory)
    Path to the file that will be generated by joining all the input files. Must not be included in the list of input files.
    Type: String
    Example: 'work/tmp/output.pdf'

Return Value

  • Type: Nothing

Examples

Pdf:Join($inputFilesPaths, $outputFilePath)

Pdf:Merge (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use Pdf:Join instead.

Signature


Pdf:Merge($inputFiles , $outputFile , $optimized) : Nothing

Parameters

  • $inputFiles (mandatory)
    Indexed collection with the file paths of the PDF files to merge.
    Type: String:indexed
    Example: ['work/tmp/file1.pdf','work/tmp/file2.pdf']:String
  • $outputFile (mandatory)
    Output file path.
    Type: String
    Example: 'work/tmp/out.pdf'
  • $optimized (optional)
    If this parameter is set to true, the merge operation checks whether there are common resources (like images or fonts) in the PDF files to merge, and includes them only once in the output PDF file (which is then smaller). Default: true.
    Type: Boolean
    Example: false

Return Value

  • Type: Nothing

Examples

Pdf:Merge($inputFiles, $outputFile)

Pdf:RemovePages

Given an input PDF file, it generates an output PDF file by removing selected pages. Note: Bookmarks are not retained in the resulting PDF file.

Signature


Pdf:RemovePages($inputFilePath , $outputFilePath , $pagesToRemove) : Nothing

Parameters

  • $inputFilePath (mandatory)
    Input PDF file path.
    Type: String
    Example: 'work/tmp/input.pdf'
  • $outputFilePath (mandatory)
    Output PDF file path (can be the same as the input file).
    Type: String
    Example: 'work/tmp/removed.pdf'
  • $pagesToRemove (mandatory)
    Indexed collection containing the numbers of the pages to be removed. Pages are numbered starting with 1. If the list of page numbers contains duplicates or is unordered, the function behaves as if the list was sorted and without duplicates.
    Type: Integer:indexed
    Example: [4, 6]:Integer

Return Value

  • Type: Nothing

Examples


Pdf:RemovePages('work/tmp/myFile.pdf', 'work/tmp/removed.pdf', [1, 3, 6]:Integer) removes the PDF pages 1, 3 and 6.

Pdf:ResetPermissions

Given a PDF file encrypted with Permissions Password (Owner Password), generates a PDF file without any permission set. If the input file is not encrypted with a Permissions Password (Owner Password), the generated PDF will be a copy of the input PDF.

Signature


Pdf:ResetPermissions($inputFilePath , $outputFilePath) : Nothing

Parameters

  • $inputFilePath (mandatory)
    Input PDF file path. The file must not be encrypted with a Document Open Password (User Password).
    Type: String
    Example: 'work/tmp/input.pdf'
  • $outputFilePath (mandatory)
    Output PDF file path.
    Type: String
    Example: 'work/tmp/output.pdf'

Return Value

  • Type: Nothing

Examples


Pdf:ResetPermissions('work/tmp/input.pdf', 'work/tmp/output.pdf').

Pdf:RotatePages

Given a PDF file, generates a PDF file with selected pages rotated by a chosen rotation angle.

Signature


Pdf:RotatePages($inputFilePath , $outputFilePath , $rotationAngle , $pagesToRotate) : Nothing

Parameters

  • $inputFilePath (mandatory)
    Input PDF file path.
    Type: String
    Example: 'work/tmp/input.pdf'
  • $outputFilePath (mandatory)
    Output PDF file path.
    Type: String
    Example: 'work/tmp/output.pdf'
  • $rotationAngle (mandatory)
    Rotation (in degrees) to be applied to the pages to rotate. Must be a multiple of 90. Can be negative, for anti-clockwise rotation.
    Type: Integer
    Example: 90
  • $pagesToRotate (optional)
    Indexed collection containing the numbers of the pages to rotate. Page numbers start with 1. If not provided, or null, all pages will be rotated.
    Type: Integer:indexed
    Example: [2,3]:Integer

Return Value

  • Type: Nothing

Examples

Pdf:RotatePages('work/tmp/input.pdf', 'work/tmp/output.pdf', 180, [1, 3, 5]:Integer);
Pdf:RotatePages('work/tmp/myFile.pdf', 'work/tmp/myFile.pdf', -90);

Pdf:Split

Splits a PDF file into multiple PDF files, based on chosen split points. Note: internal PDF links and bookmarks are not retained in the split PDF files.

Signature


Pdf:Split($inputFilePath , $outputFolderPath , $splitPoints) : String:indexed

Parameters

  • $inputFilePath (mandatory)
    Input PDF file path.
    Type: String
    Example: 'work/tmp/input.pdf'
  • $outputFolderPath (mandatory)
    Folder where all split PDF files are stored. If the folder does not exist, it is created.
    Type: String
    Example: 'work/tmp/split'
  • $splitPoints (optional)
    Indexed collection containing the numbers of pages representing the split points. Pages are numbered starting with 1. The page indicated as a split point will be included on the left part of the split (e.g. , a split on page 1 will create a single-page PDF file with page 1, and another PDF file containing all the other pages). If not specified, or null, the function will split each page of the PDF file.
    Type: Integer:indexed
    Example: [4, 6]:Integer

Return Value

  • List of filenames, created in the output folder, that contain the generated PDF files in the output folder.
    Type: String:indexed

Examples


Pdf:Split('work/tmp/myFile.pdf', 'work/tmp/outputFolder', [1,3,6]:Integer) generates four PDF files 'work/tmp/outputFolder/myFile_1.pdf' (containing page 1), 'work/tmp/outputFolder/myFile_2.pdf' (containing pages 2 and 3), 'work/tmp/outputFolder/myFile_3.pdf' (containing pages 4 to 6), 'work/tmp/outputFolder/myFile_4.pdf' (containing all the other pages).

PdfNumberOfPages (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. Use Pdf:CountPages instead.

Signature


PdfNumberOfPages($filePath) : Integer:none

Parameters

  • $filePath (mandatory)
    Path to the PDF file.
    Type: String
    Example: 'work/tmp/fax.pdf'

Return Value

  • The number of pages of a PDF file.
    Type: Integer:none

Examples

PdfNumberOfPages('work/tmp/fax.pdf')

PdfOutputTable

Read an XML code fragment for a PDF Output Table.

Signature


PdfOutputTable($id) : String

Parameters

  • $id (mandatory)
    Id of the PDF Output Table.
    Type: String
    Example: 'FormA'

Return Value

  • The XML code fragment for a PDF Output Table.
    Type: String

Examples


PdfOutputTable('FormA') = '...'

PdfToImage

Generates an image (PNG) for every page of the given PDF file.

Signature


PdfToImage($pdfFilePath , $scale) : String:indexed

Parameters

  • $pdfFilePath (mandatory)
    Path to PDF file.
    Type: String
    Example: 'work/tmp/fax.pdf'
  • $scale (optional)
    Scale factor (1. 0 = 100%, maximum 4.0).
    Type: Double
    Example: 0.5

Return Value

  • Indexed collection of paths to generated image files (one per page).
    Type: String:indexed

Examples

PdfToImage('work/tmp/fax.pdf', 0.5)

PI

PI.

Signature


PI() : Double

Parameters
None
Return Value

  • PI.
    Type: Double

Examples

PI()

POW

Return the value of the first argument raised to the power of the second argument.

Signature


POW($base , $exponent) : Number

Parameters

  • $base (mandatory)
    The base.
    Type: Number
    Example: 10
  • $exponent (mandatory)
    The exponent.
    Type: Number
    Example: 2

Return Value

  • Returns the value of the first argument raised to the power of the second argument.
    Type: Number

Examples


POW(10,2) = 100

PrettyPrint

Pretty print version of the given expression.

Signature


PrettyPrint($expression , $showLineNumbers , $produceHtml , $wrapWithTable) : String

Parameters

  • $expression (mandatory)
    The expression to pretty print.
    Type: String
    Example: '$a:=1''
  • $showLineNumbers (mandatory)
    Put line numbers in front of each row.
    Type: Boolean
    Example: true
  • $produceHtml (mandatory)
    Produce html (true) or plaintext (false).
    Type: Boolean
    Example: true
  • $wrapWithTable (optional)
    If html is true indicate if the output should be wrapped with a table.
    Type: Boolean
    Example: false

Return Value

  • Pretty print version of the given expression.
    Type: String

Examples

PrettyPrint('$a:=12', $showLineNumbers, $produceHtml)

PRINT

Joins all arguments into one string and outputs the string to the current context writer.

Signature


PRINT($argument) : String

Parameters

  • $argument (optional)
    Argument.
    Type: Any
    Example: 'hello'

Return Value

  • Joins all arguments into one string and outputs the string to the current context writer.
    Type: String

Examples

PRINT('hello', 'world')

PRINTLN

Joins all arguments into one string and outputs the string to the current context writer.

Signature


PRINTLN($argument) : String

Parameters

  • $argument (optional)
    Argument.
    Type: Any
    Example: 'hello'

Return Value

  • Joins all arguments into one string and outputs the string to the current context writer.
    Type: String

Examples

PRINTLN('hello', 'world')

PrintXmlDocument

The formatted xml text of the given node.

Signature


PrintXmlDocument($xmlDocument , $compact) : String

Parameters

  • $xmlDocument (mandatory)
    The xml document.
    Type: XmlNode
    Example: $xmlDocument
  • $compact (mandatory)
    Indicate if a compact (true) string or a verbosely (false) formated string should be returned.
    Type: Boolean
    Example: false

Return Value

  • The formatted xml text of the given node.
    Type: String

Examples

PrintXmlDocument($xmlDocument)

Process:CreateMessageQueue

Create a Process Message Queue with the given characteristics.

Signature


Process:CreateMessageQueue($name , $persistent , $temporary , $description , $maxSize) : Nothing

Parameters

  • $name (mandatory)
    Name of the Process Message Queue to create.
    Type: String
    Example: 'queueName'
  • $persistent (mandatory)
    Whether the queue should be persistent.
    Type: Boolean
    Example: true
  • $temporary (mandatory)
    Whether the queue should be temporary.
    Type: Boolean
    Example: false
  • $description (optional)
    Queue's description. Default: empty description.
    Type: String
    Example: 'Queue for push notifications.'
  • $maxSize (optional)
    Queue's max size. Pass -1 to have unlimited size. Default: -1.
    Type: Integer
    Example: 100

Return Value

  • Type: Nothing

Examples

Process:CreateMessageQueue($name, $persistent, $temporary, $description, $maxSize)

Process:DeleteMessageQueue

Delete the Process Message Queue with the given name.

Signature


Process:DeleteMessageQueue($name) : Nothing

Parameters

  • $name (mandatory)
    Name of the Process Message Queue to delete.
    Type: String
    Example: 'queueName'

Return Value

  • Type: Nothing

Examples

Process:DeleteMessageQueue($name)

Process:DeleteProcessMessage

Delete the Process Message with the given ID.

Signature


Process:DeleteProcessMessage($processMessageId) : WorkflowMessage

Parameters

  • $processMessageId (mandatory)
    ID of the Process Message to delete.
    Type: String
    Example: 'n41668705997'

Return Value

  • The deleted Process Message.
    Type: WorkflowMessage

Examples

Process:DeleteProcessMessage($processMessageId)

Process:ExecuteAdHocAction

Executes the Ad-Hoc Sub-Process Action with the provided action Id. Allowed actions depend on the task where the current token is placed. Allowed actions are actions defined on an Ad-Hoc Sub-Process containing the current task, and actions that move the token to the next or previous element in the Ad-Hoc Navigation Structure. This function must be called from within a Script Action in a Screen, and will fail otherwise.

Signature


Process:ExecuteAdHocAction($tokenId , $actionId) : Nothing

Parameters

  • $tokenId (mandatory)
    WorkflowToken id.
    Type: String
  • $actionId (mandatory)
    Ad-Hoc Sub-Process Action Id.
    Type: String

Return Value

  • Type: Nothing

Examples

Process:ExecuteAdHocAction(WORKITEM().getId(), 'PFRPS0VOPmIzMmEzN2Q5YzUxNDI1OTU5NzJkYjVhYTNjNDUxNzBlPC8-PEVMRU0-NTY')

Process:ExportMessageQueues

Exports process message queues to this environment. The resulting export file is in the zip format. This function call will not export the Default process message queue.

Signature


Process:ExportMessageQueues($path) : String

Parameters

  • $path (mandatory)
    The path to the generated export file. Relative paths are interpreted relative to the data home, use '{DATA_HOME}' to refer to the Appway data home location.
    Type: String
    Example: /tmp/messageQueuesExport.zip

Return Value

  • The result of the export.
    Type: String

Examples


Export Successful

Process:FindWorkitems

Returns a WorkitemFinderResult for the given filter, search, sort and paging criteria. It contains: the number of items, the number of pages and the list of workitems matching the given criteria.

Signature


Process:FindWorkitems($filterStructure , $searchCriteria , $sortCriteria , $pageCriteria) : WorkitemFinderResult

Parameters

  • $filterStructure (mandatory)
    The filter structure to use for filtering. Note that this parameter cannot be null (a null value throws a runtime exception).
    Type: WorkitemBaseFilter
    Example: $filter
  • $searchCriteria (optional)
    The search criteria. It can be null.
    Type: WorkitemFinderSearchCriteria
    Example: $searchCriteria
  • $sortCriteria (optional)
    The sort criteria. If null, by default sorts by workitem creation time (descending).
    Type: WorkitemFinderSortCriteria
    Example: $sortCriteria
  • $pageCriteria (optional)
    The page criteria. If null, uses page size 10 and page number 1.
    Type: WorkitemFinderPageCriteria
    Example: $pageCriteria

Return Value

  • WorkitemFinderResult including a collection of workitems resulting by applying the provided filter/search/sort/paging structure as well as the overall number of items and pages available with the same structure.
    Type: WorkitemFinderResult

Examples

Process:FindWorkitems()

Process:GetAdHocNavigationStructure

Retrieves information about the structure of an Ad-Hoc Sub-Process navigation, given a token id placed on a task contained in an Ad-Hoc Sub-Process.

Signature


Process:GetAdHocNavigationStructure($tokenId) : Process:AdHocNavigationStructure

Parameters

  • $tokenId (mandatory)
    WorkflowToken id.
    Type: String

Return Value

  • Type: Process:AdHocNavigationStructure

Examples

Process:GetAdHocNavigationStructure(WORKITEM().getId())

Process:GetNewProcessMessages

Get all new Process Messages in a given queue. New messages are: Messages that have been added to the queue after the given time. Messages that have not expired.

Signature


Process:GetNewProcessMessages($queueName , $timestamp , $processInstanceId) : WorkflowMessage:indexed

Parameters

  • $queueName (mandatory)
    Name of the queue.
    Type: String
    Example: 'PushNotifications'
  • $timestamp (mandatory)
    Only messages that have been added to the queue strictly after ('>') than the given time are returned.
    Type: Long
    Example: 1668702997
  • $processInstanceId (optional)
    Only messages that are directed to this process instance (recipient) are returned. This is an optional parameter or it can be set to null to not use this filter.
    Type: String
    Example: 'a6e5d556b3e887a8779c093455ef74c6'

Return Value

  • All new Process Messages in the given queue.
    Type: WorkflowMessage:indexed

Examples

Process:GetNewProcessMessages($queueName, $timestamp, $processInstanceId)

Process:GetReadOnlyInstance

Returns the Process Instance for the given ID.

Signature


Process:GetReadOnlyInstance($processInstanceId) : WorkflowInstance

Parameters

  • $processInstanceId (mandatory)
    The ID of the Process Instance to return.
    Type: String
    Example: n1234567

Return Value

  • Returns the Process Instance for the given ID.
    Type: WorkflowInstance

Examples


Process:GetReadOnlyInstance(String processInstanceId)

Process:GoToAdHocNavigationItem

Moves the process token to the Ad-Hoc Sub-Process Item with the specified id. The item Id must identify another task, or a task iteration, within the same Ad-Hoc Sub-Process the current task is in. This function must be called from within a Script Action in a Screen, and will fail otherwise.

Signature


Process:GoToAdHocNavigationItem($tokenId , $itemId) : Nothing

Parameters

  • $tokenId (mandatory)
    WorkflowToken id.
    Type: String
  • $itemId (mandatory)
    Ad-Hoc Sub-Process Navigation Item Id.
    Type: String

Return Value

  • Type: Nothing

Examples

Process:GoToAdHocNavigationItem(WORKITEM().getId(), 'YjU5YWZlOGE1ODk4MmM1NDAyMTg0NzIyYmRiOGZiYTMtLV9hZEhvY0JhY2s')

Process:ImportMessageQueues

Import a process message queue export file of another Appway environment to this environment, overwriting existing ones and creating the ones that are non-existent.
Note: This function will only import files generated by the ExportProcessMessageQueues function

Signature


Process:ImportMessageQueues($path) : String

Parameters

  • $path (mandatory)
    The path to the import file. Relative paths are interpreted relative to the data home, use '{DATA_HOME}' to refer to the Appway data home location.
    Type: String
    Example: /tmp/messageQueuesExport.zip

Return Value

  • The result of the import.
    Type: String

Examples


Import Successful

Process:IsEmptyLogicalWorkitemFilter

Returns true if the given logical filter (WorkitemAndFilter, WorkitemOrFilter or WorkitemNotFilter) has no filters added to execute the boolean logic.

Signature


Process:IsEmptyLogicalWorkitemFilter($filter) : Boolean

Parameters

  • $filter (mandatory)
    The filter structure to be checked for emptiness. Note that this parameter cannot be null (a null value throws a runtime exception) and must be an instance of WorkitemAndFilter, WorkitemOrFilter, or WorkitemNotFiler (otherwise throws a runtime exception).
    Type: WorkitemBaseFilter
    Example: $filter

Return Value

  • Boolean telling if the filter has no added filters.
    Type: Boolean

Examples

Process:IsEmptyLogicalWorkitemFilter($filter)

Process:NewReference

Creates a Business Object Reference of type Process:Reference.

Signature


Process:NewReference($id) : Process:Reference

Parameters

  • $id (mandatory)
    Process ID.
    Type: String
    Example: 'myProcess'

Return Value

  • Creates a Business Object Reference of type Process:Reference.
    Type: Process:Reference

Examples

Process:NewReference('myProcess')

Process:TriggerCancel

Triggers a process cancel event.

Signature


Process:TriggerCancel() : Nothing

Parameters
None
Return Value

  • Nothing.
    Type: Nothing

Examples

Process:TriggerCancel()

Process:TriggerError

Throws a process error with the given error code.

Signature


Process:TriggerError($errorCode) : Nothing

Parameters

  • $errorCode (mandatory)
    Error code.
    Type: String
    Example: 'NoFreeRooms'

Return Value

  • Nothing.
    Type: Nothing

Examples

Process:TriggerError('NoFreeRooms')

Process:TriggerTerminate

Triggers a process terminate event.

Signature


Process:TriggerTerminate() : Nothing

Parameters
None
Return Value

  • Nothing.
    Type: Nothing

Examples

Process:TriggerTerminate()

ProcessElementId

Search in the given Process for an Element with the given name and return the Element's id. If the Process doesn't exist or the Element isn't found, -1 is returned.

Signature


ProcessElementId($processRef , $elementName , $versionFilter) : Integer

Parameters

  • $processRef (mandatory)
    Process Reference.
    Type: Process:Reference
    Example: Process:NewReference('OrderProcess')
  • $elementName (mandatory)
    Element Name.
    Type: String
    Example: 'Check Order'
  • $versionFilter (optional)
    Version Filter.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter()

Return Value

  • Element Id.
    Type: Integer

Examples


ProcessElementId(Process:NewReference('OrderProcess'), 'Check Order') = 31

ProcessErrorCode

If the given exception represents a process error, the error code is returned. If the exception is a regular Java exception, null is returned instead.

Signature


ProcessErrorCode($exception) : String

Parameters

  • $exception (mandatory)
    Exception.
    Type: Exception
    Example: $exception

Return Value

  • Process Error Code.
    Type: String

Examples

ProcessErrorCode($exception)

ProcessId

Get the current Process Id.

Signature


ProcessId() : String

Parameters
None
Return Value

  • Process Id.
    Type: String

Examples

ProcessId()

ProcessInstance

Get the current Process Instance.

Signature


ProcessInstance() : WorkflowInstance

Parameters
None
Return Value

  • Process Instance.
    Type: WorkflowInstance

Examples

ProcessInstance()

ProcessInstanceGetAttribute

Get a Process Instance Attribute.

Signature


ProcessInstanceGetAttribute($processInstanceId , $attributeName) : Any

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '1231123312331'
  • $attributeName (mandatory)
    Attribute Name.
    Type: String
    Example: 'CreationDate'

Return Value

  • Process Instance Attribute value.
    Type: Any

Examples

ProcessInstanceGetAttribute('1231123312331', 'CreationDate')

ProcessInstanceId

Get the current Process Instance Id.

Signature


ProcessInstanceId() : String

Parameters
None
Return Value

  • Process Instance Id.
    Type: String

Examples

ProcessInstanceId()

ProcessInstanceIds

Get the IDs of all process instances matching the criteria defined on the given predicate. Return the IDs of all process instances if no predicate is given.

Signature


ProcessInstanceIds($processInstancePredicate) : String:indexed

Parameters

  • $processInstancePredicate (optional)
    The predicate on which the search criteria have been defined.
    Type: ProcessInstancePredicate
    Example: See below.

Return Value

  • Get the IDs of all process instances matching the criteria defined on the given predicate. Return the IDs of all process instances if no predicate is given.
    Type: String:indexed

Examples

ProcessInstancePredicate $pip := new ProcessInstancePredicate;
$pip.addQueueName(USERID());
ProcessInstanceIds($pip);

ProcessInstanceQueueNames

Get Process Instance Queue Names.

Signature


ProcessInstanceQueueNames($processInstanceId) : String:indexed

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '1231123312331'

Return Value

  • Process Instance Queue Names.
    Type: String:indexed

Examples

ProcessInstanceQueueNames('1231123312331')

ProcessInstanceRemoveAttribute

Remove a Process Instance Attribute.

Signature


ProcessInstanceRemoveAttribute($processInstanceId , $attributeName) : Nothing

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '1231123312331'
  • $attributeName (mandatory)
    Attribute Name.
    Type: String
    Example: 'CreationDate'

Return Value

  • Type: Nothing

Examples

ProcessInstanceRemoveAttribute('1231123312331', 'CreationDate')

ProcessInstanceSetAttribute

Set a Process Instance Attribute.

Signature


ProcessInstanceSetAttribute($processInstanceId , $attributeName , $attributeValue) : Nothing

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '1231123312331'
  • $attributeName (mandatory)
    Attribute Name.
    Type: String
    Example: 'CreationDate'
  • $attributeValue (mandatory)
    Attribute Value.
    Type: Any
    Example: NOW()

Return Value

  • Type: Nothing

Examples

ProcessInstanceSetAttribute('1231123312331', 'CreationDate', NOW())

ProcessQueueCheckAccess

Check if User has access to the given Process Queue.

Signature


ProcessQueueCheckAccess($userId , $queueName) : Boolean

Parameters

  • $userId (mandatory)
    User Id.
    Type: String
    Example: USERID()
  • $queueName (mandatory)
    Process Queue name.
    Type: String
    Example: 'ROLE:BackOffice'

Return Value

  • 'true' if the User has access to the Process Queue, 'false' otherwise.
    Type: Boolean

Examples


ProcessQueueAccessCheck(USERID(), 'ROLE:BackOffice') = true

ProcessQueueNames

Get Process Queue Names the given User has access to.

Signature


ProcessQueueNames($userId) : String:indexed

Parameters

  • $userId (mandatory)
    User Id.
    Type: String
    Example: USERID()

Return Value

  • Indexed Collection of Process Queue Names.
    Type: String:indexed

Examples


ProcessQueueNames(USERID()) = ['NM','ROLE:BackOffice','GROUP:TestUsers']

ProcessStartURL

Build an URL to start a new Process Instance given the Process id. The return value starts with /process and doesn't contain the context path.

Signature


ProcessStartURL($processRef , $completeAction , $showScreen , $filter) : String

Parameters

  • $processRef (mandatory)
    Process Reference.
    Type: Process:Reference
    Example: Process:NewReference('AccountOpening')
  • $completeAction (optional)
    Complete action.
    Type: String
    Example: 'CLOSE'
  • $showScreen (optional)
    Show first screen.
    Type: Boolean
    Example: true
  • $filter (optional)
    Version filter.
    Type: String
    Example: 'LatestCommittedFilter'

Return Value

  • URL without host and context path.
    Type: String

Examples


ProcessStartURL(Process:NewReference('AccountOpening'),'CLOSE',true) = '/process/AccountOpening?completeAction=CLOSE&showScreen=true'

ProcessToken

Get a Process Token. If there is no parameter, the function returns the current Process Token. Otherwise, the function will search for the Process Token with the given id.

Signature


ProcessToken($processTokenId , $processInstanceId) : WorkflowToken

Parameters

  • $processTokenId (optional)
    Process Token Id.
    Type: String
    Example: '1236573865342'
  • $processInstanceId (optional)
    Process Instance Id.
    Type: String
    Example: '1224562156897'

Return Value

  • Process Token.
    Type: WorkflowToken

Examples

ProcessToken()

ProcessTokenGetAttribute

Get a Process Token Attribute.

Signature


ProcessTokenGetAttribute($processTokenId , $attributeName , $inherit) : Any

Parameters

  • $processTokenId (mandatory)
    Process Token Id.
    Type: String
    Example: '1231123312331'
  • $attributeName (mandatory)
    Attribute Name.
    Type: String
    Example: 'CreationDate'
  • $inherit (optional)
    Boolean.
    Type: Boolean
    Example: false

Return Value

  • Process Token Attribute value.
    Type: Any

Examples

ProcessTokenGetAttribute('1231123312331', 'CreationDate')

ProcessTokenRemoveAttribute

Remove a Process Token Attribute.

Signature


ProcessTokenRemoveAttribute($processTokenId , $attributeName , $inherit) : Nothing

Parameters

  • $processTokenId (mandatory)
    Process Token Id.
    Type: String
    Example: '1231123312331'
  • $attributeName (mandatory)
    Attribute Name.
    Type: String
    Example: 'CreationDate'
  • $inherit (optional)
    Boolean.
    Type: Boolean
    Example: false

Return Value

  • Type: Nothing

Examples

ProcessTokenRemoveAttribute('1231123312331', 'CreationDate')

ProcessTokenSetAttribute

Set a Process Token Attribute.

Signature


ProcessTokenSetAttribute($processTokenId , $attributeName , $attributeValue , $inherit) : Nothing

Parameters

  • $processTokenId (mandatory)
    Process Token Id.
    Type: String
    Example: '1231123312331'
  • $attributeName (mandatory)
    Attribute Name.
    Type: String
    Example: 'CreationDate'
  • $attributeValue (mandatory)
    Attribute Value.
    Type: Any
    Example: NOW()
  • $inherit (optional)
    Boolean.
    Type: Boolean
    Example: false

Return Value

  • Type: Nothing

Examples

ProcessTokenSetAttribute('1231123312331', 'CreationDate', NOW())

RANDOM

Return a random number between 0. 0 and 1.0.

Signature


RANDOM() : Double

Parameters
None
Return Value

  • Return a random number between 0. 0 and 1.0.
    Type: Double

Examples


RANDOM()=0.2


TOINTEGER(ROUND(RANDOM()*100))=86

RandomText

A random text of the requested length.

Signature


RandomText($length , $universe) : String

Parameters

  • $length (mandatory)
    The length of the random text.
    Type: Integer
    Example: 12
  • $universe (optional)
    The characters that should be used for the random text.
    Type: String
    Example: 'uvwABC'

Return Value

  • A random text of the requested length.
    Type: String

Examples

RandomText(12)

ReadBinaryData

The base64 encoding of the binary data from the file.

Signature


ReadBinaryData($filepath , $startIndex , $endIndex) : String

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'work/tmp/mydatafile.bin'
  • $startIndex (optional)
    The start of the binary block to be read. Default is 0.
    Type: Long
    Example: 0
  • $endIndex (optional)
    The end of the binary blck to be read. Default is size of file.
    Type: Long
    Example: 1024

Return Value

  • The base64 encoding of the binary data from the file.
    Type: String

Examples

ReadBinaryData($filepath, $startIndex, $endIndex)

READCLUSTERFILE

Read the content of the given cluster file into a string.

Signature


READCLUSTERFILE($filepath , $encoding) : String

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'foo/bar/thefile.txt'
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'

Return Value

  • Content of the given file or null if the file does not exist.
    Type: String

Examples

READCLUSTERFILE('foo/bar/thefile.txt', 'UTF-8')

ReadProcessMessageFile

Read a Process Message from an XML file.

Signature


ReadProcessMessageFile($filePath) : WorkflowMessage

Parameters

  • $filePath (mandatory)
    Path to XML file.
    Type: String
    Example: 'work/tmp/message.xml'

Return Value

  • Process Message.
    Type: WorkflowMessage

Examples

ReadProcessMessageFile('work/tmp/message.xml')

READPROPERTIESFILE

Read a Java Properties file into a named collection. If the file doesn't exist, null is returned. Relative paths are interpreted relative to the Data Home.

Signature


READPROPERTIESFILE($filepath) : String:mapped

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'content/file.properties'

Return Value

  • Returns a named collection containing Strings.
    Type: String:mapped

Examples

READPROPERTIESFILE('content/file.properties')

READTEXTFILE

Read the content of the given file into a String. Relative paths are interpreted relative to the Data Home.

Signature


READTEXTFILE($filepath , $encoding) : String

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: '{DATA_HOME}/work/tmp/thefile.txt'
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'

Return Value

  • Read text from the given file.
    Type: String

Examples

READTEXTFILE('{DATA_HOME}/work/tmp/thefile.txt', 'UTF-8')

ReadTextFileLine

Read the next text line from the given file.

Signature


ReadTextFileLine($filepath , $encoding) : String

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: '{DATA_HOME}/work/tmp/thefile.txt'
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'

Return Value

  • Read the next text line from the given file.
    Type: String

Examples

ReadTextFileLine('{DATA_HOME}/work/tmp/thefile.txt', 'UTF-8')

READTEXTRESOURCE

Read the content of the given Resource into a String. Returns null if the Resource doesn't exists.

Signature


READTEXTRESOURCE($resourceRef , $encoding , $versionFilter) : String

Parameters

  • $resourceRef (mandatory)
    The reference of the resource.
    Type: Resource:Reference
    Example: Resource:NewReference('GlobalCSS')
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'
  • $versionFilter (optional)
    The version filter to be used for retrieval.
    Type: Any
    Example: VersionFilter()

Return Value

  • Read text from the given resource.
    Type: String

Examples

READTEXTRESOURCE(Resource:NewReference('GlobalCSS'), 'UTF-8')

Record

Search the given Catalog for the given value in the column 'searchColumn' and return the record.

Signature


Record($searchValue , $catalogRef , $searchColumn , $variableAssignments) : Record

Parameters

  • $searchValue (mandatory)
    The value we are looking for in the list.
    Type: String
    Example: 'theValue'
  • $catalogRef (mandatory)
    The Reference of the Catalog in which we are searching.
    Type: Catalog:Reference
    Example: Catalog:NewReference('catalog')
  • $searchColumn (optional)
    The column in which we search the value, default is 'id'.
    Type: String
    Example: 'column'
  • $variableAssignments (optional)
    possible variable assignments
    Type: Any:mapped
    Example: {'var1'='test', 'var2'=false}:Any

Return Value

  • Search the given Catalog for the given value in the column 'searchColumn' and return the record.
    Type: Record

Examples

RECORD(searchValue, catalogRef, searchColumn)

RECORDS

Return a list of Catalog records.

Signature


RECORDS($catalogRef , $variableAssignments) : Record:indexed

Parameters

  • $catalogRef (mandatory)
    Reference to the catalog.
    Type: Catalog:Reference
    Example: Catalog:NewReference('Countries')
  • $variableAssignments (optional)
    possible variable assignments
    Type: Any:mapped
    Example: {'var1'='test', 'var2'=false}:Any

Return Value

  • Return a list of Catalog records.
    Type: Record:indexed

Examples

RECORDS(Catalog:NewReference('Countries'))

RecursiveBuild

An object where single structured types are pre constructed.

Signature


RecursiveBuild($className , $depth) : Any

Parameters

  • $className (mandatory)
    The name of the dataclass.
    Type: String
    Example: Person
  • $depth (optional)
    The recursion depth.
    Type: Integer
    Example: 3

Return Value

  • An object where single structured types are pre constructed.
    Type: Any

Examples

RecursiveBuild(ClassName)

RELATIVEPATH

Build a relative path to a file in the Data Home, given its absolute path. If the path isn't absolute or if it doesn't point to a file inside the Data Home, null is returned.

Signature


RELATIVEPATH($path) : String

Parameters

  • $path (mandatory)
    Absolute path to a file in Data Home.
    Type: String
    Example: '/usr/local/nm/data/conf/content.properties'

Return Value

  • Relative path to a file in Data Home.
    Type: String

Examples


RELATIVEPATH('/usr/local/nm/data/conf/content.properties') = 'conf/content.properties'

RemoveClientKeyAlias

Success or failure.

Signature


RemoveClientKeyAlias($hostname) : Boolean

Parameters

  • $hostname (mandatory)
    The hostname for the hostname<->alias mapping to be removed.
    Type: String
    Example: localhost

Return Value

  • Success or failure.
    Type: Boolean

Examples

RemoveClientKeyAlias('localhost')

RemoveDataContextCollectionElement

Removes the element corresponding to the given binding from a collection.

Signature


RemoveDataContextCollectionElement($tokenID , $binding) : Nothing

Parameters

  • $tokenID (mandatory)
    The ID of the token.
    Type: String
    Example: $tokenID
  • $binding (mandatory)
    The binding associated with the data entity to remove.
    Type: String
    Example: $binding

Return Value

  • Type: Nothing

Examples


RemoveDataContextCollectionElement($tokenID, '$rootObject.aNamedCollection["aKey"]'), RemoveDataContextCollectionElement($tokenID, '$rootObject.anIndexedCollection[3]')

RemoveNotifications

It allows you to remove the NotificationMessage of a Notification Object.

Signature


RemoveNotifications($messageIds , $userId) : Nothing

Parameters

  • $messageIds (mandatory)
    The IDs of the notification messages to be removed.
    Type: String:indexed
    Example: [$messageIds]:String
  • $userId (optional)
    The ID of the user from whose inbox(es) to remove the notifications.
    Type: String
    Example: USERID()

Return Value

  • Removes the NotificationMessage of a Notification Object.
    Type: Nothing

Examples

RemoveNotifications([$messageId]:String)

RemovePrivateKey

True if success, otherwise false.

Signature


RemovePrivateKey($alias) : Boolean

Parameters

  • $alias (mandatory)
    The alias/name used when storing/retrieving the key.
    Type: String
    Example: 'appway'

Return Value

  • True if success, otherwise false.
    Type: Boolean

Examples

RemovePrivateKeyFunction('appway')

RemoveSSLAlias

Signature


RemoveSSLAlias() : Nothing

Parameters
None
Return Value

  • Type: Nothing

Examples

RemoveSSLAliasFunction('crm_service')

RemoveTrustedCertificate

True if success, otherwise false.

Signature


RemoveTrustedCertificate($alias) : Boolean

Parameters

  • $alias (mandatory)
    The alias/name used when storing/retrieving the certificate.
    Type: String
    Example: 'appway'

Return Value

  • True if success, otherwise false.
    Type: Boolean

Examples

RemoveTrustedCertificateFunction('appway')

RenderRichSuggestFieldSuggestions

Render an indexed list of RichSuggestFieldSuggestion objects to an HTML String.

Signature


RenderRichSuggestFieldSuggestions($suggestions , $showGroups , $showImages , $sort) : String

Parameters

  • $suggestions (mandatory)
    Indexed list of suggestions.
    Type: RichSuggestFieldSuggestion:indexed
    Example: $suggestions
  • $showGroups (optional)
    Choose whether to show grouping information or not. Default = true.
    Type: Boolean
    Example: true
  • $showImages (optional)
    Choose whether to show images or not. Default = true.
    Type: Boolean
    Example: true
  • $sort (optional)
    Choose whether to sort the data or not. Default = true.
    Type: Boolean
    Example: true

Return Value

  • HTML Code for an indexed list of RichSuggestFieldSuggestion object.
    Type: String

Examples

RenderRichSuggestFieldSuggestions($suggestions)

REPLACE

Search a String for matches to a regular expression and replace all matches with another String.

Signature


REPLACE($string , $pattern , $replacement) : String

Parameters

  • $string (mandatory)
    The string.
    Type: String
    Example: 'hello'
  • $pattern (mandatory)
    The pattern for which to search in the string.
    Type: String
    Example: 'o'
  • $replacement (mandatory)
    The replacement for the matches.
    Type: String
    Example: 'o world'

Return Value

  • Replaces each substring of the first argument that matches the given regular expression with the given replacement.
    Type: String

Examples


REPLACE('hello','o','o world')='hello world'


REPLACE("Mr Smith","Mr","Mrs") = 'Mrs Smith'


REPLACE("A/B/C","/",",") = 'A,B,C'


REPLACE('lorem (delete me) ipsum',"\\(.*?\\) ","") = 'lorem ipsum'

ReplaceMatchingStrings

Replaces each substring of the first argument that matches the given regular expression with the given replacement, with the same Regular Expression logic as MatchingStrings (multiline).

Signature


ReplaceMatchingStrings($string , $pattern , $replacement , $variable) : String

Parameters

  • $string (mandatory)
    The string.
    Type: String
    Example: 'HELLO'
  • $pattern (mandatory)
    The pattern for which to search in the string.
    Type: String
    Example: 'o'
  • $replacement (mandatory)
    The replacement for the matches.
    Type: Any
    Example: 'LOWERCASE($match)'
  • $variable (optional)
    The variable that is used for identification of the matched String.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $match

Return Value

  • Replaces each substring of the first argument that matches the given regular expression with the given replacement, with the same Regular Expression logic as MatchingStrings (multiline).
    Type: String

Examples


ReplaceMatchingStrings('HELLO','o',LOWERCASE($match), $match)='HELLo'

ReportValidationError

Report a validation error. Use the 'Validation Summary' component to display such errors on a Screen.

Signature


ReportValidationError($message , $section) : Nothing

Parameters

  • $message (mandatory)
    Validation error message.
    Type: String
    Example: 'Uploaded file is to big'
  • $section (optional)
    Validation section name.
    Type: String
    Example: 'UploadArea'

Return Value

  • Nothing.
    Type: Nothing

Examples

ReportValidationError('Uploaded file is to big')

RESEMBLES

Evaluates to 'true' if the given element resembles the given prototype.

Signature


RESEMBLES($item , $prototype , $nullMatchesAll , $followCollections) : Boolean

Parameters

  • $item (mandatory)
    The element whose resemblance to the prototype must be checked.
    Type: Any
    Example: $item
  • $prototype (mandatory)
    The prototype to compare against.
    Type: Any
    Example: $prototype
  • $nullMatchesAll (optional)
    A null value in the prototype matches all values, default is true.
    Type: Boolean
    Example: true
  • $followCollections (optional)
    Collection values should also match, default is false.
    Type: Boolean
    Example: true

Return Value

  • Evaluates to 'true' if the given element resembles the given prototype.
    Type: Boolean

Examples


RESEMBLES($item, $prototype) = true

ResetStatistics

Reset the statistics passed as parameter. This function resets the statistics on all nodes.

Signature


ResetStatistics($statisticsType) : Nothing

Parameters

  • $statisticsType (optional)
    The statistics type to reset. If this parameter is empty all the statistics will be reset.
    Type: String
    Example: 'io'

Return Value

  • Reset the statistics passed as parameter. This function resets the statistics on all nodes.
    Type: Nothing

Examples

ResetStatistics('io')

Resource:NewReference

Creates a Business Object Reference of type Resource:Reference.

Signature


Resource:NewReference($id) : Resource:Reference

Parameters

  • $id (mandatory)
    Resource ID.
    Type: String
    Example: 'myResource'

Return Value

  • Creates a Business Object Reference of type Resource:Reference.
    Type: Resource:Reference

Examples

Resource:NewReference('myResource')

RESOURCEURL

Build an URL to access a resource given the id of the resource. The return value starts with /resource/object and doesn't contain the context path.

Signature


RESOURCEURL($resourceRef , $filter) : String

Parameters

  • $resourceRef (mandatory)
    Resource Reference.
    Type: Resource:Reference
    Example: Resource:NewReference('CancelLogo')
  • $filter (optional)
    Version filter.
    Type: String
    Example: 'LatestCommittedFilter'

Return Value

  • URL without host and context path.
    Type: String

Examples


RESOURCEURL(Resource:NewReference('CancelLogo')) = '/resource/object/CancelLogo/LatestCommittedFilter/cancelLogo.gif'

RethrowJavaException (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use Throw:RethrowException instead.

Signature


RethrowJavaException($exception) : Nothing

Parameters

  • $exception (mandatory)
    Exception.
    Type: Exception
    Example: $exception

Return Value

  • Nothing.
    Type: Nothing

Examples

Throw:RethrowException($exception)

RetrieveTrustedCertificate

The base64 encoded certificate that can be serialized to disk as a CER file.

Signature


RetrieveTrustedCertificate($alias) : String

Parameters

  • $alias (mandatory)
    The alias/name used when storing/retrieving the certificate.
    Type: String
    Example: 'appway'

Return Value

  • The base64 encoded certificate that can be serialized to disk as a CER file.
    Type: String

Examples

RetrieveTrustedCertificateFunction('appway')

ReturnWebApiError

Nothing.

Signature


ReturnWebApiError($errorMessage , $statusCode) : Nothing

Parameters

  • $errorMessage (mandatory)
    Error message that gets send back as part of the response.
    Type: String
  • $statusCode (optional)
    HTTP status code used when sending the response (default=500).
    Type: Integer
    Example: 500

Return Value

  • Nothing.
    Type: Nothing

Examples

ReturnWebApiError('error message', 400)

REVERSE

Reverse the order of the elements of an indexed collection.

Signature


REVERSE($list , $inplace) : Any:indexed

Parameters

  • $list (mandatory)
    Indexed collection to be reversed.
    Type: Any:indexed
    Example: $persons
  • $inplace (optional)
    If set to true, the collection is reversed in place.
    Type: Boolean
    Example: false

Return Value

  • Reversed collection.
    Type: Any:indexed

Examples

REVERSE($persons)

RightPad

Make sure the given string has at least the given length.

Signature


RightPad($text , $length , $paddingChar) : String

Parameters

  • $text (mandatory)
    The text to be padded.
    Type: String
    Example: 'bar'
  • $length (mandatory)
    The minimal length.
    Type: Integer
    Example: 5
  • $paddingChar (optional)
    The character that is used for padding (default is ' '.
    Type: String
    Example: ' '

Return Value

  • Make sure the given string has at least the given length.
    Type: String

Examples


RightPad('bar',5)='bar  '


RightPad('barfoo',5)='barfoo'

RM

Remove the given file.

Signature


RM($path) : Nothing

Parameters

  • $path (mandatory)
    The absolute file path.
    Type: String
    Example: '{DATA_HOME}/tmp/attention.xml'

Return Value

  • Remove the given file.
    Type: Nothing

Examples

RM('{DATA_HOME}/tmp/attention.xml')

RollbackProcessInstance

Roll back/drop thread-local changes related to the given process instance.

Signature


RollbackProcessInstance($processInstanceId) : Nothing

Parameters

  • $processInstanceId (mandatory)
    The ID of the process instance to roll back.
    Type: String
    Example: '1414515505935'

Return Value

  • Roll back/drop thread-local changes related to the given process instance.
    Type: Nothing

Examples

RollbackProcessInstance('1414515505935')

RotateImage

Rotate an image. Supported input formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP. Supported output formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP.

Signature


RotateImage($file1 , $file2 , $degrees) : Nothing

Parameters

  • $file1 (mandatory)
    Input image file path.
    Type: String
    Example: 'uploads/image021.jpg'
  • $file2 (mandatory)
    Output image file path (pass null to overwrite input file).
    Type: String
    Example: 'uploads/logo.jpg'
  • $degrees (mandatory)
    Degrees of rotation (-90, 90 or 180).
    Type: Integer
    Example: -90

Return Value

  • Type: Nothing

Examples

RotateImage($file1, $file2, -90)

ROUND

Round the given value to the given precision. The default number of digits after the decimal point is 0.

Signature


ROUND($number , $position) : Double

Parameters

  • $number (mandatory)
    The number that must be rounded.
    Type: Number
    Example: 5.25
  • $position (optional)
    The number of digits after the decimal point.
    Type: Integer
    Example: 2

Return Value

  • Round the given value to the given precision. The default number of digits after the decimal point is 0, but the returned type is always a Double.
    Type: Double

Examples


ROUND(5.255,2) = 5.26


ROUND(5.255) = 5.0


TOINTEGER(ROUND(5.255)) = 5

Rule:NewReference

Creates a Business Object Reference of type Rule:Reference.

Signature


Rule:NewReference($id) : Rule:Reference

Parameters

  • $id (mandatory)
    Rule ID.
    Type: String
    Example: 'myRule'

Return Value

  • Creates a Business Object Reference of type Rule:Reference.
    Type: Rule:Reference

Examples

Rule:NewReference('myRule')

RULEFORMULA

Get the formula for the given rule.

Signature


RULEFORMULA($rule) : String

Parameters

  • $rule (mandatory)
    The rule whose formula we want.
    Type: BusinessObject
    Example: 1

Return Value

  • The formula for the given rule.
    Type: String

Examples

$text := RULEFORMULA($rule)

RuleSet:NewReference (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. The RuleSet Business Object is deprecated. Creates a Business Object Reference of type RuleSet:Reference.

Signature


RuleSet:NewReference($id) : RuleSet:Reference

Parameters

  • $id (mandatory)
    RuleSet ID.
    Type: String
    Example: 'myRuleSet'

Return Value

  • Creates a Business Object Reference of type RuleSet:Reference.
    Type: RuleSet:Reference

Examples

RuleSet:NewReference('myRuleSet')

RULETEXT

Get the description text for the given Rule.

Signature


RULETEXT($rule , $defaultValuePatterns) : String

Parameters

  • $rule (mandatory)
    The rule whose text we want.
    Type: BusinessObject
    Example: 1
  • $defaultValuePatterns (optional)
    Value patterns to be applied as a default.
    Type: String:mapped
    Example: {'For'='For numbers between <for.start> and <for.end> do the following:'}

Return Value

  • The description text for the given rule.
    Type: String

Examples

$text := RULETEXT($rule)

RunWithVersionFilter

Runs an expression with a specific version filter.

Signature


RunWithVersionFilter($versionFilter , $expression) : Any

Parameters

  • $versionFilter (mandatory)
    The version filter to run with.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter('HeadFilter')
  • $expression (mandatory)
    The expression to run.
    Type: Any
    Example: LIST('foo', 'FooCatalog', 'description')

Return Value

  • Runs an expression with a specific version filter.
    Type: Any

Examples

RunWithVersionFilter(VersionFilter('HeadFilter'), LIST('foo', 'FooCatalog', 'description'))

ScaleImage

Scale an image to a given width and height. Supported input formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP. Supported output formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP.

Signature


ScaleImage($file1 , $file2 , $width , $height) : Nothing

Parameters

  • $file1 (mandatory)
    Input image file path.
    Type: String
    Example: 'uploads/image021.jpg'
  • $file2 (mandatory)
    Output image file path (pass null to overwrite input file).
    Type: String
    Example: 'uploads/logo.jpg'
  • $width (mandatory)
    Image width.
    Type: Integer
    Example: 200
  • $height (mandatory)
    Image height.
    Type: Integer
    Example: 100

Return Value

  • Type: Nothing

Examples

ScaleImage($file1, $file2, 200, 100)

SCOPETRACETABLE

Build PDF Output Table XML Code with a Scope Stack Trace in a 'table' tag.

Signature


SCOPETRACETABLE() : String

Parameters
None
Return Value

  • PDF Output Table XML Code with a Scope Stack Trace.
    Type: String

Examples




Screen:GenerateAppwayTestIds

The function automatically generates Appway Test IDs for all the Workspace Components contained in a target Package.

Signature


Screen:GenerateAppwayTestIds($packageId , $simulate , $overrideExistingIds) : String

Parameters

  • $packageId (mandatory)
    The target Package ID where the automatic Test IDs will be generated. If empty the Base package is used.
    Type: String
    Example: PackageA
  • $simulate (optional)
    When true the function does not assign Test IDs, but it just returns the CSV string, containing the result of the simulation.
    Type: Boolean
    Example: false
  • $overrideExistingIds (optional)
    When true the function overrides existing Test IDs.
    Type: Boolean
    Example: false

Return Value

  • A CSV formatted string. Each entry contains : Screen ID, previous Test ID, generated Test ID.
    Type: String

Examples

Screen:GenerateAppwayTestIds('PackageA', true, true)

Screen:NewReference

Creates a Business Object Reference of type Screen:Reference.

Signature


Screen:NewReference($id) : Screen:Reference

Parameters

  • $id (mandatory)
    Screen ID.
    Type: String
    Example: 'myScreen'

Return Value

  • Creates a Business Object Reference of type Screen:Reference.
    Type: Screen:Reference

Examples

Screen:NewReference('myScreen')

SCREENCONTEXT

Returns the current Screen Context. If the function is not called in a Screen context, null is returned.

Signature


SCREENCONTEXT() : ScreenContext

Parameters
None
Return Value

  • Screen Context.
    Type: ScreenContext

Examples

SCREENCONTEXT()

ScreenHasOutgoingConnection

Checks inside the current (sub)process if the current screen has an outgoing connection with the given name. Returns false if called outside of a screen belonging to a process.

Signature


ScreenHasOutgoingConnection($name) : Boolean

Parameters

  • $name (mandatory)
    Name of the connection.
    Type: String
    Example: 'back'

Return Value

  • Checks inside the current (sub)process if the current screen has an outgoing connection with the given name. Returns false if called outside of a screen belonging to a process.
    Type: Boolean

Examples

ScreenHasOutgoingConnection('back')

SCREENID

Get the Id of the current Screen.

Signature


SCREENID() : String

Parameters
None
Return Value

  • Get the Id of the current Screen.
    Type: String

Examples

SCREENID()

SCREENSTATE

Returns the current Screen State. If the function is not called in a Screen context, null is returned. If there is no Screen State but argument 'create' is set to true, a new Screen State is created and returned.

Signature


SCREENSTATE($create) : ScreenState

Parameters

  • $create (optional)
    If Screen State doesn't exist, create it.
    Type: Boolean
    Example: false

Return Value

  • Screen State.
    Type: ScreenState

Examples

SCREENSTATE()

SCREENSTATEGET

Get the value of a Screen State attribute by name. Returns null if the Screen State doesn't exist.

Signature


SCREENSTATEGET($name) : Any

Parameters

  • $name (mandatory)
    Attribute name.
    Type: String
    Example: 'language'

Return Value

  • Attribute value.
    Type: Any

Examples


SCREENSTATEGET('language') = 'de'

SCREENSTATESET

Set a Screen State attribute. Returns true if the attribute has been set. Pass null as value to remove the attribute.

Signature


SCREENSTATESET($name , $value) : Boolean

Parameters

  • $name (mandatory)
    Attribute name.
    Type: String
    Example: 'language'
  • $value (mandatory)
    Attribute value.
    Type: Any
    Example: 'de'

Return Value

  • Set an Screen State attribute.
    Type: Boolean

Examples

SCREENSTATESET('language', 'de')

SCREENURL

Build an URL to show a screen given its id. The return value starts with /screen and doesn't contain the context path.

Signature


SCREENURL($screenRef , $language , $pathParameters , $queryParameters , $filter) : String

Parameters

  • $screenRef (mandatory)
    Screen Reference.
    Type: Screen:Reference
    Example: Screen:NewReference('MediaLibrary')
  • $language (optional)
    Language id.
    Type: String
    Example: 'en'
  • $pathParameters (optional)
    Path parameters.
    Type: String
    Example: 'newsId/12/section/details'
  • $queryParameters (optional)
    Query parameters.
    Type: String
    Example: color=red&user=TST
  • $filter (optional)
    Version filter.
    Type: String
    Example: 'LatestCommittedFilter'

Return Value

  • URL without host and context path.
    Type: String

Examples


SCREENURL(Screen:NewReference('MediaLibrary'),'en','newsId/12/section/details','color=red&user=TST') = '/screen/MediaLibrary/language/en/newsId/12/section/details?color=red&user=TST'

SCRIPTFUNCTIONURL (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 9 OR LATER. Build an url which calls the given script function.

Signature


SCRIPTFUNCTIONURL($expression) : String

Parameters

  • $expression (mandatory)
    The expression that must be called.
    Type: Any
    Example: -12.4

Return Value

  • Build an url which calls the given script function.
    Type: String

Examples


SCRIPTFUNCTIONURL($a+$b)='/script/ADD?$p1=1&$p2=2


SCRIPTURL(1+2)='/script/ADD?$p1=1&$p2=2

SelectBusinessObjects

List of Object Version References.

Signature


SelectBusinessObjects($type , $versionFilterString) : Any:indexed

Parameters

  • $type (mandatory)
    The type name, null for all types.
    Type: String
    Example: 'Data Class'
  • $versionFilterString (mandatory)
    Version Filter string.
    Type: String
    Example: 'HeadFilter'

Return Value

  • List of Object Version References.
    Type: Any:indexed

Examples

SelectBusinessObjects($type, $versionFilterString)
SelectBusinessObjects(null, $versionFilterString)
SelectBusinessObjects(null, null)

SendAddressedNotification

Send a notification to a list of receivers (users/groups/roles) and return the created addressed notification message.

Signature


SendAddressedNotification($receivers , $deliveryChannelIds , $userId , $type , $text , $attachments) : AddressedNotificationMessage

Parameters

  • $receivers (mandatory)
    Indexed collection of user IDs, group IDs (with prefix 'GROUP:'), and role IDs (with prefix 'ROLE:') to send this notification to.
    Type: String:indexed
    Example: [USERID()]:String
  • $deliveryChannelIds (mandatory)
    Indexed collection of delivery channel Ids. If this is null, the standard 'appway' delivery channel is used. If not, the notification is delivered to the given users via the given delivery channels.
    Type: String:indexed
    Example: ['appway']:String
  • $userId (mandatory)
    The ID of the user on behalf of which to send this notification, can also be a dummy user ID like 'system' for system notifications.
    Type: String
    Example: USERID()
  • $type (mandatory)
    Notification type (can be used to display to the user as text or as a CSS class to add a notification icon).
    Type: String
    Example: 'System'
  • $text (mandatory)
    The message text to send, Include links with the syntax \link{[url]}{[name]} (e.g., \link{http://www.appway.com}{Appway}), mentions with the syntax \mention{[userId]}{[name]} (e.g., \mention{NM}{Bruce Wayne}), and attributions with the syntax \attribution{[userId]}{@[name]} (e.g., \attribution{NM}{@BruceWayne}).
    Type: String
    Example: 'Hey nm, something happened...'
  • $attachments (optional)
    Attachments to send with the notification.
    Type: UserMessageAttachment:indexed
    Example: $attachments

Return Value

  • Send a notification to a list of receivers (users/groups/roles) and return the created addressed notification message.
    Type: AddressedNotificationMessage

Examples

SendAddressedNotification(['nm']:String, null, USERID(), 'Alert', 'Something important happend:...')

SendProcessMessage

Send a Process Message to a Process Message Queue.

Signature


SendProcessMessage($queueName , $message) : Nothing

Parameters

  • $queueName (mandatory)
    Name of the Process Message Queue.
    Type: String
    Example: 'OrderInbox'
  • $message (mandatory)
    Process Message.
    Type: WorkflowMessage
    Example: $message

Return Value

  • Nothing.
    Type: Nothing

Examples

SendProcessMessage('OrderInbox', $message)

SendPubSubNotification

Send a notification with given topics and return the created pubsub notification message.

Signature


SendPubSubNotification($topics , $receivers , $userId , $type , $text , $attachments , $excludeSendingUser) : PubSubNotificationMessage:none

Parameters

  • $topics (mandatory)
    Indexed collection of topic IDs this notification belongs to. Users subscribed to at least one of the topics will receive the notification.
    Type: String:indexed
    Example: ['new-american-client']:String
  • $receivers (mandatory)
    Indexed collection of user IDs, group IDs (with prefix 'GROUP:'), and role IDs (with prefix 'ROLE:'). Can be null. If it is supplied, the notification will be sent to the subset of the supplied receivers currently subscribed to at least one of the given topics.
    Type: String:indexed
    Example: ['batman']:String
  • $userId (mandatory)
    The user on behalf of which to send this notification.
    Type: String
    Example: USERID()
  • $type (mandatory)
    Notification type (can be used to display to the user as text or as a CSS class to add a notification icon).
    Type: String
    Example: 'System'
  • $text (mandatory)
    The notification text to send. Include links with the syntax \link{[url]}{[name]} (e.g., \link{http://www.appway.com}{Appway}), mentions with the syntax \mention{[userId]}{[name]} (e.g., \mention{NM}{Bruce Wayne}), and attributions with the syntax \attribution{[userId]}{@[name]} (e.g., \attribution{NM}{@BruceWayne}).
    Type: String
    Example: 'We have a new American client!'
  • $attachments (optional)
    Attachments to send with the notification.
    Type: UserMessageAttachment:indexed
    Example: $attachments
  • $excludeSendingUser (optional)
    Flag indicating if the notification should not be delivered to the sending user. Default is false.
    Type: Boolean
    Example: false

Return Value

  • Send a notification with given topics and return the created pubsub notification message.
    Type: PubSubNotificationMessage:none

Examples

SendPubSubNotification(['new-american-client']:String, null, USERID(), 'Clients', 'We have a new American client!')

SendWorkflowMessage

Create a WorkflowMessage with properties 'time' and 'entity' to the given workflowinstance.

Signature


SendWorkflowMessage($workflowInstanceId , $messageId , $message) : Nothing

Parameters

  • $workflowInstanceId (mandatory)
    The instance of the workflow to be notified.
    Type: String
    Example: '123412341234'
  • $messageId (mandatory)
    The id of the message.
    Type: String
    Example: '123412341234'
  • $message (mandatory)
    The data entity that must be delivered as message.
    Type: com.nm.sdk.data.dataitems.DataEntity
    Example: $myentity

Return Value

  • Create a WorkflowMessage with properties 'time' and 'entity' to the given workflowinstance.
    Type: Nothing

Examples

SendWorkflowMessage($workflowInstanceId, $messageId, $message)

SEQUENCE

Evaluate one argument after the other from left to right. Return the value of the last argument.

Signature


SEQUENCE($expression) : Any

Parameters

  • $expression (optional)
    An expression.
    Type: Any
    Example: 1+1

Return Value

  • Evaluate the given expression sequence. Return the result of the last evaluated expression.
    Type: Any

Examples


SEQUENCE(1+1,1+2)=3

SERIALIZE

Serialize the given object.

Signature


SERIALIZE($object , $deepclone , $keepDbRefs) : String

Parameters

  • $object (mandatory)
    The object that must be serialized.
    Type: Any
    Example: $person
  • $deepclone (optional)
    Make a deep copy (copies sub structures) default is 'true'.
    Type: Boolean
    Example: $deepclone
  • $keepDbRefs (optional)
    NO LONGER SUPPORTED SINCE APPWAY 7! keep database references (default is false).
    Type: Boolean
    Example: $keepDbRefs

Return Value

  • Serialize the given object.
    Type: String

Examples

SERIALIZE($person)

SetDataContextPrimitiveValue

Given a Data Task corresponding to the given token ID, updates the primitive field associated with the given binding with the given value.

Signature


SetDataContextPrimitiveValue($tokenID , $binding , $value) : Nothing

Parameters

  • $tokenID (mandatory)
    The ID of the token.
    Type: String
    Example: $tokenID
  • $binding (mandatory)
    The binding associated with the primitive field to update.
    Type: String
    Example: $binding
  • $value (mandatory)
    The new value for the primitive field to update.
    Type: String
    Example: $value

Return Value

  • Type: Nothing

Examples


SetDataContextPrimitiveValue($tokenID, $binding, $value).

SetKey

Sets the key for the given encryption-key-alias, returns true if successful.

Signature


SetKey($keyAlias , $masterPassword , $key , $overwrite) : String

Parameters

  • $keyAlias (mandatory)
    The encryption key alias to be used for decryption.
    Type: String
    Example: 'my-key-alias'
  • $masterPassword (mandatory)
    The master password.
    Type: String
    Example: 'my-key-alias'
  • $key (mandatory)
    The secret value to be used as the key.
    Type: String
    Example: 'secretKey'
  • $overwrite (optional)
    Overwrite if exists. Default is false.
    Type: Boolean
    Example: false

Return Value

  • Sets the key for the given encryption-key-alias, returns true if successful.
    Type: String

Examples

SetKey('my-key-alias', 'masterPassword', 'secretKey')

SetProcessSignal

Set a Process Signal.

Signature


SetProcessSignal($signalName , $lifeTime , $processInstanceId) : Nothing

Parameters

  • $signalName (mandatory)
    Name of the Process Signal.
    Type: String
    Example: 'TempAlert'
  • $lifeTime (optional)
    Signal life time, default is '1d' for 1 day (examples: "2w", "1d 6h" or "2m 30s").
    Type: String
    Example: 1d
  • $processInstanceId (optional)
    Process Instance Id.
    Type: String
    Example: null

Return Value

  • Nothing.
    Type: Nothing

Examples

SetProcessSignal('TempAlert', '1d')

SETSCROLLOFFSETVERTICAL

Set the current vertical scroll offset.

Signature


SETSCROLLOFFSETVERTICAL($ypos) : Integer

Parameters

  • $ypos (mandatory)
    Vertical scroll offset.
    Type: Integer
    Example: SETSCROLLOFFSETVERTICAL($ypos)

Return Value

  • Set the current vertical scroll offset.
    Type: Integer

Examples

SETSCROLLOFFSETVERTICAL($ypos)

SetVersionFilter

Sets the version filter used in the current thread. The version filter will be reset when the thread finishes processing. The function returns the current version filter.

Signature


SetVersionFilter($filter) : String

Parameters

  • $filter (mandatory)
    The new version filter.
    Type: String
    Example: 'LatestCommittedFilter'

Return Value

  • Sets the version filter used in the current thread. The version filter will be reset when the thread finishes processing. The function returns the current version filter.
    Type: String

Examples

SetVersionFilter('LatestCommittedFilter')
SetVersionFilter('TimestampFilter')
SetVersionFilter('HeadFilter')

SHORT

Return the short date format of the given date and optional locale. If no locale is specified the system default locale is used.

Signature


SHORT($date , $locale , $timeZone) : String

Parameters

  • $date (mandatory)
    The date.
    Type: Date
    Example: NOW()
  • $locale (optional)
    The language code.
    Type: String
    Example: 'de'
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: 'US/Eastern', 'Europe/Zurich', 'GMT'

Return Value

  • Returns the short date format of the given date and optional locale.
    Type: String

Examples

SHORT(NOW())

SignData

Bse64 encoded signed data using given algorithm, provider and key.

Signature


SignData($data , $key , $algorithm , $provider , $keyCharSet , $dataCharSet , $outputFormat) : String

Parameters

  • $data (mandatory)
    The data to be encrypted.
    Type: String
    Example: 'mydata'
  • $key (mandatory)
    The secret key used for the signature.
    Type: String
    Example: 'mykey'
  • $algorithm (optional)
    The signature alogrithm, default 'HmacSHA256'.
    Type: String
    Example: 'HmacSHA256'
  • $provider (optional)
    The provider, default 'BC' bouncycastle. Org.
    Type: String
    Example: 'BC'
  • $keyCharSet (optional)
    The charset for the key.
    Type: String
    Example: 'UTF-8'
  • $dataCharSet (optional)
    The charset for the data.
    Type: String
    Example: 'UTF-8'
  • $outputFormat (optional)
    Base64|hex.
    Type: String
    Example: 'base64

Return Value

  • Bse64 encoded signed data using given algorithm, provider and key.
    Type: String

Examples

SignData('mydata', 'mykey', 'HmacSHA256', 'BC')

SIN

Sine.

Signature


SIN($value) : Double

Parameters

  • $value (mandatory)
    Angle.
    Type: Double
    Example: PI()

Return Value

  • Sine.
    Type: Double

Examples

SIN(PI())

SIZE

Get the size of a collection or a string.

Signature


SIZE($collection) : Integer

Parameters

  • $collection (mandatory)
    Collection.
    Type: com.nm.sdk.data.dataitems.DataMap
    Example: $collection

Return Value

  • Get the size of a collection.
    Type: Integer

Examples


SIZE($collection) = 5

SORT (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use Collection:Sort instead.

Signature


SORT($collection , $function , $variable1 , $variable2 , $inplace , $ignoreComparisonErrors) : Any:indexed

Parameters

  • $collection (mandatory)
    Indexed collection.
    Type: Any:indexed
    Example: $persons
  • $function (mandatory)
    Name of Comparator Function or Comparator Expression.
    Type: Any
    Example: 'PERSONSORT'
    $person1.age - $person2.age
  • $variable1 (optional)
    Variable 1.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $person1
  • $variable2 (optional)
    Variable 2.
    Type: com.nm.sdk.data.expeval.nodes.VariableNode
    Example: $person2
  • $inplace (optional)
    If set to true, the collection is sorted in place.
    Type: Boolean
    Example: false
  • $ignoreComparisonErrors (optional)
    If set to true, exceptions during comparison will be ignored.
    Type: Boolean
    Example: false

Return Value

  • Sorts an Indexed collection.
    Type: Any:indexed

Examples

SORT($persons, 'PERSONSORT')
SORT($persons, $person.age, $person)
SORT($persons, $person1.age - $person2.age, $person1, $person2)

SPLIT

Split a string into an indexed collection of strings. Use the reverse function JOINLIST to join a list of strings into one string.

Signature


SPLIT($text , $separator) : String:indexed

Parameters

  • $text (mandatory)
    Text to be splitted.
    Type: String
    Example: 'hello|world'
  • $separator (optional)
    Separator string.
    Type: String
    Example: '|'

Return Value

  • Split a string into an indexed collection of strings.
    Type: String:indexed

Examples


SPLIT('hello|world','|') = ['hello','world']


SPLIT('James,Jim,Jane,John,Jill',',') = ['James','Jim','Jane','John','Jill']

SplitIndexed (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2023 OR LATER.

Signature


SplitIndexed($inputCollection , $splitFactor) : Any:indexed

Parameters

  • $inputCollection (mandatory)
    The input collection to be split.
    Type: Any:indexed
    Example: [1, 2, 3, 4, 5, 6]:String
  • $splitFactor (mandatory)
    The max chunk size.
    Type: Integer
    Example: 4

Return Value

  • Collection containing the original collection elements split in chunks of the specified size.
    Type: Any:indexed

Examples


Any[String[1, 2, 3, 4], String[5, 6]]

SPLITLINES

Split a text into an indexed collection of lines.

Signature


SPLITLINES($text) : String:indexed

Parameters

  • $text (mandatory)
    Text to be splitted.
    Type: String
    Example: 'hello\nworld'

Return Value

  • Split a text into an indexed collection of lines.
    Type: String:indexed

Examples


SPLITLINES('hello\nworld') = ['hello','world']

SplitValueStore (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Splits a value store and stores its data entities in a different distributed map.

Signature


SplitValueStore($processInstanceId) : Any

Parameters

  • $processInstanceId (mandatory)
    The process instance id of the value store that must be split.
    Type: String
    Example: $processInstanceId

Return Value

  • Returns true if the value store has been split successfully or false if the value store is non-persistent or contains not allowed links and it cannot be split. Note: If value store splitting is not enabled, this method will simply prepare the value store to be split once value store splitting is enabled.
    Type: Any

Examples

SplitValueStore($processInstanceId)

SqlCall

Return the result of the given SQL procedure.

Signature


SqlCall($datasource , $query , $attributes , $queryTimeout) : Any:indexed

Parameters

  • $datasource (mandatory)
    The name of the datasource.
    Type: String
    Example: 'dataSourceId'
  • $query (mandatory)
    The SQL query.
    Type: String
    Example: '{call removeAccount(?)}
  • $attributes (optional)
    The attributes of the query for a callable statement. The Indexed Collection contains Named Collections each including a pair of entries with keys 'type' and 'value' or 'type' and 'sqlType''.
    Type: Any:indexed
    Example: $theAttributes
  • $queryTimeout (optional)
    The timeout for the query in seconds. Use null or 0 for unlimited queries.
    Type: Integer
    Example: 10

Return Value

  • Return the result of the given SQL procedure.
    Type: Any:indexed

Examples

SqlCall('dataSourceId', '{call schema.procedureName(?)}', [{'type'='in', 'value'=$argValue}:Any]:Any, $timeout)
SqlCall('dataSourceId', '{call truncateWeeklyStats()}')
SqlCall('dataSourceId', '{call removeAccount(?)}', [{'type'='in', 'value'=$accountId}:Any]:Any)
SqlCall('dataSourceId', 'call transferMoney(?,?,?)', [{'type'='in', 'value'=$accountIdFrom}:Any, {'type'='in', 'value'=$accountIdTo}:Any, {'type'='in', 'value'=$amountToBeTransferred}:Any]:Any)
SqlCall('dataSourceId', 'call getConfig()', [{'type'='out', 'sqlType'='varchar'}:Any]:Any)

SqlClose

Close the current context associated connection.

Signature


SqlClose() : Nothing

Parameters
None
Return Value

  • Close the current context associated connection.
    Type: Nothing

Examples

SqlClose()

SqlCommit

Commit the current context associated connection.

Signature


SqlCommit() : Nothing

Parameters
None
Return Value

  • Commit the current context associated connection.
    Type: Nothing

Examples

SqlCommit()

SqlExport

Number of exported database records.

Signature


SqlExport($filePath , $dataSource , $query , $parameters , $limit , $separator , $escape , $quote , $encoding , $lineEnd) : Integer

Parameters

  • $filePath (mandatory)
    CSV file path.
    Type: String
    Example: 'work/tmp/export.csv'
  • $dataSource (mandatory)
    Name of the Data Source.
    Type: String
    Example: 'CRM'
  • $query (mandatory)
    SQL query.
    Type: String
    Example: 'SELECT * FROM Customers'
  • $parameters (optional)
    SQL query parameters.
    Type: Any:indexed
    Example: $params
  • $limit (optional)
    Maximum number of returned Data Objects.
    Type: java.lang.Integer
    Example: 100
  • $separator (optional)
    The field separator character. Default: ';'.
    Type: String
    Example: ';'
  • $escape (optional)
    The escape character. Default: '"'.
    Type: String
    Example: '"'
  • $quote (optional)
    The quote character. Default: the same as the escape character.
    Type: String
    Example: '"'
  • $encoding (optional)
    The file encoding. Default: UTF-8.
    Type: String
    Example: 'UTF-8'
  • $lineEnd (optional)
    The line end character(s). Default: \n.
    Type: String
    Example: '\n'

Return Value

  • Number of exported database records.
    Type: Integer

Examples

SqlExport('work/tmp/export.csv', 'CRM', 'SELECT * FROM Customers')

SqlImport

Number of imported database records.

Signature


SqlImport($filePath , $dataSource , $tableName , $ignoreErrors , $separator , $escape , $quote , $encoding) : Integer

Parameters

  • $filePath (mandatory)
    CSV file path.
    Type: String
    Example: 'work/tmp/export.csv'
  • $dataSource (mandatory)
    Name of the Data Source.
    Type: String
    Example: 'CRM'
  • $tableName (mandatory)
    SQL table name.
    Type: String
    Example: 'Customers'
  • $ignoreErrors (optional)
    Ignore SQL errors.
    Type: Boolean
    Example: false
  • $separator (optional)
    The field separator character. Default: ';'.
    Type: String
    Example: ';'
  • $escape (optional)
    The escape character. Default: '"'.
    Type: String
    Example: '"'
  • $quote (optional)
    The quote character. Default: the same as the escape character.
    Type: String
    Example: '"'
  • $encoding (optional)
    The file encoding. Default: UTF-8.
    Type: String
    Example: 'UTF-8'

Return Value

  • Number of imported database records.
    Type: Integer

Examples

SqlImport('work/tmp/export.csv', 'CRM', 'Customers', true)

SqlLoad

Indexed collection of Data Objects.

Signature


SqlLoad($dataClass , $dataSource , $query , $parameters , $limit) : Any:indexed

Parameters

  • $dataClass (mandatory)
    Data Class.
    Type: String
    Example: Customer
  • $dataSource (mandatory)
    Name of the Data Source.
    Type: String
    Example: 'CRM'
  • $query (mandatory)
    SQL query.
    Type: String
    Example: 'SELECT * FROM Customers'
  • $parameters (optional)
    SQL query parameters.
    Type: Any:indexed
    Example: $params
  • $limit (optional)
    Maximum number of returned Data Objects.
    Type: java.lang.Integer
    Example: 100

Return Value

  • Indexed collection of Data Objects.
    Type: Any:indexed

Examples

SqlLoad(Customer, 'CRM', 'SELECT * FROM Customers')

SqlOpen

Generate a new execution context associated connection.

Signature


SqlOpen($datasource , $autoCommitOrRollback) : Nothing

Parameters

  • $datasource (mandatory)
    The name of the datasource.
    Type: String
    Example: 'nmruntime'
  • $autoCommitOrRollback (optional)
    Specifies that statements should be autocommited (true) or that SqlCommit and SqlRollback commands will be used (false).
    Type: Boolean
    Example: false

Return Value

  • Generate a new execution context associated connection.
    Type: Nothing

Examples

SqlOpen('nmruntime', false)

SqlQuery

Return the result of the given SQL query.

Signature


SqlQuery($datasource , $query , $attriubtes , $limit , $keyColumnIndex , $queryTimeout) : Any:indexed

Parameters

  • $datasource (mandatory)
    The name of the datasource.
    Type: String
    Example: 'nmruntime'
  • $query (mandatory)
    The SQL query.
    Type: String
    Example: 'SELECT COUNT(entityId) FROM entity'
  • $attriubtes (optional)
    The attributes of the query for a prepared statement.
    Type: Any:indexed
    Example: $theAttributes
  • $limit (optional)
    Limit the number of results (default 0, no limit).
    Type: java.lang.Integer
    Example: 100
  • $keyColumnIndex (optional)
    Index of the auto generated key column (non-specified or null for default).
    Type: java.lang.Integer
    Example: 2
  • $queryTimeout (optional)
    The timeout for the query in seconds. Use null or 0 for unlimited queries.
    Type: java.lang.Integer
    Example: 10

Return Value

  • Return the result of the given SQL query.
    Type: Any:indexed

Examples


SqlQuery('nmruntime','SELECT COUNT(entityId) FROM entity') = Any[ Any{'COUNT(entityId)':123322}]

SqlRollback

Rollback the current context associated connection.

Signature


SqlRollback() : Nothing

Parameters
None
Return Value

  • Rollback the current context associated connection.
    Type: Nothing

Examples

SqlRollback()

SQRT

Return the correctly rounded positive square root of a double value.

Signature


SQRT($number) : Double

Parameters

  • $number (mandatory)
    The number.
    Type: Double
    Example: 4

Return Value

  • Returns the correctly rounded positive square root of a double value.
    Type: Double

Examples


SQRT(4)=2


SQRT(-1)=NaN

Ssl:DecodeCertificates

Returns certificate details intended for troubleshooting.

Signature


Ssl:DecodeCertificates($Alias or File-path) : String

Parameters

  • $Alias or File-path (mandatory)
    The alias or file path of the certificate, the function will search for the alias in the truststore and if it does not find it will proceed to search the input as a file path.
    Type: String
    Example: 'fnz'

Return Value

  • Returns certificate details intended for troubleshooting.
    Type: String

Examples

Ssl:DecodeCertificates('fnz')
Ssl:DecodeCertificates('{DATA_HOME}/tmp/certificates/fnz.cer')

Ssl:FetchCertificates

Downloads all certificates found on a given URL, stores them to a file and returns the file absolute path.

Signature


Ssl:FetchCertificates($url , $filePath) : String

Parameters

  • $url (mandatory)
    The URL from where the certificate needs to be fetched.
    Type: String
    Example: 'https://fnz.com/'
  • $filePath (mandatory)
    The path where the file needs to be saved (must be a valid path). You can use {DATA_HOME} placeholder to point to the data home absolute path.
    Type: String
    Example: '{DATA_HOME}/tmp/certificate.cer'

Return Value

  • Downloads all certificates found on a given URL, stores them to a file and returns the file absolute path.
    Type: String

Examples

Ssl:FetchCertificates('https://fnz.com/', '{DATA_HOME}/tmp/fnz.cer')

Ssl:ListTrustStoreAliases

Get the list of trust store aliases.

Signature


Ssl:ListTrustStoreAliases() : String:indexed

Parameters
None
Return Value

  • Get the list of trust store aliases.
    Type: String:indexed

Examples

Ssl:ListTrustStoreAliases()

StackTrace

Returns the stack trace for the given Java exception.

Signature


StackTrace($exception) : String

Parameters

  • $exception (mandatory)
    Exception.
    Type: Exception
    Example: $exception

Return Value

  • Stack trace.
    Type: String

Examples

StackTrace($exception)

StartCollectingStatistics

Start collecting statistics on the node where this is executed.

Signature


StartCollectingStatistics() : Nothing

Parameters
None
Return Value

  • Start collecting statistics on the node where this is executed.
    Type: Nothing

Examples

StartCollectingStatistics()

StartProcess

Start a new Process Instance and return its ID.Note on Variable Assignments: Starting with Appway 8, a WARN log messages is printed when passing non-Serializable variables.Starting with Appway 9, variables are cloned before being passed to the new Process Instance. If cloning is not possible, a WorkspaceException is thrown.

Signature


StartProcess($reference , $screen , $variables , $versionFilter , $update) : String

Parameters

  • $reference (mandatory)
    Process Reference.
    Type: Process:Reference
    Example: Process:NewReference('AOP')
  • $screen (optional)
    Show first Screen.
    Type: Boolean
    Example: false
  • $variables (optional)
    Variable Assignments (Named Any), values are passed to the Process Instance as constant parameter assignment.
    Type: Any:mapped
    Example: $variables
  • $versionFilter (optional)
    Version Filter to use for the new Process Instance. If it is not specified, the latest committed version of the process will be used. Note: If the current Version Filter is permanent, it will be kept.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter
    Example: VersionFilter()
  • $update (optional)
    Set to false to only initialize the new Process Instance. Process Tokens will be set on Start Events and Variables will be initialized. Set to true (default) to also update the Process Instance immediately (synchronous), moving Process Tokens from the Start Events through the Process.
    Type: Boolean
    Example: false

Return Value

  • Process Instance Id.
    Type: String

Examples


StartProcess(Process:NewReference('AOP')) = '129409273901'

Local Named Any $variables;
$variables := NewNamed(Any);
$variables['dossierId'] := $dossierId;
$variables['number'] := 12;
$variables['text'] := 'hello world';
$variables['date'] := NOW();
StartProcess('AOP', true, $variables, VersionFilter('HeadFilter'), false);

StartSubProcess

Inject a new Sub-Process Token into an existing Process Instance.Note on Variable Assignments: Starting with Appway 8, a WARN log messages is printed when passing non-Serializable variables.Starting with Appway 9, variables are cloned before being passed to the new Process Instance. If cloning is not possible, a WorkspaceException is thrown.

Signature


StartSubProcess($parentProcessTokenId , $processRef , $screen , $variables) : String

Parameters

  • $parentProcessTokenId (mandatory)
    Parent Process Token Id.
    Type: String
    Example: '129409273821'
  • $processRef (mandatory)
    Process Reference.
    Type: Process:Reference
    Example: Process:NewReference('AOP')
  • $screen (optional)
    Show first Screen.
    Type: Boolean
    Example: false
  • $variables (optional)
    Variable Assignments (Named Any), values are passed to the Process Instance as constant parameter assignment.
    Type: Any:mapped
    Example: $variables

Return Value

  • Sub-Process Token Id.
    Type: String

Examples


StartSubProcess($parentProcessTokenId, Process:NewReference('AOP')) = '129409273901'

Local Named Any $variables;
$variables := NewNamed(Any);
$variables['dossierId'] := $dossierId;
$variables['number'] := 12;
$variables['text'] := 'hello world';
$variables['date'] := NOW();
StartSubProcess($parentProcessTokenId, Process:NewReference('AOP'), true, $variables);

STARTSWITH

Check if a text starts with a given prefix.

Signature


STARTSWITH($text , $prefix) : Boolean

Parameters

  • $text (mandatory)
    Text.
    Type: String
    Example: 'hello'
  • $prefix (mandatory)
    Prefix.
    Type: String
    Example: 'hell'

Return Value

  • True if the text starts with the given prefix.
    Type: Boolean

Examples


STARTSWITH('hello','hell')=true


STARTSWITH('John Peter','Peter')=false

STDERR

Write the given message to STDERR.

Signature


STDERR($message) : String

Parameters

  • $message (mandatory)
    The message.
    Type: Any
    Example: 'hello'

Return Value

  • Write the given message to STDERR.
    Type: String

Examples

STDERR('hello')

STDOUT

Write the given message to STDOUT.

Signature


STDOUT($message) : String

Parameters

  • $message (mandatory)
    The message.
    Type: Any
    Example: 'hello'

Return Value

  • Write the given message to STDOUT.
    Type: String

Examples

STDOUT('hello')

StopCollectingStatistics

Stop collecting statistics on the node where this is executed.

Signature


StopCollectingStatistics() : Nothing

Parameters
None
Return Value

  • Stop collecting statistics on the node where this is executed.
    Type: Nothing

Examples

StopCollectingStatistics()

StoreLicenseReport

Stores a specified license report to a given directory. The name of the stored file will have the following pattern: license-report-year-month. Txt. Relative paths are interpreted relative to the Data Home.

Signature


StoreLicenseReport($month , $targetDir) : Boolean

Parameters

  • $month (mandatory)
    The month and the year of the license report.
    Type: String
    Example: '2018-01'
  • $targetDir (mandatory)
    The destination directory where the file should be stored.
    Type: String
    Example: '{DATA_HOME}/work/license-reports/'

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

StoreLicenseReport('2018-01', '{DATA_HOME}/work/license-reports/')

STRINGCOMPARE

Compare two strings A and B. The Function returns a negative number if A is before B; 0 if A and B are the same; and a positive number if A is after B.

Signature


STRINGCOMPARE($string1 , $string2 , $caseInsensitive , $nullLast) : Integer

Parameters

  • $string1 (mandatory)
    The first string.
    Type: String
    Example: 'Aaa'
  • $string2 (mandatory)
    The second string.
    Type: String
    Example: 'Zzz'
  • $caseInsensitive (optional)
    Type: Boolean
    Example: false
  • $nullLast (optional)
    Null values after all other strings.
    Type: Boolean
    Example: true

Return Value

  • A value < 0 if string1 < string2, 0 if string1 == string2, and a value > 0 if string1 > string2.
    Type: Integer

Examples

STRINGCOMPARE('A', 'B') < 0

STRINGCOMPARE('Hello','Hello') = 0

STRINGCOMPARE('z', 'a') > 0

STRINGFORMAT

Create a formatted String. Syntax: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html

Signature


STRINGFORMAT($format , $argument) : String

Parameters

  • $format (mandatory)
    Format.
    Type: String
    Example: '%1$05d'
  • $argument (optional)
    Argument.
    Type: Any
    Example: 12

Return Value

Examples


STRINGFORMAT('%1$05d',12)='00012'

SUB

Return the result of the subtraction all arguments after the first from the first argument.

Signature


SUB($summand , $summand) : Number

Parameters

  • $summand (mandatory)
    The number from which the subtraction is computed.
    Type: Number
    Example: 12
  • $summand (optional)
    The number that is substracted.
    Type: Number
    Example: 2

Return Value

  • The result of the subtraction of argument 2 to argument n from argument 1.
    Type: Number

Examples


SUB(10,5) = 5


SUB(12,2,3)=7


SUB(40,10,10,10,10) = 0

SubscribeForNotifications

Subscribe the given user/group/role to the given topic via the given notification delivery channel. If no delivery channel is supplied, the corresponding notifications will be delivered to the subscriber via the Appway notification channel.

Signature


SubscribeForNotifications($subscriberId , $topic , $deliveryChannelId) : Nothing

Parameters

  • $subscriberId (mandatory)
    The Id of the user/group/role to subscribe.
    Type: String
    Example: 'GROUP:accountManagersUSA'
  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'new-american-client'
  • $deliveryChannelId (optional)
    The Id of the notification delivery channel via which the notifications corresponding to this subscription should be delivered. Default is 'appway'.
    Type: String
    Example: 'appway'

Return Value

  • Subscribe the given user/group/role to the given topic via the given notification delivery channel. If no delivery channel is supplied, the corresponding notifications will be delivered to the subscriber via the Appway notification channel.
    Type: Nothing

Examples

SubscribeForNotifications('GROUP:accountManagersUSA', 'new-american-client')

SUBSTRING

Return a substring of the first argument.

Signature


SUBSTRING($text , $start , $end) : String

Parameters

  • $text (mandatory)
    The text.
    Type: String
    Example: 'abcde'
  • $start (mandatory)
    The start index of the substring.
    Type: Integer
    Example: 2
  • $end (optional)
    The end index of the substring, default is text length.
    Type: Integer
    Example: 4

Return Value

  • Returns a new string that is a substring of the first string.
    Type: String

Examples


SUBSTRING('abcde',2) = 'cde'


SUBSTRING('12345',2,4) = '34'

SUPER

A Super-Pointer to allow selection of overwritten functions.

Signature


SUPER($type , $theObject) : Any

Parameters

  • $type (mandatory)
    The type we want to cast to.
    Type: Any
    Example: Person
    Indexed Person
    Named Person
  • $theObject (mandatory)
    The object that should be casted.
    Type: Any
    Example: $entity

Return Value

  • A Super-Pointer to allow selection of overwritten functions.
    Type: Any

Examples

SUPER(Person, $theObject)

System:GetCsrfToken

Get the current CSRF token.

Signature


System:GetCsrfToken() : String

Parameters
None
Return Value

  • Get current CSRF token.
    Type: String

Examples

System:GetCsrfToken()

System:MajorVersion

Returns major Appway version number. For 2023.5. 3-rc1 it returns 2023.

Signature


System:MajorVersion() : Integer

Parameters
None
Return Value

  • Returns major Appway version number.
    Type: Integer

Examples

System:MajorVersion()

TAN

Tangent.

Signature


TAN($value) : Double

Parameters

  • $value (mandatory)
    Angle.
    Type: Double
    Example: PI()

Return Value

  • Tangent.
    Type: Double

Examples

TAN(PI())

TextFormat

Replaces {0}, {1},.placeholders in a string with provided replacements. Single quotes are removed. Doubled single quotes are substituted with a single quote. Characters after single quote are not formatted until matching closing quote is encountered. '{0}' will become {0}, but will not be replaced.

Signature


TextFormat($text , $values , $language , $timeZone) : String

Parameters

  • $text (mandatory)
    The string to be formatted. Each single quote must be represented by doubled single quotes, otherwise it is removed. Characters within a pair of single quotes are not formatted, but quotes are removed.
    Type: String
    Example: 'Example {0}, {1}'
  • $values (mandatory)
    Indexed collection of replacements for placeholders. If empty collection or null is passed, original string is returned as is without any formatting or processing.
    Type: Any:indexed
    Example: ['a', 'b']:String
  • $language (optional)
    The language to be used for formatting (default: en).
    Type: String
    Example: en
    de_CH
  • $timeZone (optional)
    The time zone.
    Type: String
    Example: GMT+1
    CET

Return Value

  • The formatted String.
    Type: String

Examples


TextFormat('Example {0}, {1}', ['a', 'b']:String) = 'Example a, b'

Throw:Exception

Nothing.

Signature


Throw:Exception($message) : Nothing

Parameters

  • $message (optional)
    Message.
    Type: String
    Example: 'kernel panic!!!'

Return Value

  • Nothing.
    Type: Nothing

Examples

Throw:Exception('kernel panic!!!')

Throw:IllegalArgumentException

Nothing.

Signature


Throw:IllegalArgumentException($message) : Nothing

Parameters

  • $message (optional)
    Message.
    Type: String
    Example: '$i < 0'

Return Value

  • Nothing.
    Type: Nothing

Examples

Throw:IllegalArgumentException('$i < 0')

Throw:IllegalStateException

Nothing.

Signature


Throw:IllegalStateException($message) : Nothing

Parameters

  • $message (optional)
    Message.
    Type: String
    Example: 'kernel panic'

Return Value

  • Nothing.
    Type: Nothing

Examples

Throw:IllegalStateException('kernel panic')

Throw:RethrowException

Re-throws a Java Exception. Please note that if this Exception is not a RuntimeException, it will be wrapped with an NmRuntimeException.

Signature


Throw:RethrowException($exception) : Nothing

Parameters

  • $exception (mandatory)
    Exception.
    Type: Exception
    Example: $exception

Return Value

  • Nothing.
    Type: Nothing

Examples

Throw:RethrowException($exception)

ThrowJavaException (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use Throw:IllegalStateException, Throw:IllegalArgumentException, Throw:Exception instead.

Signature


ThrowJavaException($exceptionClassName , $message) : Nothing

Parameters

  • $exceptionClassName (mandatory)
    Java Exception class name.
    Type: String
    Example: 'java.lang.IllegalArgumentException'
  • $message (optional)
    Message.
    Type: String
    Example: '$i < 0'

Return Value

  • Nothing.
    Type: Nothing

Examples

ThrowJavaException('java.lang.IllegalArgumentException', '$i < 0')

ThrowProcessCancel (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use Process:TriggerCancel instead.

Signature


ThrowProcessCancel() : Nothing

Parameters
None
Return Value

  • Nothing.
    Type: Nothing

Examples

ThrowProcessCancel()

ThrowProcessError (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use Process:TriggerError instead.

Signature


ThrowProcessError($errorCode) : Nothing

Parameters

  • $errorCode (mandatory)
    Error code.
    Type: String
    Example: 'NoFreeRooms'

Return Value

  • Nothing.
    Type: Nothing

Examples

ThrowProcessError('NoFreeRooms')

ThrowProcessTerminate (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use Process:TriggerTerminate instead.

Signature


ThrowProcessTerminate() : Nothing

Parameters
None
Return Value

  • Nothing.
    Type: Nothing

Examples

ThrowProcessTerminate()

Time:EpochMilli

The number of milliseconds of a date from Unix epoch.

Signature


Time:EpochMilli($date) : Long

Parameters

  • $date (optional)
    The date used to calculate the elapsed time. Default value is the current time.
    Type: Date
    Example: NOW()

Return Value

  • The number of milliseconds of a date from Unix epoch.
    Type: Long

Examples

Time:EpochMilli($date)

Time:EpochSecond

The number of seconds of a date from Unix epoch.

Signature


Time:EpochSecond($date) : Long

Parameters

  • $date (optional)
    The date used to calculate the elapsed time. Default value is the current time.
    Type: Date
    Example: NOW()

Return Value

  • The number of seconds of a date from Unix epoch.
    Type: Long

Examples

Time:EpochSecond($date)

TIMEADD

Add a timespan to a date. Valid timespan units: Y/y for year, M for month, W/w for week, D/d for day, H/h for hour, m for minute, s for second and S for millisecond.

Signature


TIMEADD($date , $timespan) : Date

Parameters

  • $date (mandatory)
    The date to which we add the timespan.
    Type: Date
    Example: NOW()
  • $timespan (mandatory)
    The timespan to add to the date.
    Type: String
    Example: 7D

Return Value

  • The date that results from adding the given timespan to the given date.
    Type: Date

Examples


TIMEADD(PARSEDATE('2006-01-01'),'2Y')='2008-01-01'


TIMEADD(PARSEDATE('2006-01-01'),'2M')='2006-03-01'


TIMEADD(PARSEDATE('2006-01-01'),'2D')='2006-01-03'


TIMEADD(PARSEDATE('2006-01-01 00:00:00'),'2h')='2006-01-01 02:00:00'


TIMEADD(PARSEDATE('2006-01-01 00:00:00'),'1m 30s')='2006-01-01 00:01:30'


TIMEADD(PARSEDATE('2006-01-01'),'-7D')='2005-12-27'

TIMEDIFF

Calculate the time span from date 1 to date 2 in the given time unit. If date 1 is after date 2, the result will be negative. Valid units: y for year, M for month, d for day, H for hour, m for minute and s for second.

Signature


TIMEDIFF($date1 , $date2 , $unit) : Double

Parameters

  • $date1 (mandatory)
    Date 1.
    Type: Date
    Example: $dateOfBirth
  • $date2 (mandatory)
    Date 2.
    Type: Date
    Example: TODAY()
  • $unit (mandatory)
    Unit of time to return: 's' for seconds, 'm' for minutes, 'H' for hours, 'd' for days, 'M' for months or 'y' for years.
    Type: String
    Example: y

Return Value

  • Time span from date 1 to date 2.
    Type: Double

Examples


TIMEDIFF($dateOfBirth,TODAY(),'y') = 37.82

TIMEROUND

Round a date to a given unit in a given direction. Valid units are: Y/y for year, M for month, W/w for week, D/d for day, H/h for hour, m for minute, s for second and S for millisecond; valid directions are: 'up','down' and 'round' (default).

Signature


TIMEROUND($date , $unit , $direction) : Date

Parameters

  • $date (mandatory)
    The date to round.
    Type: Date
    Example: NOW()
  • $unit (mandatory)
    The unit to round to.
    Type: String
    Example: 'D'
  • $direction (optional)
    The direction to round.
    Type: String
    Example: 'up'

Return Value

  • The date that results from adding the given timestamp to the given date.
    Type: Date

Examples


TIMEROUND('2006-01-01 01:02:31','H')='2006-01-01 01:00:00'


TIMEADD('2006-01-01 01:02:31','m')='2006-01-01 01:03:00'


TIMEADD('2006-11-24 00:00:00','M','up')='2006-12-01 00:00:00'


TIMEADD('2006-11-24 12:32:31','D','down')='2006-11-01 00:00:00'

TIMESTAMP (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2024 OR LATER. Use Time:EpochMilli instead. Convert a date to milliseconds. If there is no argument, the function will use the current date.

Signature


TIMESTAMP($date) : Long

Parameters

  • $date (optional)
    A date to convert.
    Type: Date
    Example: NOW()

Return Value

  • The date converted to milliseconds.
    Type: Long

Examples


TIMESTAMP() = 1185367219500


TIMESTAMP('2000-01-01') = 946681200000

TOBOOLEAN

Convert the given argument to boolean.

Signature


TOBOOLEAN($string) : Boolean

Parameters

  • $string (mandatory)
    String to be converted to boolean.
    Type: Any
    Example: 'true'

Return Value

  • Convert the given argument to boolean; returns true if argument is 'true', false for all other strings.
    Type: Boolean

Examples


TOBOOLEAN('true')=true


TOBOOLEAN('anything_else')=false

TODATE

Convert a string or a number to a date. A number is interpreted as milliseconds timestamp, a string is parsed using the known date patterns.

Signature


TODATE($value) : Date

Parameters

  • $value (mandatory)
    String or number to be converted to date.
    Type: Number
    Example: '6/24/07'

Return Value

  • Convert the given argument to date.
    Type: Date

Examples


TODATE('6/24/07') = 2007-06-24

TODAY

Returns the current date, not including the current time (set to 00:00:00).

Signature


TODAY() : Date

Parameters
None
Return Value

  • Returns the current date, not including the current time (set to 00:00:00).
    Type: Date

Examples

TODAY()

TODOUBLE

Convert the argument to a real number.

Signature


TODOUBLE($argument) : Double

Parameters

  • $argument (mandatory)
    To be converted to a real number.
    Type: Any
    Example: '1.0'

Return Value

  • Convert the given argument to a real number.
    Type: Double

Examples


TODOUBLE('1.0')=1.0


TODOUBLE(5)=5.0

ToIndexed

Convert a Java Collection, List, Set, Array, Iterator, Iterable or Enumeration to an Indexed Collection. If the supplied collection is null, null is returned.

Signature


ToIndexed($collection , $type) : Any:indexed

Parameters

  • $collection (mandatory)
    Java Collection, List, Set, Array, Iterator, Iterable or Enumeration.
    Type: java.util.Collection
    Example: $collection
  • $type (optional)
    Type of values, default is 'Any'.
    Type: Any
    Example: 'Any'

Return Value

  • Indexed Collection.
    Type: Any:indexed

Examples

ToIndexed($map)

TOINTEGER

Convert the argument to a natural number.

Signature


TOINTEGER($argument) : Integer

Parameters

  • $argument (mandatory)
    To be converted to a natural number. Make sure it is a full nummber. If it is not, convert to Double first, then ROUND, then convert to Integer.
    Type: Any
    Example: '1.0'

Return Value

  • Convert the argument to a natural number.
    Type: Integer

Examples


TOINTEGER('1.0')=1


TOINTEGER(2.0)=2

ToJSON

Convert the given entity into a JSON string.

Signature


ToJSON($entity , $formatPattern) : String

Parameters

  • $entity (mandatory)
    To be converted to JSON.
    Type: Any
    Example: $entity
  • $formatPattern (optional)
    Format pattern map for Number ("##0. 00"), Date ("dd-MM-yyyy") and Boolean ("true|false") types.
    Type: String:mapped
    Example: {'Person.dob'='dd-MMM-yyyy', 'Person.age'='###0', 'Date'='yyyy/MM/dd', 'Boolean'='yes|no'}

Return Value

  • Convert the given entity into a JSON string.
    Type: String

Examples

ToJSON($entity)

TOLIST (Deprecated)

Convert a DataArray to a list. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2023 OR LATER.

Signature


TOLIST($dataArray , $keysOrValues) : java.util.List

Parameters

  • $dataArray (mandatory)
    The data array to be converted to a list.
    Type: Any:indexed
    Example: $tmp.addresses
  • $keysOrValues (optional)
    In case of a DataMap: create a list of the keys or the values.
    Type: String
    Example: keys

Return Value

  • Convert the given DataArray to a list, changes to the list will not be reflected in the array, changes to elements will be reflected!
    Type: java.util.List

Examples


TOLIST($tmp.addresses)=[...]

TOLONG

Convert the argument to a natural number.

Signature


TOLONG($argument) : Long

Parameters

  • $argument (mandatory)
    To be converted to a natural number. Make sure it is a full nummber. If it is not, convert to Double first, then ROUND, then convert to Long.
    Type: Any
    Example: '1.0'

Return Value

  • Convert the argument to a natural number.
    Type: Long

Examples


TOLONG('1.0')=1


TOLONG(2.0)=2

ToMoney

Convert a number into an amount of money. If no currency is specified, the default currency 'USD' is used. Currencies are identified by their ISO 4217 currency codes.

Signature


ToMoney($amount , $currency) : Money

Parameters

  • $amount (mandatory)
    Amount.
    Type: Number
    Example: 19.99
  • $currency (optional)
    Currency.
    Type: String
    Example: 'USD'

Return Value

  • Money.
    Type: Money

Examples


ToMoney(19.99) = 'USD 19.99'


ToMoney(123.45, 'CHF') = 'CHF 123.45'

ToNamed (Deprecated)

Convert a Java Map to an Named Collection. All Map keys will be converted to a String. 'null' keys will be ignored. THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2023 OR LATER.

Signature


ToNamed($map , $type) : Any:mapped

Parameters

  • $map (mandatory)
    Java Map.
    Type: java.util.Map
    Example: $map
  • $type (optional)
    Type of values, default is 'Any'.
    Type: String
    Example: 'Any'

Return Value

  • Named Collection.
    Type: Any:mapped

Examples

ToNamed($map)

ToSqlDate

Convert the argument to a Sql Date.

Signature


ToSqlDate($argument) : java.sql.Date

Parameters

  • $argument (mandatory)
    To be converted to a Sql Date.
    Type: Any
    Example: NOW()

Return Value

  • Convert the argument to a Sql Date.
    Type: java.sql.Date

Examples

ToSqlDate(NOW())

ToSqlTime

Convert the argument to a Sql Time.

Signature


ToSqlTime($argument) : java.sql.Time

Parameters

  • $argument (mandatory)
    To be converted to a Sql Time.
    Type: Any
    Example: NOW()

Return Value

  • Convert the argument to a Sql Time.
    Type: java.sql.Time

Examples

ToSqlTime(NOW())

ToSqlTimestamp

Convert the argument to a Sql Timestamp.

Signature


ToSqlTimestamp($argument) : java.sql.Timestamp

Parameters

  • $argument (mandatory)
    To be converted to a Sql Timestamp.
    Type: Any
    Example: NOW()

Return Value

  • Convert the argument to a Sql Timestamp.
    Type: java.sql.Timestamp

Examples

ToSqlTimestamp(NOW())

TOSTRING

Convert the given argument to a string.

Signature


TOSTRING($object) : String

Parameters

  • $object (mandatory)
    Any object to be converted to string.
    Type: Any
    Example: something

Return Value

  • Convert the given argument to a string.
    Type: String

Examples


TOSTRING(1.2)='1.2'

TracingEnter

Open a new tracing scope. Don't forget to call TracingExit() in a Finally clause!

Signature


TracingEnter($string) : Boolean

Parameters

  • $string (mandatory)
    Tracing id.
    Type: String
    Example: 'GenerateReport'

Return Value

  • Tracing status.
    Type: Boolean

Examples

TracingEnter('GenerateReport')

TracingExit

Close current tracing scope. Use this function only if you have called TracingEnter('<Id>') before!

Signature


TracingExit() : Nothing

Parameters
None
Return Value

  • Type: Nothing

Examples

TracingExit()

TransformImage

Apply an affine transformation to an image. Supported input formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP. Supported output formats: BMP, GIF, JPEG, JPG, PNG, TIF, TIFF, WBMP.

Signature


TransformImage($file1 , $file2 , $matrix , $width , $height) : Nothing

Parameters

  • $file1 (mandatory)
    Input image file path.
    Type: String
    Example: 'uploads/image021.jpg'
  • $file2 (mandatory)
    Output image file path (pass null to overwrite input file).
    Type: String
    Example: 'uploads/logo.jpg'
  • $matrix (mandatory)
    Transformation matrix.
    Type: Transformation
    Example: $matrix
  • $width (optional)
    Image width.
    Type: Integer
    Example: 200
  • $height (optional)
    Image height.
    Type: Integer
    Example: 100

Return Value

  • Type: Nothing

Examples

TransformImage($file1, $file2, $transformation, 200, 100)

TRANSLATE

Translate the given text to the given language.

Signature


TRANSLATE($text , $language) : String

Parameters

  • $text (mandatory)
    The text that must be translated.
    Type: String
    Example: 'text'
  • $language (mandatory)
    The language to which the text should be translated.
    Type: String
    Example: 'de'

Return Value

  • Translates the given text to the given language.
    Type: String

Examples


TRANSLATE('[LABEL:helloLabel]','de') = 'Guten Tag'

TRIM

Remove all leading and trailing whitespaces from a string.

Signature


TRIM($string) : String

Parameters

  • $string (mandatory)
    String to be trimmed.
    Type: String
    Example: ' hello '

Return Value

  • String without whitespaces.
    Type: String

Examples


TRIM(' hello  ') = 'hello'

TypeOf

Get the type of the given expression.

Signature


TypeOf($expression , $fromDefinition) : com.nm.sdk.data.expeval.TypeInfo

Parameters

  • $expression (mandatory)
    The expression whose type must be returned.
    Type: Any
    Example: $collection[1].bla
  • $fromDefinition (mandatory)
    If this is true the type will be inferred from the data class definition, otherwise from the actual evaluated type.
    Type: Boolean
    Example: true

Return Value

  • Get the type of the given expression.
    Type: com.nm.sdk.data.expeval.TypeInfo

Examples

TypeOf($collection[1].bla, true)

UID

Generates a unique id based on a counter that has been initialized with the system startup time.

Signature


UID() : String

Parameters
None
Return Value

  • A UId.
    Type: String

Examples


UID() = '1185367219500'

UNESCAPEHTML

Unescape HTML special characters.

Signature


UNESCAPEHTML($string) : String

Parameters

  • $string (mandatory)
    The text to be unescaped.
    Type: String
    Example: '&lt;b&gt;hello&lt;/b&gt;'

Return Value

  • Unescape HTML special characters.
    Type: String

Examples


UNESCAPEHTML('5 > 3')='5 > 3'


UNESCAPEHTML('<b>hello</b>')='hello'

UNEVAL

Evaluate the argument as an Expression and return this evaluated argument's result.

Signature


UNEVAL($object) : String

Parameters

  • $object (mandatory)
    An Expression that is to be evaluated.
    Type: com.nm.sdk.data.expeval.Pointer
    Example: '1+2'

Return Value

  • The result of the evaluated argument.
    Type: String

Examples


EVAL('1+2')=3


EVAL(EVAL('1+2'))=3

UnexcludeFromNotificationSubscription

Unexclude the given user from the subscription of a group/role to the given topic via the given channel. If no delivery channel is supplied, the unexclusion will affect the Appway delivery channel.

Signature


UnexcludeFromNotificationSubscription($userId , $subscriberId , $topic , $deliveryChannelId) : Nothing

Parameters

  • $userId (mandatory)
    The Id of the user to unexclude from the subscription.
    Type: String
    Example: USERID()
  • $subscriberId (mandatory)
    The Id of the group/role from whose subscription to unexclude the given user.
    Type: String
    Example: 'GROUP:accountManagersUSA'
  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'new-american-client'
  • $deliveryChannelId (optional)
    The Id of the notification delivery channel. Default is 'appway'.
    Type: String
    Example: 'appway'

Return Value

  • Unexclude the given user from the subscription of a group/role to the given topic via the given channel. If no delivery channel is supplied, the unexclusion will affect the Appway delivery channel.
    Type: Nothing

Examples

UnexcludeFromNotificationSubscription(USERID(), 'GROUP:accountManagersUSA', 'new-american-client')

UNION

Calculate the union of two indexed collections.

Signature


UNION($collection , $collection) : Any:indexed

Parameters

  • $collection (mandatory)
    Collection.
    Type: Any:indexed
    Example: $collection1
  • $collection (mandatory)
    Collection.
    Type: Any:indexed
    Example: $collection2

Return Value

  • Union of two indexed collections.
    Type: Any:indexed

Examples

UNION($collection1, $collection2)

UNIQUE

Collection without duplicate entries.

Signature


UNIQUE($collection) : Any:indexed

Parameters

  • $collection (mandatory)
    Collection.
    Type: Any:indexed
    Example: $collection

Return Value

  • Collection without duplicate entries.
    Type: Any:indexed

Examples

UNIQUE($collection)

UnsubscribeFromNotifications

Unsubscribe a previously subscribed user/group/role from the given topic via the given delivery channel. If no delivery channel is supplied, the subscriber will be unsubscribed from receiving notifications with the given topic via the default Appway delivery channel. To exclude a user from the subscription of a group/role, please use ExcludeFromNotificationSubscription.

Signature


UnsubscribeFromNotifications($subscriberId , $topic , $deliveryChannelId) : Nothing

Parameters

  • $subscriberId (mandatory)
    The Id of the user/group/role to unsubscribe.
    Type: String
    Example: 'GROUP:accountManagersUSA'
  • $topic (mandatory)
    The Id of the topic.
    Type: String
    Example: 'new-american-client'
  • $deliveryChannelId (optional)
    The Id of the notification delivery channel from which to unsubscribe the given subscriber for the given topic. Default is 'appway'.
    Type: String
    Example: 'appway'

Return Value

  • Unsubscribe a previously subscribed user/group/role from the given topic via the given delivery channel. If no delivery channel is supplied, the subscriber will be unsubscribed from receiving notifications with the given topic via the default Appway delivery channel. To exclude a user from the subscription of a group/role, please use ExcludeFromNotificationSubscription.
    Type: Nothing

Examples

UnsubscribeFromNotifications('GROUP:accountManagersUSA', 'new-american-client')

Unwrap

Unwrap the given object.

Signature


Unwrap($entity , $unwrapDataValues , $unwrapDataStructures , $unwrapCollections) : Any

Parameters

  • $entity (mandatory)
    The entity to be unwrapped.
    Type: com.nm.sdk.data.dataitems.DataEntity
    Example: $x
  • $unwrapDataValues (mandatory)
    Indicates that data values should be unwrapped.
    Type: Boolean
    Example: true
  • $unwrapDataStructures (mandatory)
    Indicates that data structures should be unwrapped.
    Type: Boolean
    Example: false
  • $unwrapCollections (mandatory)
    Indicates that data collections should be unwrapped.
    Type: Boolean
    Example: true

Return Value

  • Unwrap the given object.
    Type: Any

Examples

Unwrap($entity, true, true, true)

Unzip

Extract the content of a ZIP file into a directory. The optional third parameter may be used to extract only a single file or sub-directory. If the target directory doesn't exist, it is created. Relative paths are treated as relative to the Data Home directory.

Signature


Unzip($zipFilePath , $directoryPath , $entryPath) : Integer

Parameters

  • $zipFilePath (mandatory)
    Path to ZIP file.
    Type: String
    Example: 'work/tmp/uploads/docs.zip'
  • $directoryPath (mandatory)
    Path to directory where the ZIP file is extracted.
    Type: String
    Example: 'work/tmp/docs'
  • $entryPath (optional)
    Path to file or directory inside ZIP file.
    Type: String
    Example: 'misc/faq.txt'

Return Value

  • Number of extracted files and directories.
    Type: Integer

Examples

Unzip('work/tmp/uploads/docs.zip', 'work/tmp/docs')

UpdateEncryptionKeyAlias

Define or Update a encryption-key-alias.

Signature


UpdateEncryptionKeyAlias($masterpassword , $aliasName , $encryptionKey , $callback , $executeCallbackGlobally) : String

Parameters

  • $masterpassword (mandatory)
    The current master password.
    Type: String
    Example: rumPelstilzChen
  • $aliasName (mandatory)
    The alias that must be updated with the new key.
    Type: String
    Example: 'emailPWS'
  • $encryptionKey (mandatory)
    The key that must be used for en-/decrypting.
    Type: String
    Example: 'secret!'
  • $callback (optional)
    Optional callback script function for handling encryption key changes, signature must be Handle(com.nm.utils.crypto.KeyChangeEvent $changeEvent)
    Type: String
    Example: 'Handle'
  • $executeCallbackGlobally (optional)
    Optional flag to signal whether the callback should be handled globally on all cluster nodes or locally on this particular node. Default is false.
    Type: Boolean
    Example: false

Return Value

  • Define or Update a encryption-key-alias.
    Type: String

Examples

UpdateEncryptionKeyAlias('masterpassword', 'aliasName', 'encryptionKey')

UpdateProcessInstance

Update a Process Instance.

Signature


UpdateProcessInstance($processInstanceId , $timestamp) : Nothing

Parameters

  • $processInstanceId (mandatory)
    Process Instance Id.
    Type: String
    Example: '129409273901'
  • $timestamp (optional)
    Time at which the Process Instance should be updated.
    Type: Long
    Example: TIMESTAMP()

Return Value

  • Type: Nothing

Examples

UpdateProcessInstance('129409273901')

UpdateUser (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:Update instead.

Signature


UpdateUser($user) : Nothing

Parameters

  • $user (mandatory)
    The user to be updated.
    Type: User
    Example: USER()

Return Value

  • Update the user.
    Type: Nothing

UPPERCASE

Convert all of the characters in the String to upper case.

Signature


UPPERCASE($string) : String

Parameters

  • $string (mandatory)
    The string.
    Type: String
    Example: 'hello'

Return Value

  • Converts all of the characters in the String to upper case.
    Type: String

Examples


UPPERCASE('hello')='HELLO'

USER (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:Get instead.

Signature


USER($userId) : User

Parameters

  • $userId (optional)
    The user's Id or null to get the current user.
    Type: String
    Example: null

Return Value

  • Get the current or a specific User.
    Type: User

Examples

USER($userId)

User:AddToPhysicalGroup

Adds a User to a Physical Group. The User must exist. By default, the Physical Group must exist, unless the parameter 'createIfNotExists' is set to 'true'.

Signature


User:AddToPhysicalGroup($physicalGroupId , $userId , $createIfNotExists) : Nothing

Parameters

  • $physicalGroupId (mandatory)
    Physical Group ID to which the user will be added (ID will be trimmed).
    Type: String
    Example: 'Advisor'
  • $userId (mandatory)
    User ID to be added. The User must exist.
    Type: String
    Example: 'john.doe'
  • $createIfNotExists (optional)
    Creates the Physical Group if it does not yet exist. Default: false.
    Type: Boolean
    Example: true

Return Value

  • Type: Nothing

Examples

User:AddToPhysicalGroup('Advisor', 'john.doe')

User:AddUser

Adds a User to the system.

Signature


User:AddUser($user) : Nothing

Parameters

  • $user (mandatory)
    The user to be added.
    Type: User
    Example: User:AddUser()

Return Value

  • Adds a User to the system.
    Type: Nothing

User:CheckPassword

Hashes the given password and compares the result with the password hash stored for the given user.

Signature


User:CheckPassword($userId , $password) : Boolean

Parameters

  • $userId (mandatory)
    ID of a local user.
    Type: String
    Example: 'alice.smith'
  • $password (mandatory)
    Cleartext password to be hashed and checked.
    Type: String
    Example: 'M8nFlow3rs$'

Return Value

  • Returns true if the password hashes match, and false otherwise.
    Type: Boolean

Examples

User:CheckPassword('alice.smith', 'M8nFlow3rs$')

User:Create

Creates a User object. This function does not add a created user to the system. Use User:AddUser function for this.

Signature


User:Create($userId) : User

Parameters

  • $userId (mandatory)
    The userId of the user to be created.
    Type: String
    Example: 'testUserId'

Return Value

  • Creates a User object. This function does not add a created user to the system. Use User:AddUser function for this.
    Type: User

Examples

User:Create('userId')

User:CreatePhysicalGroup

Creates a Physical Group. The Group is created empty.

Signature


User:CreatePhysicalGroup($physicalGroupId) : Nothing

Parameters

  • $physicalGroupId (mandatory)
    ID for the Physical Group to be created (ID will be trimmed).
    Type: String
    Example: 'Advisor'

Return Value

  • Type: Nothing

Examples

User:CreatePhysicalGroup('Advisor')

User:CreateVirtualGroup

Creates a Virtual Group based on the specified Virtual Group Definition.

Signature


User:CreateVirtualGroup($virtualGroupId , $virtualGroupDefinition) : Nothing

Parameters

  • $virtualGroupId (mandatory)
    ID of the Virtual Group to be created (ID will be trimmed).
    Type: String
    Example: 'Company1Advisor'
  • $virtualGroupDefinition (mandatory)
    Definition of the Virtual Group based on Virtual Group Definition syntax. If the Definition is invalid, the function call will fail.
    Type: String
    Example: '(GROUP:Company1 + GROUP:Advisor)'

Return Value

  • Type: Nothing

Examples

User:CreateVirtualGroup('Company1Advisor', '(GROUP:Company1 | GROUP:Advisor)')

User:CurrentUserGetFirstName

Get the current user's first name.

Signature


User:CurrentUserGetFirstName() : String

Parameters
None
Return Value

  • Get the current user's first name.
    Type: String

Examples

User:CurrentUserGetFirstName()

User:CurrentUserGetId

Get the current user's id.

Signature


User:CurrentUserGetId() : String

Parameters
None
Return Value

  • Get the current user's id.
    Type: String

Examples

User:CurrentUserGetId()

User:CurrentUserGetLastName

Get the current user's last name.

Signature


User:CurrentUserGetLastName() : String

Parameters
None
Return Value

  • Get the current user's last name.
    Type: String

Examples

User:CurrentUserGetLastName()

User:CurrentUserIsInGroup

Test if the current user is in the given group.

Signature


User:CurrentUserIsInGroup($group) : Boolean

Parameters

  • $group (mandatory)
    The name of the group.
    Type: String
    Example: 'group'

Return Value

  • Test if the current user is in the given group.
    Type: Boolean

Examples

User:CurrentUserIsInGroup('group')

User:CurrentUserIsInRole

Test if the current user is in the given role.

Signature


User:CurrentUserIsInRole($role) : Boolean

Parameters

  • $role (mandatory)
    The role name.
    Type: String
    Example: 'Administrator'

Return Value

  • Test if the current user is in the given role.
    Type: Boolean

Examples

User:CurrentUserIsInRole('Administrator')

User:CurrentUserListGroupIds

Get the list of groups the current user belongs to.

Signature


User:CurrentUserListGroupIds() : String:indexed

Parameters
None
Return Value

  • Get the list of groups the current user belongs to.
    Type: String:indexed

Examples

User:CurrentUserListGroupIds()

User:CurrentUserListRoleIds

Get the current user's list of roles.

Signature


User:CurrentUserListRoleIds() : String:indexed

Parameters
None
Return Value

  • Get the current user's list of roles.
    Type: String:indexed

Examples

User:CurrentUserListRoleIds()

User:Delete

Delete the user with the given User ID.

Signature


User:Delete($userId) : Nothing

Parameters

  • $userId (mandatory)
    The User ID of the user to be deleted.
    Type: String
    Example: 'testUserId'

Return Value

  • Delete the user with the given User ID.
    Type: Nothing

User:DeleteGroup

Deletes an existing Physical or Virtual Group, given its Group ID.

Signature


User:DeleteGroup($groupId) : Nothing

Parameters

  • $groupId (mandatory)
    Group ID to be deleted (ID will be trimmed).
    Type: String
    Example: 'Advisor'

Return Value

  • Type: Nothing

Examples

User:DeleteGroup('Advisor')

User:Get

Get the current or a specific User.

Signature


User:Get($userId) : User

Parameters

  • $userId (optional)
    The user's Id or null to get the current user.
    Type: String
    Example: null

Return Value

  • Get the current or a specific User.
    Type: User

Examples

User:Get($userId)

User:GetAllGroups

Retrieves all the available User Groups in the system.

Signature


User:GetAllGroups() : String:indexed

Parameters
None
Return Value

  • Type: String:indexed

Examples

User:GetAllGroups()

User:GetAllPermissions

Retrieves all the Permissions and the associated Permission levels available in the system. Note: Permission Caps (if any) are taken into account.

Signature


User:GetAllPermissions() : Any:mapped

Parameters
None
Return Value

  • Returns Named Collection of Indexed String, e.g. {'ManageUsers'=['FULL_ACCESS', 'READ_ONLY', 'NONE'], 'TraceHttpSessions'=['FULL_ACCESS', 'NONE'], 'ManageWebServices'=['FULL_ACCESS', 'NONE'],.}.
    Type: Any:mapped

Examples

User:GetAllPermissions()

User:GetAllRoles

Retrieves all the available User Roles in the system.

Signature


User:GetAllRoles() : String:indexed

Parameters
None
Return Value

  • Type: String:indexed

Examples

User:GetAllRoles()

User:GetPermissionsForRole

Retrieves the Permissions and the associated Permission level assigned to a given Role. Note: Permission Caps (if any) are taken into account.

Signature


User:GetPermissionsForRole($role) : String:mapped

Parameters

  • $role (mandatory)
    The role.
    Type: String
    Example: 'Administrator'

Return Value

  • Type: String:mapped

Examples

User:GetPermissionsForRole('Administrator')

User:GetReadOnly

Get the current or a specific User for reading only.

Signature


User:GetReadOnly($userId) : User

Parameters

  • $userId (optional)
    The user's Id or null to get the current user.
    Type: String
    Example: 'testUserId'

Return Value

  • Get the current or a specific User for reading only.
    Type: User

Examples

User:GetReadOnly('userId')

User:HashPassword

Returns the hash of a password.

Signature


User:HashPassword($password) : String

Parameters

  • $password (mandatory)
    The cleartext password to be hashed.
    Type: String
    Example: 'mySecretPass'

Return Value

  • Returns the hash of a password.
    Type: String

Examples

User:HashPassword('mySecretPass')

User:IsInGroup

Check if the given user is member of the given Physical or Virtual Group.

Signature


User:IsInGroup($userId , $groupId) : Boolean

Parameters

  • $userId (mandatory)
    User ID to check.
    Type: String
    Example: 'john.doe'
  • $groupId (mandatory)
    Group ID to check.
    Type: String
    Example: 'Advisor'

Return Value

  • Returns true if the given user is a member of the given group.
    Type: Boolean

Examples

UserIsInGroup('john.doe', 'Advisor')

User:ListGroupIds

Returns the list of groups the user belongs to.

Signature


User:ListGroupIds($user) : String:indexed

Parameters

  • $user (mandatory)
    The user whose groups has to be returned.
    Type: User
    Example: User:Get()

Return Value

  • Returns the list of groups the user belongs to.
    Type: String:indexed

Examples

User:ListGroupIds(User:Get())

User:ListIds

Get the IDs of all users matching the given predicate. Return the IDs of all users if no predicate is given.

Signature


User:ListIds($userPredicate) : String:indexed

Parameters

  • $userPredicate (optional)
    The predicate for the user search. The IDs of all users matching the given predicate are returned.
    Type: UserPredicate
    Example: See below.

Return Value

  • Get the IDs of all users matching the given predicate. Return the IDs of all users if no predicate is given.
    Type: String:indexed

Examples

UserPredicate $up := new UserPredicate;
$up.setRoles(['Administrator', 'User']:String);
User:ListIds($up);

User:ListLocalIds

Returns the list of local user IDs on this node.

Signature


User:ListLocalIds() : String:indexed

Parameters
None
Return Value

  • Returns the list of local user IDs on this node.
    Type: String:indexed

Examples

User:ListLocalIds()

User:ListRoleIds

Returns the list of roles the user belongs to.

Signature


User:ListRoleIds($user) : String:indexed

Parameters

  • $user (mandatory)
    The user whose roles has to be returned.
    Type: User
    Example: USER()

Return Value

  • Returns the list of roles the user belongs to.
    Type: String:indexed

Examples

User:ListRoleIds(USER())

User:RemoveFromPhysicalGroup

Removes a User from a Physical Group. The User must exist. By default, an empty Physical Group is not deleted, unless the parameter 'removeIfEmpty' is set to 'true'.

Signature


User:RemoveFromPhysicalGroup($physicalGroupId , $userId , $removeIfEmpty) : Nothing

Parameters

  • $physicalGroupId (mandatory)
    Physical Group ID from which the user will be removed from (ID will be trimmed).
    Type: String
    Example: 'Advisor'
  • $userId (mandatory)
    User ID to be removed. The User must exist.
    Type: String
    Example: 'john.doe'
  • $removeIfEmpty (optional)
    Remove Physical Group if empty. Default: false.
    Type: Boolean
    Example: true

Return Value

  • Type: Nothing

Examples

User:RemoveFromPhysicalGroup('Advisor', 'john.doe')

User:SetPermissionToRole

Sets the Permission to the Role. Requires 'Administrator' Role and 'Users/Groups/Roles - Full Access' Permission. Note: Permission Caps (if any) are taken into account.

Signature


User:SetPermissionToRole($role , $permission , $level) : Nothing

Parameters

  • $role (mandatory)
    The role.
    Type: String:none
    Example: 'Administrator'
  • $permission (mandatory)
    The permission to set.
    Type: String:none
    Example: 'ManagePackages'
  • $level (mandatory)
    The permission level.
    Type: String:none
    Example: 'NONE'
    'READ_ONLY'
    'FULL_ACCESS'

Return Value

  • Type: Nothing

Examples

User:SetPermissionToRole('Administrator', 'ManagePackages', 'FULL_ACCESS')

User:Update

Update the user.

Signature


User:Update($user) : Nothing

Parameters

  • $user (mandatory)
    The user to be updated.
    Type: User
    Example: USER()

Return Value

  • Update the user.
    Type: Nothing

User:UpdateVirtualGroupDefinition

Updates the Group Definition of an existing Virtual Group.

Signature


User:UpdateVirtualGroupDefinition($virtualGroupId , $virtualGroupDefinition) : Nothing

Parameters

  • $virtualGroupId (mandatory)
    ID of the Virtual Group to be updated (ID will be trimmed).
    Type: String
    Example: 'Company1Advisor'
  • $virtualGroupDefinition (mandatory)
    Updated Virtual Group Definition based on Virtual Group Definition syntax. If the Definition is invalid, the function call will fail.
    Type: String
    Example: '(GROUP:Company1 + GROUP:Advisor)'

Return Value

  • Type: Nothing

Examples

User:UpdateVirtualGroupDefinition('Company1Advisor', '(GROUP:Company1 | GROUP:Advisor)')

UserAddToGroup (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use User:AddToPhysicalGroup instead. Add a user to a group. The user has to exist; The group will be created if needed.

Signature


UserAddToGroup($userId , $groupId) : Nothing

Parameters

  • $userId (mandatory)
    User ID to add.
    Type: String
    Example: someUser1
  • $groupId (mandatory)
    Group ID to which the user should be added (ID will be trimmed).
    Type: String
    Example: someGroupA

Return Value

  • Nothing.
    Type: Nothing

Examples

UserAddToGroup($userId, $groupId)

USERFIRSTNAME (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:CurrentUserGetFirstName instead.

Signature


USERFIRSTNAME() : String

Parameters
None
Return Value

  • Get the current user's first name.
    Type: String

Examples

USERFIRSTNAME()

UserGetGroupIds (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use User:ListGroupIds instead. Get the list of Physical or Virtual Group IDs the given user is member of.

Signature


UserGetGroupIds($userId) : String:indexed

Parameters

  • $userId (mandatory)
    User ID used to query group membership IDs.
    Type: String
    Example: 'john.doe'

Return Value

  • Returns the IDs of the groups the given user is member of.
    Type: String:indexed

Examples

UserGetGroupIds('john.doe')

USERGROUPS (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:CurrentUserListGroupIds instead.

Signature


USERGROUPS() : String:indexed

Parameters
None
Return Value

  • Get the list of groups the current user belongs to.
    Type: String:indexed

Examples

USERGROUPS()

USERID (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:CurrentUserGetId instead.

Signature


USERID() : String

Parameters
None
Return Value

  • Get the current user's id.
    Type: String

Examples

USERID()

USERIDS (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:ListIds instead.

Signature


USERIDS($userPredicate) : String:indexed

Parameters

  • $userPredicate (optional)
    The predicate for the user search. The IDs of all users matching the given predicate are returned.
    Type: UserPredicate
    Example: See below.

Return Value

  • Get the IDs of all users matching the given predicate. Return the IDs of all users if no predicate is given.
    Type: String:indexed

Examples

UserPredicate $up := new UserPredicate;
$up.setRoles(['Administrator', 'User']:String);
USERIDS($up);

USERINGROUP (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:CurrentUserIsInGroup instead.

Signature


USERINGROUP($group) : Boolean

Parameters

  • $group (mandatory)
    The name of the group.
    Type: String
    Example: 'group'

Return Value

  • Test if the current user is in the given group.
    Type: Boolean

Examples

USERINGROUP('group')

USERINROLE (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:CurrentUserIsInRole instead.

Signature


USERINROLE($role) : Boolean

Parameters

  • $role (mandatory)
    The role name.
    Type: String
    Example: 'Administrator'

Return Value

  • Test if the current user is in the given role.
    Type: Boolean

Examples

USERINROLE('Administrator')

UserIsInGroup (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use User:IsInGroup instead. Check if the given user is member of the given Physical or Virtual Group.

Signature


UserIsInGroup($userId , $groupId) : Boolean

Parameters

  • $userId (mandatory)
    User ID to check.
    Type: String
    Example: 'john.doe'
  • $groupId (mandatory)
    Group ID to check.
    Type: String
    Example: 'Advisor'

Return Value

  • Returns true if the given user is a member of the given group.
    Type: Boolean

Examples

UserIsInGroup('john.doe', 'Advisor')

USERLASTNAME (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 11 OR LATER. Use User:CurrentUserGetLastName instead.

Signature


USERLASTNAME() : String

Parameters
None
Return Value

  • Get the current user's last name.
    Type: String

Examples

USERLASTNAME()

UserRemoveFromGroup (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2025 OR LATER. Use User:RemoveFromPhysicalGroup instead. Remove a user from a Physical Group. The user has to exist; If the group does not exist, this method does nothing. If the group becomes empty after removing a user, the group will be removed as well.

Signature


UserRemoveFromGroup($userId , $groupId) : Nothing

Parameters

  • $userId (mandatory)
    User ID to remove.
    Type: String
    Example: someUser1
  • $groupId (mandatory)
    Group ID from which to remove the user (ID will be trimmed).
    Type: String
    Example: someGroupA

Return Value

  • Nothing.
    Type: Nothing

Examples

UserRemoveFromGroup($userId, $groupId)

USERROLES (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN 2022 OR LATER. Use User:CurrentUserListRoleIds instead.

Signature


USERROLES() : String:indexed

Parameters
None
Return Value

  • Get the current user's list of roles.
    Type: String:indexed

Examples

USERROLES()

USERS (Deprecated)

THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED WITH APPWAY 10 OR LATER. Use the User:ListIds together with the User:Get or User:GetReadOnly function.

Signature


USERS($userPredicate) : User:indexed

Parameters

  • $userPredicate (optional)
    The predicate for the user search. All users matching the given predicate are returned.
    Type: UserPredicate
    Example: See below.

Return Value

  • Get all users matching the given predicate. Return all users if no predicate is given.
    Type: User:indexed

Examples

UserPredicate $up := new UserPredicate;
$up.setRoles(['Administrator', 'User']:String);
USERS($up);

UseSSLAlias

Signature


UseSSLAlias($alias) : Nothing

Parameters

  • $alias (mandatory)
    The alias to be used for post or get.
    Type: String
    Example: crm_service

Return Value

  • Type: Nothing

Examples

UseAlias('crm_service')

UseValuestoreRO

Use the read-only valuestore for execution of the given function.

Signature


UseValuestoreRO($workflowInstanceId , $tokenId , $expression , $values) : Any

Parameters

  • $workflowInstanceId (mandatory)
    The workflow instance id.
    Type: String
    Example: '133245342534'
  • $tokenId (mandatory)
    The token id.
    Type: String
    Example: '56787'
  • $expression (mandatory)
    The expression to be evaluated in the given context.
    Type: Any
    Example: $xyz!=null
  • $values (optional)
    Values for parameters.
    Type: Any:mapped
    Example: $map

Return Value

  • Use the read-only valuestore for execution of the given function.
    Type: Any

Examples

UseValuestoreRO($workflowInstanceId, $tokenId, $expression)

UUID

Generates a universal unique id based on a random 128-bit hex encoded number.

Signature


UUID() : String

Parameters
None
Return Value

  • A UUID.
    Type: String

Examples


UUID() = '197aacfa-fa03-456a-b8ff-6fb3f936'

VALUES

Get all values in a named collection.

Signature


VALUES($collection) : Any:indexed

Parameters

  • $collection (mandatory)
    Named collection.
    Type: Any:mapped
    Example: $collection

Return Value

  • Return all values in a named collection.
    Type: Any:indexed

Examples

VALUES($collection)

VALUES(['name':'John';'street':'Hollywood Boulevard']) = ['John','Hollywood Boulevard']

ValueStore:AnalyzeIfSplittable

Function that analyzes a splittable value store. It will print the following information:

  • The size of the value store without detached data objects
  • The number of detached data objects
  • The size of the value store merged together with the detached data objects
  • For every data class, the number of instances of that data class, the total size and the average size of the instances
  • For every size range, the number of data objects with the size in that range and the total size
    Note: If this function is used on value stores which were previously accessed in read-only mode or which are being used in the current transaction, then the reported individual sizes might be incorrect.

Signature


ValueStore:AnalyzeIfSplittable($processInstanceId , $smallThresholdSizeInKB) : Any

Parameters

  • $processInstanceId (mandatory)
    The process instance id of the value store that must be analyzed.
    Type: String
    Example: $processInstanceId
  • $smallThresholdSizeInKB (optional)
    The size of the smaller threshold used to group the data objects. The large threshold used will be 10 times the small one so there will be three size ranges. Default small threshold is 10 KB.
    Type: Double
    Example: $smallThresholdSizeInKB

Return Value

  • Type: Any

Examples

ValueStore:AnalyzeIfSplittable($processInstanceId)

ValueStore:DebugNonSplittable

Function that checks if a Value Store is splittable or not. If the Value Store is not splittable, it will print the type and the id of the Data Entity that leads to not allowed links. This Data Entity will be surrounded by '*' to highlight it. It will also print the paths that lead to this Data Entity to be able to easily identify the data structures in the process.

Signature


ValueStore:DebugNonSplittable($processInstanceId) : Any

Parameters

  • $processInstanceId (mandatory)
    The Process Instance ID of the Value Store that must be debugged.
    Type: String
    Example: $processInstanceId

Return Value

  • Returns details about the given Value Store, if it is splittable or not.
    Type: Any

Examples

ValueStore:DebugNonSplittable($valueStoreId)

ValueStore:Merge

Function which merges data entities which were detached back into the value store. Note: Once a value store has been merged using this function it can never be split again.

Signature


ValueStore:Merge($processInstanceId) : Any

Parameters

  • $processInstanceId (mandatory)
    The process instance id of the value store that must be merged.
    Type: String
    Example: $processInstanceId

Return Value

  • Returns true if the value store has been merged successfully. It will always merge the detached entities regardless if value store splitting is enabled or not.
    Type: Any

Examples

ValueStore:Merge($processInstanceId)

ValueStore:MergeAllLocalValueStores

Function which merges all the detached Data Entities back into the Value Stores. Note: Once the Value Stores have been merged using this function, they can never be split again.

Signature


ValueStore:MergeAllLocalValueStores() : Boolean

Parameters
None
Return Value

  • Returns true if all the Value Stores have been merged successfully. It will always merge the detached Data Entities regardless if Value Store Splitting is enabled or not.
    Type: Boolean

Examples

ValueStore:MergeAllLocalValueStores()

VariablePointer

Returns a pointer to the given variable.

Signature


VariablePointer($variableName) : Any

Parameters

  • $variableName (mandatory)
    The name of the variable for which a pointer must be returned.
    Type: String
    Example: 'b'

Return Value

  • Returns a pointer to the given variable.
    Type: Any

Examples

VariablePointer('b')

VersionFilter

Get the current Version Filter or create a new Version Filter instance given a string-serialized Version Filter.

Signature


VersionFilter($string) : com.nm.sdk.data.businessobjects.versioning.VersionFilter

Parameters

  • $string (optional)
    Version Filter string.
    Type: String
    Example: 'HeadFilter'

Return Value

  • Version Filter.
    Type: com.nm.sdk.data.businessobjects.versioning.VersionFilter

Examples

VersionFilter()
VersionFilter('HeadFilter')

WINDOWSTATE

Returns the current Window State. If the function is not called in a Screen context, null is returned. If there is no Window State but argument 'create' is set to true, a new Window State is created and returned.

Signature


WINDOWSTATE($create) : WindowState

Parameters

  • $create (optional)
    If Window State doesn't exist, create it.
    Type: Boolean
    Example: false

Return Value

  • Window State.
    Type: WindowState

Examples

WINDOWSTATE()

WINDOWSTATEGET

Get the value of a Window State attribute by name. Returns null if the Window State doesn't exist.

Signature


WINDOWSTATEGET($name) : Any

Parameters

  • $name (mandatory)
    Attribute name.
    Type: String
    Example: 'language'

Return Value

  • Attribute value.
    Type: Any

Examples


WINDOWSTATEGET('language') = 'de'

WINDOWSTATESET

Set a Window State attribute. Returns true if the attribute has been set. Pass null as value to remove the attribute.

Signature


WINDOWSTATESET($name , $value) : Boolean

Parameters

  • $name (mandatory)
    Attribute name.
    Type: String
    Example: 'language'
  • $value (mandatory)
    Attribute value.
    Type: Any
    Example: 'de'

Return Value

  • Set an Window State attribute.
    Type: Boolean

Examples

WINDOWSTATESET('language', 'de')

WORKITEM

Get a Workitem by its Workitem Id and Process Instance Id. Omit the parameters if you want the current Workitem (only available in the context of a Process). Returns null if the Workitem doesn't exist.

Signature


WORKITEM($workitemId , $workflowInstanceId) : Workitem

Parameters

  • $workitemId (optional)
    Workitem Id.
    Type: String
    Example: '1023123121'
  • $workflowInstanceId (optional)
    Process Instance Id.
    Type: String
    Example: '1022536273'

Return Value

  • Workitem.
    Type: Workitem

Examples

WORKITEM('1023123121', '1022536273')

WORKLIST

Get Worklist for a User or a Queue. If there is no parameter, the Worklist of the current user is returned. If the user is not authenticated, an empty list is returned. If null is passed as argument, all Workitems will be returned.

Signature


WORKLIST($queueName , $workflowInstanceId) : Workitem:indexed

Parameters

  • $queueName (optional)
    Queue name (e.g. a user id).
    Type: String
    Example: 'GROUP:ComplianceOfficers'
  • $workflowInstanceId (optional)
    Process Instance Id.
    Type: String
    Example: $workflowInstanceId

Return Value

  • Get Worklist for a User or a Queue.
    Type: Workitem:indexed

Examples

WORKLIST()

WriteBinaryData

The path to the file, relative to the datahome folder.

Signature


WriteBinaryData($filepath , $base64Data , $append) : String

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'work/tmp/mydatafile.bin'
  • $base64Data (mandatory)
    The data string base64 encoded.
    Type: String
    Example: 'asdfasdfasdfa453'
  • $append (optional)
    A flag indicating whether a new file should be opened (false, default) or the data should be appended (true).
    Type: Boolean
    Example: true

Return Value

  • The path to the file, relative to the datahome folder.
    Type: String

Examples

WriteBinaryData($filepath, $base64Data, $append)

WRITECLUSTERFILE

Write the given string into a cluster file at the given path. An already existing file at this location is overwritten.

Signature


WRITECLUSTERFILE($filepath , $data , $encoding) : Nothing

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'foo/bar/thefile.txt'
  • $data (mandatory)
    The content of the file to be written.
    Type: String
    Example: 'This is the file content.'
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'

Return Value

  • Write the given string into a cluster file at the given path. An already existing file at this location is overwritten.
    Type: Nothing

Examples

WRITECLUSTERFILE('foo/bar/thefile.txt', 'This is the file content.', 'UTF-8')

WriteProcessMessageFile

Save a Process Message as XML file.

Signature


WriteProcessMessageFile($filePath , $message) : Nothing

Parameters

  • $filePath (mandatory)
    Path to XML file.
    Type: String
    Example: 'work/tmp/message.xml'
  • $message (mandatory)
    Process Message.
    Type: WorkflowMessage
    Example: $message

Return Value

  • Nothing.
    Type: Nothing

Examples

WriteProcessMessageFile('work/tmp/message.xml', $message)

WRITEPROPERTIESFILE

Write a named collection of strings into a Java Properties file. If the file already exists, this function will overwrite it. Parent directories of the file are created as needed. Relative paths are interpreted relative to the Data Home.

Signature


WRITEPROPERTIESFILE($filepath , $map) : Boolean

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: 'content/file.properties'
  • $map (mandatory)
    A named collection containing strings.
    Type: String:mapped
    Example: $map

Return Value

  • Returns true if the operation was successful.
    Type: Boolean

Examples

WRITEPROPERTIESFILE('content/file.properties', $map)

WRITETEXTFILE

Write the given data to the given file. Relative paths are interpreted relative to the Data Home, use '{DATA_HOME}' to refere to the nm data home location.

Signature


WRITETEXTFILE($filepath , $data , $encoding , $append) : Nothing

Parameters

  • $filepath (mandatory)
    The path to the file.
    Type: String
    Example: '{DATA_HOME}/work/tmp/thefile.txt'
  • $data (mandatory)
    The data to be stored in the file.
    Type: String
    Example: 'some text'
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'
  • $append (optional)
    Append to an existing file? Default: 'false'.
    Type: Boolean
    Example: 'false'

Return Value

  • Write the given data to the given file.
    Type: Nothing

Examples

WRITETEXTFILE('{DATA_HOME}/work/tmp/thefile.txt', 'some text')

WRITETEXTRESOURCE

Write text to the given resource.

Signature


WRITETEXTRESOURCE($text , $resourceRef , $encoding , $commit , $mimeType , $metaData) : Nothing

Parameters

  • $text (mandatory)
    The text to be written.
    Type: String
    Example: 'some text'
  • $resourceRef (mandatory)
    The reference of the resource.
    Type: Resource:Reference
    Example: Resource:NewReference('GlobalCSS')
  • $encoding (optional)
    The encoding of the file, default is 'UTF-8'.
    Type: String
    Example: 'UTF-8'
  • $commit (optional)
    Indicates if the resource should be committed after reading (true) or not (false, default).
    Type: Boolean
    Example: Boolean
  • $mimeType (optional)
    The mime type of the entry.
    Type: String
    Example: 'text/plain'
  • $metaData (optional)
    Meta data attributes to be written to the resources meta data.
    Type: String:mapped
    Example: {'key'='value'}:String

Return Value

  • Write text to the given resource.
    Type: Nothing

Examples

WRITETEXTRESOURCE($text, Resource:NewReference('GlobalCSS'), 'UTF-8', $commit)

XmlToDataEntity

Create an dataentity from the given xml document.

Signature


XmlToDataEntity($doc) : Any

Parameters

  • $doc (mandatory)
    The xml document to be converted into a data entity.
    Type: XmlDocument
    Example: $doc

Return Value

  • Create an dataentity from the given xml document.
    Type: Any

Examples

XmlToDataEntity($doc)

XmlTransform

Create a transformed version of the given xml.

Signature


XmlTransform($xslt , $xml) : String

Parameters

  • $xslt (mandatory)
    The transformation.
    Type: String
    Example: $xslt
  • $xml (mandatory)
    The xml to be transformed.
    Type: String
    Example: xml

Return Value

  • Create a transformed version of the given xml.
    Type: String

Examples

XmlTransform($xslt, $xml)

XOR

Return true if exactly one of the arguments is true.

Signature


XOR($a , $b) : Boolean

Parameters

  • $a (mandatory)
    Boolean argument 1.
    Type: Boolean
    Example: true
  • $b (mandatory)
    Boolean argument 2.
    Type: Boolean
    Example: false

Return Value

  • Returns true if exactly one of the arguments is true.
    Type: Boolean

Examples


XOR(true,false)=true


XOR(true,true)=false


XOR(false,false,true)=true


XOR(true,false,true)=false

XPathQuery

Query a given XML document.

Signature


XPathQuery($document , $xpath , $returnType) : Any

Parameters

  • $document (mandatory)
    The XML document.
    Type: XmlDocument
    Example: $document
  • $xpath (mandatory)
    The xpath expression used for querying.
    Type: String
    Example: $xpath
  • $returnType (optional)
    The xpath return type [NODELIST|NODESET|NUMBER|BOOLEAN|STRING].
    Type: String
    Example: NODESET

Return Value

  • Query a given XML document.
    Type: Any

Examples

XPathQuery($document, $xpath)

Zip

Package the content of a directory in a ZIP file. Please note that the directory itself is not added to the ZIP file, only its content. If the target ZIP file already exists, it is overwritten. Relative paths are treated as relative to the Data Home directory.

Signature


Zip($directoryPath , $zipFilePath) : Integer

Parameters

  • $directoryPath (mandatory)
    Path to directory.
    Type: String
    Example: 'work/tmp/docs'
  • $zipFilePath (mandatory)
    Path to ZIP file.
    Type: String
    Example: 'work/tmp/docs.zip'

Return Value

  • Number of packaged files and directories.
    Type: Integer

Examples

Zip('work/tmp/docs', 'work/tmp/docs.zip')
Print Document

Abbreviate

ABS

ABSOLUTEPATH

AccessPolicyCheck

ACOS

ADD

AddClientKeyAlias

AddPrivateKey

ADDTOTESTDATA

AddTrustedCertificate

AND

APPENDTOTEXTFILE

AppTask:HasBlockingViolations

ASIN

ASSERT

ASSIGN

AssignWorkitemToUser

ATAN

Auth:CreateJwtEcSigned

Auth:CreateJwtHmacSigned

Auth:CreateJwtRsaSigned

Auth:DecodeJwt

Auth:DecryptJWT

Auth:EncryptJWT

Auth:GetJwtClaim

Auth:GetJwtClaimNames

Auth:HasJwtClaim

Auth:HasPassword

Auth:RemovePassword

Auth:RetrievePassword

Auth:StorePassword

Auth:ValidateJwtEcSigned

Auth:ValidateJwtHmacSigned

Auth:ValidateJwtRsaSigned

BBCode

BindingProxy

Blob:CopyBlobToLocalFile

Blob:CopyLocalFileToBlob

Blob:Delete

Blob:DeleteMetadata

Blob:DeleteTag

Blob:Exists

Blob:GetMetadata

Blob:GetTag

Blob:List

Blob:ListMetadata

Blob:ListTags

Blob:SetMetadata

Blob:SetTag

BuildDataClassScript

BusinessObject:Duplicate

BusinessObject:RefactorId

CacheClear

CacheLookup

CacheNames

CacheRemove

CacheStore

CallIntegrationLink

CallOracleProcedure

CancelProcessInstance

CapitalizeTitle

CAST

Catalog:NewReference

CatalogueDelete

CatalogueUpdate

CEIL

CHAR

CHECKACCESSLICENSE

CHECKSYNTAX

CLEANDIRECTORY

CLONE

Cluster:IsLocalKey

ClusterCache:Clear

ClusterCache:ExistsEntry

ClusterCache:Get

ClusterCache:GetEntry (Deprecated)

ClusterCache:ListEntryNames

ClusterCache:Put

ClusterCache:RemoveEntry

ClusterCache:StoreEntry (Deprecated)

CollectDependencies

Collection:AddAllElements

Collection:AddElement

Collection:ContainsElement

Collection:Difference

Collection:Filter

Collection:GetIndexOf

Collection:HasName

Collection:Intersection

Collection:LegacyGetIndexOfElement (Deprecated)

Collection:ListIndicesOf

Collection:ListNames

Collection:ListNamesOf

Collection:ListValues

Collection:Map

Collection:Merge

Collection:RemoveAllElements

Collection:RemoveElement (Deprecated)

Collection:RemoveElementAtIndex

Collection:RemoveElementFromIndexed

Collection:RemoveElementWithName

Collection:Reverse

Collection:SetElement (Deprecated)

Collection:SetElementAtIndex

Collection:SetElementWithName

Collection:Size

Collection:Sort

Collection:Union

CommitBusinessObject

CommitBusinessObjects

CommitProcessInstance

COMPONENTPATH

CompressFile

CONCAT

CONF

CONTAINS

CONTEXT (Deprecated)

CONTEXTPATH

ConvertImage

CopyBinaryDataToStream

COPYDIRECTORY

COPYFILE

CopyFileToStream

COS

CREATEDIRECTORY

CreateNotificationTopic

CreateProcessInstanceIndex

CREATEPROTOTYPE

CreateWorkflowToken

CreateXmlDocument

CropImage

CustomListById

CustomListChildren

CustomListContent

CustomListRoot

CustomProcessLogEntry (Deprecated)

CypherText (Deprecated)

DataClass:GetInstanceId

DataClass:NewReference

DataEntityDeepSearch

DataEntityToXml

DATAHANDLEURL

DataLogic:CreateAndEvaluateContext (Deprecated)

DataLogic:EvaluateControlsForPDF

DataLogic:EvaluateDataRules

DataLogic:EvaluateFilteredDataRules

DataLogic:HasDataRuleViolations

DataLogic:IsDataLogicContext (Deprecated)

DataLogic:NewReference

DATAPATH

DataRules:GetPhoneNumberCountry

DataRules:SetPhoneNumberCountry

DataTableModel

DATEADD (Deprecated)

DATECOMPARE

DATEFIELD

DATEFORMAT

DATEPARSE

DAYSSINCE

DECODETEXT

DecompressFile

DecryptText

DELETECLUSTERFILE

DELETEDIRECTORY

DELETEFILE

DeleteKey

DeleteNotificationTopic

DeleteProcessInstance

DeleteProcessInstanceIndex

DeleteWorkflowToken

DESERIALIZE

DIFFERENCE

DIR

DIRECTORYEXISTS

DIRECTORYSIZE

DIV

DIVV

DNSLookup

DNSReverseLookup

DocumentCategory:GetFromDocument

DocumentCategory:GetIconUrl

DocumentCategory:NewReference

DOCUMENTSETACTIONS

DROPSTRUCTURE

EMPTY

ENCODETEXT

ENCODETEXTMD5

ENCODEURL

ENCRYPTPATH

EncryptPDF

EncryptText

EndDataTask

ENDSWITH

EQUAL

ERROR

ESCAPEHTML

ESCAPEJAVASCRIPT

EscapeRegex

ESCAPEXML

EVAL

EVALUATERULE

EVALUATERULESET (Deprecated)

ExceptionRootCause

ExcludeFromNotificationSubscription

ExecuteDistributed

EXECUTIONCONTEXT

EXECUTIONCONTEXTATTRIBUTE

ExistsBusinessObject

ExistsDataClass

EXN

EXP

FAIL

File:Checksum

File:DetectMediaType

File:ListDirectoryContent

File:ScanForVirus

FileChecksum (Deprecated)

FILEEXISTS

FILEEXTENSION

FILEMODIFICATIONTIME

FILENAME

FILESIZE

FILESYSTEMURL

FILTER

FindWorkitem

FLOOR

FOCUS

Format:NewReference

Format:Number

FROMLIST (Deprecated)

GENERATEPDF

GETBUSINESSOBJECT

GETBUSINESSOBJECTS

GetCalendar

GETCOLENTITY

GetDataContext

GETDEPENDENCIES

GETENTITY (Deprecated)

GetIconIds

GetIconUrl

GetInstalledExtensions

GetLicenseReports

GetNotificationReceivers

GetNotificationSubscriptions

GetNotificationTopicDescription

GetNotificationTopicIds

GetNotificationTopicName

GetNumUnreadNotifications

GetProcessStatistics (Deprecated)

GetProcessToken

GETPROPERTY

GETSCROLLOFFSETVERTICAL

GetSensorStates

GetSubWorkflowTokenId

GetValuestoreId

GREATER

GREATEREQUAL

HasKey

Http:ReadRequest

HTTPCOOKIEGET

HTTPCOOKIESET

HTTPGET

HTTPPOST

HTTPREQUEST

HTTPRESPONSE

HTTPSESSION (Deprecated)

HttpSession:GetHashedId

HttpSession:GetId

HTTPSESSIONGET (Deprecated)

HTTPSESSIONSET (Deprecated)

HTTPURL

IF

ImageInfo

INCOMINGDEPENDENCIES

INDEXOF (Deprecated)

InjectVariable

INPREVIEW

IntegrationLink:GetState

IntegrationLink:Start

IntegrationLink:Stop

INTERSECTION

ISA

IsAjaxUpdateRequest

IsDataEntity

IsDataPlaceholder

IsDefined

IsPrimitiveType

ISRECENTLYUSED

JaasLoginTest

JOIN

JOINLIST

JOINPATH

Json:Prettify

KEY

KEYS

Label:NewReference

Label:Translate

LANGUAGE

LeftPad

LENGTH

LESS

LESSEQUAL

LIST

ListClusterFiles

LISTCONTENT

LISTDIRECTORIES

LISTFILES

ListPrivateKeysAliases

ListProcessInstanceIndexDefinitions

LN

LOADFROMCSV

LoadNotifications

LOADTESTDATA

LocalProcessInstanceIds

LocationPath

LocationStack

LOG

LOGGER

LOGIN

LOGOUT

LONG

LOWERCASE

Mail:CreateIncomingMailConfiguration

Mail:CreateOutgoingMailConfiguration

Mail:DeleteIncomingMailConfiguration

Mail:DeleteOutgoingMailConfiguration

Mail:GetIncomingMailConfiguration

Mail:GetOutgoingMailConfiguration

Mail:UpdateIncomingMailConfiguration

Mail:UpdateOutgoingMailConfiguration

MakeUppercaseTexts

MAP

Markdown

MarkNotificationRead

MATCH

MATCHCOUNT

MatchingStrings

MAX

MEDIUM

MemoryUsage:GetThreadAllocatedBytes

MemoryUsageStatistics

MergePDFFiles (Deprecated)

METHODCALL

Migration:AlignTimestampFilters

Migration:ExecNullSafe

Migration:MigrateFunctions

MIN

MOD

MOVEDIRECTORY

MOVEFILE

MUL

NEG

NEW (Deprecated)

NewIndexed

NEWLINE

NewNamed

NewObject

NextDayOfMonth

NextDayOfWeek

NOT

NotEmpty

NOTEQUAL

NOW

NUMBERFORMAT

OR

OUTGOINGDEPENDENCIES

Package:CompareVersionsReport

Package:CreateVersion

Package:GetAwdeploymentInfo

Package:Import

Package:List

Package:NewReference

PARENTDIRECTORY

PARSEDATE

ParseJSON

ParseXmlDocument

PAUSE

Pdf:CountPages

Pdf:Decrypt

Pdf:HasDocumentOpenPassword

Pdf:HasPermissionsPassword

Pdf:IsEncrypted

Pdf:Join

Pdf:Merge (Deprecated)

Pdf:RemovePages

Pdf:ResetPermissions

Pdf:RotatePages

Pdf:Split

PdfNumberOfPages (Deprecated)

PdfOutputTable

PdfToImage

PI

POW

PrettyPrint

PRINT

PRINTLN

PrintXmlDocument

Process:CreateMessageQueue

Process:DeleteMessageQueue

Process:DeleteProcessMessage

Process:ExecuteAdHocAction

Process:ExportMessageQueues

Process:FindWorkitems

Process:GetAdHocNavigationStructure

Process:GetNewProcessMessages

Process:GetProcessMessageQueueNames

Process:GetReadOnlyInstance

Process:GoToAdHocNavigationItem

Process:ImportMessageQueues

Process:IsEmptyLogicalWorkitemFilter

Process:NewReference

Process:TriggerCancel

Process:TriggerError

Process:TriggerTerminate

ProcessElementId

ProcessErrorCode

ProcessId

ProcessInstance

ProcessInstanceGetAttribute

ProcessInstanceId

ProcessInstanceIds

ProcessInstanceQueueNames

ProcessInstanceRemoveAttribute

ProcessInstanceSetAttribute

ProcessQueueCheckAccess

ProcessQueueNames

ProcessStartURL

ProcessToken

ProcessTokenGetAttribute

ProcessTokenRemoveAttribute

ProcessTokenSetAttribute

RANDOM

RandomText

ReadBinaryData

READCLUSTERFILE

ReadProcessMessageFile

READPROPERTIESFILE

READTEXTFILE

ReadTextFileLine

READTEXTRESOURCE

Record

RECORDS

RecursiveBuild

RELATIVEPATH

RemoveClientKeyAlias

RemoveDataContextCollectionElement

RemoveNotifications

RemovePrivateKey

RemoveSSLAlias

RemoveTrustedCertificate

RenderRichSuggestFieldSuggestions

REPLACE

ReplaceMatchingStrings

ReportValidationError

RESEMBLES

ResetStatistics

Resource:NewReference

Resource:ReadFromFile

Resource:WriteToFile

RESOURCEURL

RethrowJavaException (Deprecated)

RetrieveKeyStoreCertificate

RetrieveTrustedCertificate

ReturnWebApiError

REVERSE

RightPad

RM

RollbackProcessInstance

RotateImage

ROUND

Rule:NewReference

RULEFORMULA

RuleSet:NewReference (Deprecated)

RULETEXT

RunWithVersionFilter

ScaleImage

SCOPETRACETABLE

Screen:GenerateAppwayTestIds

Screen:NewReference

SCREENCONTEXT

ScreenHasOutgoingConnection

SCREENID

SCREENSTATE

SCREENSTATEGET

SCREENSTATESET

SCREENURL

SCRIPTFUNCTIONURL (Deprecated)

SelectBusinessObjects

SendAddressedNotification

SendProcessMessage

SendPubSubNotification

SendWorkflowMessage

SEQUENCE

SERIALIZE

SetDataContextPrimitiveValue

SetKey

SetProcessSignal

SETSCROLLOFFSETVERTICAL

SetVersionFilter

SHORT

SignData

SIN

SIZE

SORT (Deprecated)

SPLIT

SplitIndexed (Deprecated)

SPLITLINES

SqlCall

SqlClose

SqlCommit

SqlExport

SqlImport

SqlLoad

SqlOpen

SqlQuery

SqlRollback

SQRT

Ssl:DecodeCertificates

Ssl:FetchCertificates

Ssl:ListTrustStoreAliases

StackTrace

StartCollectingStatistics

StartProcess

StartSubProcess

STARTSWITH

STDERR

STDOUT

StopCollectingStatistics

StoreLicenseReport

STRINGCOMPARE

STRINGFORMAT

SUB

SubscribeForNotifications

SUBSTRING

SUPER

System:AppendConfigToScope

System:GetConfigOfScope

System:GetCsrfToken

System:MajorVersion

System:RestartExtension

System:ShutdownCluster

TAN

TextFormat

Throw:Exception

Throw:IllegalArgumentException

Throw:IllegalStateException

Throw:RethrowException

ThrowJavaException (Deprecated)

ThrowProcessCancel (Deprecated)

ThrowProcessError (Deprecated)

ThrowProcessTerminate (Deprecated)

Time:EpochMilli

Time:EpochSecond

TIMEADD

TIMEDIFF

TIMEROUND

TIMESTAMP (Deprecated)

TOBOOLEAN

TODATE

TODAY

TODOUBLE

ToIndexed

TOINTEGER

ToJSON

TOLIST (Deprecated)

TOLONG

ToMoney

ToNamed (Deprecated)

ToSqlDate

ToSqlTime

ToSqlTimestamp

TOSTRING

TracingEnter

TracingExit

TransformImage

TRANSLATE

TRIM

TypeOf

UID

UNESCAPEHTML

UNEVAL

UnexcludeFromNotificationSubscription

UNION

UNIQUE

UnsubscribeFromNotifications

Unwrap

Unzip

UpdateEncryptionKeyAlias

UpdateProcessInstance

UPPERCASE

User:AddToPhysicalGroup

User:AddUser

User:CheckPassword

User:Create

User:CreatePhysicalGroup

User:CreateVirtualGroup

User:CurrentUserGetFirstName

User:CurrentUserGetId

User:CurrentUserGetLastName

User:CurrentUserIsInGroup

User:CurrentUserIsInRole

User:CurrentUserListGroupIds

User:CurrentUserListRoleIds

User:Delete

User:DeleteGroup

User:Get

User:GetAllGroups

User:GetAllPermissions

User:GetAllRoles

User:GetPermissionsForRole

User:GetReadOnly

User:GetSessions

User:GetUserProfileImageURL

User:HashPassword

User:IsInGroup

User:ListGroupIds

User:ListIds

User:ListLocalIds

User:ListRoleIds

User:RemoveFromPhysicalGroup

User:SetPermissionToRole

User:Update

User:UpdateVirtualGroupDefinition

UserAddToGroup (Deprecated)

UserGetGroupIds (Deprecated)

UserIsInGroup (Deprecated)

UserRemoveFromGroup (Deprecated)

UseSSLAlias

UseValuestoreRO

UUID

VALUES

ValueStore:AnalyzeIfSplittable

ValueStore:DebugNonSplittable

ValueStore:GetEntity

ValueStore:Merge

ValueStore:MergeAllLocalValueStores

VariablePointer

VersionFilter

WINDOWSTATE

WINDOWSTATEGET

WINDOWSTATESET

WORKITEM

WORKLIST

WriteBinaryData

WRITECLUSTERFILE

WriteProcessMessageFile

WRITEPROPERTIESFILE

WRITETEXTFILE

WRITETEXTRESOURCE

XmlToDataEntity

XmlTransform

XOR

XPathQuery

Zip

© 2026 Appway AG. All Rights Reserved