runmodel_setting

The runmodel_setting function can be used to retrieve information on the KCM context in which the Master Template is run. The function has one parameter of type TEXT that contains the setting that the function retrieves.

The function result is of type TEXT and holds the retrieved value.

The supported settings are the following:

  • ResultDocument. Retrieves the path and name of the ResultDocument.
  • Environment. Retrieves the name of the KCM Core environment in which the Master Template is run.
  • Session. Retrieves the session folder of KCM ComposerUI Server.
  • Product. Retrieves the KCM product used to run Master Templates.
  • User. Retrieves the user account with which KCM Core is run.
  • Project. Returns the default KCM Repository project in which KCM Core locates Text Block Lists and Text Blocks. The RepositoryProject configuration setting in the active KCM Core environment is used as the default project. If this setting is not specified, the project from the Master Template is used as the default project.
  • Model. Retrieves the path and name of the Master Template on the local filesystem.
  • ModelRepositoryName. Retrieves the name of the Master Template as it was known in the KCM Repository.
  • ModelRevision. Retrieves the revision of the Master Template. The retrieved revision includes the KCM Repository identification.
  • RepositoryCreator. Retrieves the KCM Repository user who compiled the Master Template.
  • RepositoryCompileDate. Retrieves the date the Master Template was compiled.
  • RepositoryProjectType. Retrieves the type of project the Master Template was created in. Possible return values are Fragment for Data Backbone Libraries, DataBackbone for Projects created with KCM Repository version 4.1.3 or higher, or Classic for Projects created with KCM Repository before version 4.1.3.
  • ITPVersion. The version of KCM Core in VRM format.
  • ITPFullVersion. The version of KCM Core in extended format.
  • OutputMode. The type of output currently being produced by the Master Template. The Output Mode is specified when the Master Template is started. Possible return values are: native, utf8, utf16, xml.

An example is provided here.

TEXT result := runmodel_setting("ResultDocument")
TEXT user := runmodel_setting("User")

The settings ModelRepositoryName, ModelRevision, RepositoryCreator, and RepositoryCompileDate are stored in the Master Template at the moment it is compiled in KCM Repository. If the Master Template is renamed later, moved, imported, or exported, this information is kept unmodified. Master Templates must be compiled with KCM Repository version 3.5.11 or higher to include this information.