new Environment(identity)
Identity class is declared in jsToken. Identity must have name,idflowchart,ndetail set
Parameters:
Name | Type | Description |
---|---|---|
identity |
Identity | identity.name must match a username in the customuser table |
- Source:
Methods
calcUserEnvironment(conn) → {Promise}
invokes a stored procedure to compute environment, needs sys(idcustomuser)
Parameters:
Name | Type | Description |
---|---|---|
conn |
DataAccess |
- Source:
Returns:
- Type
- Promise
enumSys() → {Array.<string>}
Enumerates all sys keys
- Source:
Returns:
- Type
- Array.<string>
enumUsr() → {Array.<string>}
Enumerates all usr keys
- Source:
Returns:
- Type
- Array.<string>
field(key, valueopt) → {object}
Get a value for an environment field or a new Date if the field is a stamp field
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | ||
value |
object |
<optional> |
- Source:
Returns:
- Type
- object
getAnonymousName() → {string}
this is meant to be redefined in derived classes
- Source:
Returns:
- Type
- string
getCustomUser(conn) → {Promise.<object>}
Evaluates env.sys[idcustomuser], requires env.sys[user] to be already defined
Parameters:
Name | Type | Description |
---|---|---|
conn |
DataAccess |
- Source:
Returns:
- Type
- Promise.<object>
getGroupList(conn) → {Promise.<Array.<object>>}
Evaluates env.sys[usergrouplist], requires env.sys[user] to be already defined.
This is meant to be invoked when environment is created
Parameters:
Name | Type | Description |
---|---|---|
conn |
DataAccess |
- Source:
Returns:
- Type
- Promise.<Array.<object>>
getStampFields() → {Array.<string>}
Returns an array of fields used as stamp in evaluating field function for optimistic locking
This function means to be redefined in derived classes
- Source:
Returns:
- Type
- Array.<string>
load(conn) → {Promise}
Loads environment from a database, it needs sys(user) and eventually idflowchart and ndetail
to be present in sys variables
Parameters:
Name | Type | Description |
---|---|---|
conn |
DataAccess |
- Source:
Returns:
- Type
- Promise
sys(key, valueopt) → {object}
Get/set a value for an environment sys variable
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | ||
value |
object |
<optional> |
- Source:
Returns:
- Type
- object
usr(key, valueopt) → {object}
Get/set a value for an environment usr variable
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | ||
value |
object |
<optional> |
- Source:
Returns:
- Type
- object