Skip to content

System

Core system operations. The System package is implicitly imported into every DMLA package.

Functions

  • Add: Bool Add(Array<ObjectType> array, ObjectType? element) — Appends an element to the end of an array.
  • Contains: Bool Contains(Array<ObjectType> array, ObjectType? element) — Checks whether an array contains an element.
  • CallExternal: String? CallExternal(String id) — Calls a registered external endpoint and returns its response.
  • Count: Int Count(Array<ObjectType> array) — Returns the number of elements in an array.
  • GenerateId: String GenerateId(String prefix) — Generates a new unique id with the given prefix.
  • GetEntityByID: Entity(Base) GetEntityByID(String id) — Returns the entity with the given id.
  • GetInstances: Array<Entity(Base)> GetInstances(Entity(Base)? entity = null, Bool isTransitive = true) — Returns the instances of an entity, or every entity when no entity is given.
  • GetLocalID: String? GetLocalID(Entity(Base)? entity) — Returns the last segment of the id of an entity.
  • GetMeta: Entity(Base)? GetMeta(Entity(Base) entity) — Returns the meta entity of an entity.
  • GetPackage: Entity(Bootstrap.PackageDefinition)? GetPackage(Entity(Base) entity) — Returns the package that contains an entity.
  • GetPackageById: Entity(Bootstrap.PackageDefinition)? GetPackageById(String id) — Returns a package by its id.
  • InsertAt: Void InsertAt(Array<ObjectType> array, ObjectType? element, Int index) — Inserts an element into an array at the given index.
  • IsInstanceOf: Bool IsInstanceOf(Entity(Base) entity, Entity(Base) meta) — Checks whether an entity is an instance of a meta entity.
  • PrintStdout: Void PrintStdout(ObjectType? message, String color = "green") — Prints a message to the standard output.
  • PrintLnStdout: Void PrintLnStdout(ObjectType? message, String color = "green") — Prints a message to the standard output, followed by a line break.
  • RemoveAt: ObjectType? RemoveAt(Array<ObjectType> array, Int index) — Removes the element at the given index from an array.
  • Remove: Bool Remove(Array<ObjectType> array, ObjectType? element) — Removes the first occurrence of an element from an array.
  • StrEndsWith: Bool StrEndsWith(String findIn, String toFind, Bool ignoreCase = false) — Checks whether a String ends with another String.
  • StrFind: Int StrFind(String findIn, String toFind, Int startIndex = 0, Bool ignoreCase = false) — Returns the index of the first occurrence of a String in another String.
  • StrLen: Int StrLen(String input) — Returns the length of a String.
  • StrLower: String StrLower(String input) — Converts a String to lowercase.
  • StrReplace: String StrReplace(String input, String toReplace, String replaceWith, Bool ignoreCase = false) — Replaces every occurrence of a substring in a String.
  • StrStartsWith: Bool StrStartsWith(String findIn, String toFind, Int startIndex = 0, Bool ignoreCase = false) — Checks whether a String starts with another String, optionally from a given index.
  • StrUpper: String StrUpper(String input) — Converts a String to uppercase.
  • Substring: String Substring(String input, Int startIndex, Int endIndex = -1) — Returns the substring of a String between a start index and an end index.
  • ToDouble: Real ToDouble(Int input) — Converts an Int to a Real.
  • ToLong: Int ToLong(Real input) — Converts a Real to an Int, truncating the fractional part.