Skip to main content
Pentaho Documentation

IService

pentaho.config. IService

The config.IService interface describes a service that manages configurations of modules for a given environment.

It is up to the implementation how the environment it uses to select rules is obtained.

The add method is used to register a config.spec.IRuleSet with the service.

The configuration of a module can be obtained by calling the selectAsync method.

Rules that apply to a given module and environment variables are sorted by specificity and then their specifications are merged. For more information on the specificity of rules, see config.spec.IRuleSet.

Suppose that the following rule set is defined in the system:

{"rules": [
    // Disable a still experimental component.
    {"select": {"module":"my.foo.component"},"apply": {"enabled": false
      }
    },

    // Enable it, only for the dev user,"john", and the"super-app"application.
    {"select": {"module":"my.foo.component","user":"john","application":"super-app"},"apply": {"enabled": true
      }
    }
  ]
}

Additionally, assume that an implementation of a configuration service exists, setup for the environment:

{"user":"john","application":"not-so-super-app"}

We could use it like in the following example:

configService.selectAsync("my.foo.component").then(function(mergedConfigSpec) {

  // Results in a configuration specification like:
  // {
  //   enabled: false
  // }
});

Source: doc-js/pentaho/config/IService.jsdoc, line 17

See also: pentaho.config.service , pentaho.config.spec.IRuleSet

Members

Name Description
selectAsync

Selects, asynchronously, the configuration of a module given its identifier.

Members Details

selectAsync:

Selects, asynchronously, the configuration of a module given its identifier.

Source: doc-js/pentaho/config/IService.jsdoc, line 96