Domains

Introduction

When clients are registered to use the Dynamo system, they have to be recognized somehow on the platform. Clients are recognized on Dynamo as Domains.

Domain Overview

Each Domain has a unique ID on the platform and this ID can be used to retrieve information about the Domain. Clients need to also be able to store their configuration information on the platform that Processes can use to customize their behaviours.

Domains are exposed to protected Processors via a $domain property in the processor arguments (this.args). This means that the domain object can be accessed in these processors using

this.args.$domain

Domains can also be fetched in unprotected Processors by calling the getDomain library with the processors context. This is possible because while the domain is not exposed in the processor arguments, the _id of the domain is still exposed in the requestContext object seen as

this.args.$requestContext.domain

Usage of the library is shown below:

this.libs.getDomain.call(this, (error, domain) => );

Domain Object

Property NameTypeDescription
_idMongo ObjectIDMongoDB generated ID for the Domain
nameStringThe name of the Domain
uidStringUnique ID for the Domain
configObjectThis property is originally saved as an array of Objects in the database but is reduced to an object of key-value pairs when it is fetched.

Configuration Object

Property NameTypeDescription
_idMongo ObjectIDMongoDB generated ID for the Property
nameStringConfig key
valueStringConfig value