![]() |
Qorus Integration Engine®
4.0.3.p2_git
|
User code implementation can use the following functions to access value maps:
UserApi::getValueMap() returns NOTHING by default if there is no value for the given key, however an exception can be thrown if there is the "throws_exception"
flag is set to True.
The exception error is VALUE-MAP-ERROR
with description "value map 'name' does not contain value for key 'keyname'"
value maps can be defined and changed in the Qorus user interface or using the REST API. However, for large value maps it's much more useful to create value map files and load them with oload: Data Loading Tool and Schema Manager as a part of user code releases/deployments.
value maps are defined in *
.qvmap files. The structure of the file is similar to that of a service or job definition file and uses similar headers.
Value map definition file headers are as follows:
name:
(required) the unique name of the value map; loading a new value map with an already existing name removes the old key-value mappingsdesc
]: a description of the value mapauthor
]: a string identifying the author of the value mapexception
]: a flag determining the behavior of an invalid lookup (see Value Map Error Handling and Missing Data)valuetype:
(required) Value Map Data Typesdateformat
]: When the valuetype
is set to "date"
, "dateformat"
defines a mask for converting string input values to real dates using the Qore::date(string) function (see date format mask for more information)define-group
]: Allows interface groups to be defined; format is: name:
description
groups
]: One or more interface groups that the value map is a member of for access purposes (value maps cannot be enabled or disabled)The body of the *
.qvmap file contains comma separated value (CSV) data in three columns defining the lookup data for the value map as follows:
Simple value map example:
raw
should be loaded in yaml form because they will be stored as raw strings.