Configuration from Low-code

The configuration definition is available in the Application Eximee Designer.

Applications that use the configuration server to fetch configuration must have configured Data model and have the entry point set.

By going to the application's window in the left panel there is a tab available Configuration, and on the right the window Configuration Editor:

Illustration 1. Configuration from Eximee Designer - configuration tab

Configuration format

Configurations are defined in the format: key = value

Specifying the environment

Additionally, it is possible to specify the environment for which a particular setting will be available by adding a suffix to the key |${environment_key} e.g.

application.login|prod=keyValue

Such a setting will by default be available only for the environment marked as "prod".

We can specify the environment using an ENV - CONFIG_SERVER_ENVIRONMENT_NAME in the configuration server application.

If there is no key with a suffix matching the current environment, values without a specified suffix are used.

Comments

In the configuration edit window it is possible to add comments inside the configuration content. Comments should start from a new line, and the comment text should be preceded by the symbol hash (#).

Definition of roles authorized to edit in Eximee Dashboard

Along with the configuration in Eximee Designer you can define roles that will allow editing the runtime in Eximee Dashboard. If no roles are defined in the Eximee Designer application configuration, editing the application configuration from Eximee Dashboard will not be available to any user.

Role definitions can be specified in the "Roles authorized to edit in Eximee Dashboard" field above the configuration editor in Eximee Designer.

If the configuration server application has the parameter AUTH_ROLE_STRIP_PREFIX defined then the given role prefix should be omitted on the list items. So if AUTH_ROLE_STRIP_PREFIX = "PDC000000001-" and the role is named "PDC000000001-config-editor-role", then in the list in Eximee Designer you should indicate "config-editor-role".

Modifying configuration in Eximee Dashboard: Runtime modification of business configurations

Illustration 2. Configuration from Eximee Dashboard - "Application Configuration" tab

Configuration example

CONFIG_SERVER_ENVIRONMENT_NAME = dev

Configuration content:

#url links to test environment
test.url|dev=urlDev
test.url=urlDefault
 
test.password=passwordBasic
test.password|prod=passwordProd
test.password|dev=passwordDev
 
 
test.login|prod=loginProd
test.login=loginDefault
 
 
test.enabled=true

The config server for such settings will return 4 configurations (without suffix):

test.url=urlDev
 
test.password=passwordDev
 
test.login=loginDefault
 
test.enabled=true

Editing configuration

Editing configuration locks the application artifact, therefore you cannot add new artifacts to it, e.g.: a process, a form. However, an attempt to add such an artifact will create it in the repositoryIn summary: it will not be attached to the application artifact.

In case of syntax errors in the configuration (e.g.: for a configuration of type PROPERTIES an invalid unicode is provided) an error will occur when saving the configuration, which will have the general form of errors that occur when saving an artifact:

Illustration 3. Error saving invalid application configuration

The user will remain in edit mode and will be able to correct any syntax errors and try to save the configuration again.

Using configuration values in ScriptCode

In ScriptCode we can fetch a value from the configuration using the configuration retrieval API: Api:

interface Api {
    config: {
        v1: {
          get(key: string): string;
          getOrDefault(key: string, defaultValue: string): string;
        }
    }
}

example script using the Api:

function callService(context) {
    let value1
    try {
        value1 = api.config.v1.get("dummy.url2");
    } catch(e) {
        value1 = "default"
    }
  
    var value2 = api.config.v1.get("dummy.url");
  
    var value3 = api.config.v1.getOrDefault("not_existing_key", "defaultValue")
  
    return [{'value1': value1, 'value2': value2, 'value3': value3}];
}

*The Api also works for script calls in the data model.

The editor also offers suggestions:

Illustration 4. Example of suggestions while typing code

Using configuration values in a script task

Example script task:

function handle(task, context) {
    // Retrieving variables from configuration
    const skipTask = api.config.v1.get("script.task.skip.task")
    const titleName = api.config.v1.getOrDefault("script.task.title.name", "Default title")
     
    // Completing the task and passing variables (skipTask, titleName) to the process
    context.complete({'skipTask': skipTask, 'titleName': titleName});
}

usage in a process:

Illustration 5. Example of using a configuration value in a process

As a result, values from the configuration will be passed to the process and saved under the keys: skipTask and titleName.

Business configuration in Eximee: Business Application Configuration

Last updated

Was this helpful?