Creating session parameters

A session parameter is a variable that IBM® Cognos® Framework Manager associates with a session.

For example, user ID and preferred language are both session parameters. Because session parameters are key and value pairs, you can think of each session parameter as an entry in a parameter map named Session Parameters. You use a session parameter in the same way that you use a parameter map entry, although the syntax for session parameters is slightly different.

There are two types of session parameters: environment and model.

Environment session parameters are predefined and stored in Content Manager. By default, the following session parameters display in Framework Manager:

  • runLocale

    Returns the code for the current active language in Framework Manager. The model content is shown in this language.

    You can change the active language at any time for your current session only. In future sessions, the model continues to open in the design language. For more information, see the section Adding a language to a project.

  • account.defaultName

    Specifies the name of the current user as defined in the authentication provider. For example, user's first and last name.

    If you log on anonymously, you will see Anonymous.

  • account.personalInfo.userName

    Specifies the user ID used to log on to IBM Cognos Analytics with Watson.

    If you log on anonymously, you will not see this parameter.

  • current_timestamp

    Specifies the current date and time.

  • machine

    Specifies the name of the computer where Framework Manager is installed.

  • current_date

    Returns the date from the server where dynamic query is executing the request.

If your authentication source supports other parameters and you entered information about them in the authentication source, you see other session parameters, such as account.personalInfo.email or account.personalInfo.surname.

You can define additional parameters by using model session parameters. Model session parameters are stored in a parameter map named _env. They are set in the project and can be published with a package.

Model session parameters must have their values set within the scope of objects in the Framework Manager model. The scope can include the use of existing environment session parameters, as well as static values.

Each session parameter must have a name and a default value. You can define an override value to test the results that value returns. The override value is valid only when you have the model open, and is not saved when you save the model. If no override value exists, Framework Manager uses the default value when it executes a query that contains a session parameter.

The rules governing the use of parameters include the following:

  • All possible return values must have the same data type.
  • Only one value can be defined.