Dashboard Variables

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search

Variables are for storing session time information and interacting between UI elements, such as charts. Variables can contain textual (string) values. If other types of data can be stored by converting them into JSON.

Dashboard Variables

Dashboard variables can be defined for each dashboard. It's done by opening a dashboard, clicking the dots menu on top right, clicking Dashboard Properties and opening tab Variables.

Variable name Description
SortOrder Defines a custom order as a number in which dashboards are shown in the navigation menu. By default, dashboards are shown in the alphabetical order by name. Dashboards with a custom order defined (sort by the order number) are shown before dashboards without custom order (sort by dashboard name).
HiddenInNavigation Dashboards can be hidden from the navigation menu by defining this variable value to true. Note that a hidden dashboard is still shown in the navigation menu when the dashboard is currently open. For example, drilldown dashboards, which users don't open directly (instead through another dashboard), can be hidden in the navigation menu.
DashboardFilter Currently used hidden filter rules that are applied to the charts in the dashboard. For an easy setup, create a stored filter first, and copy it's value (from the Filter variable) to the DashboardFilter variable. Defined using the JSON format.
Filter Currently used visible filter rules that are applied to the charts in the dashboard. The visible filter rules changed when making drilldown in the dashboard or changing between stored filters. Defined using the JSON format.
ModelId Id of the model, from which the analyses in the dashboard are run. The model is also visible in the dashboard header.
Comparison Similar to the Filter variable, but the Comparison variable stores the comparison rules that are used in the root causes analyses in the dashboard. The comparison rules are also visible and editable in the header. Defined using the JSON format.
FilterSelection Filter rules for currently active (unconfirmed) selection in JSON format. Chart in which the unconfirmed selection is made, is not filtered using the these rules. When the filter rules are confirmed, the rules are moved from FilterSelection to Filter. Defined using the JSON format.
SelectedPresentationObject Selected presentation object runtime id.
designModel BPMN model stored to the dashboard.

System Variables

QPR ProcessAnalyzer has the system variables defined in the table below. System variables have a special functionality in the system. All system variables start with sys: prefix, and thus it's a good practice not to name other variables to start with that to avoid accidental use of system variables.

When using variables a url pointing to QPR ProcessAnalyzer, variable values need to be url encoded (more information: https://www.w3schools.com/tags/ref_urlencode.asp).

Variable name Description
sys:dashboard Id of the currently open dashboard. Other dashboard can be opened by changing this variable (alternatively sys:dashboardIdentifier can be used).
sys:dashboardIdentifier Use this variable when you want to open a dashboard by a path defined by the textual identifiers. The path can be defined as:
  • Absolute path where the path starts from the projects hierarchy root. The absolute path always points to the dashboard defined by the path. Example: /Project/Sub project/DashboardIdentifier.
  • Relative path where the path starts from the project where the currently opened dashboard is located. Relative paths can be used to link between dashboards within a project branch and the links remain, even if the branch is moved to other project. Example: Project/Sub project/Dashboardidentifier.

Absolute paths always starts with the slash (/), whereas relative paths don't start with slash.

sys:dashboardIdentifier variable can only be used in the session variables. Setting the sys:dashboardIdentifier variable value will automatically set the corresponding value to sys:dashboard variable. sys:dashboardIdentifier will be removed automatically after. When both sys:dashboard and sys:dashboardIdentifier are defined, sys:dashboardIdentifier has the priority.

sys:hideViewHeader Defines whether the top main toolbar in the dashboard is hidden (true) or visible (false).
sys:username Use this parameter to provide username to login automatically to QPR ProcessAnalyzer without visiting the login screen. To be able to authenticate, you also need to provide the sys:password parameter. sys:username and sys:password parameters are removed from the URL after the login, and so that they won't be stored as QPR ProcessAnalyzer variables. Note however, that the username and password can be stored in the browser history. sys:username and sys:password parameters only work when authenticating using QPR Suite or QPR ProcessAnalyzer; credentials for the federated authentication identity provider cannot be used here.

Example url's:

  • https://localhost/QPRPA/ui/#/dashboard?sys:dashboard=24026&sys:username=qpr&sys:password=demo
  • http://localhost/QPRPA/ui/#/login?sys:username=qpr&sys:password=demo
sys:password Use this parameter to provide password to login automatically to QPR ProcessAnalyzer without going to the login screen. You also need to provide the sys:username parameter. sys:username and sys:password parameters are removed from the URL after the login, and thus they won't be stored. Note however, that the username and password can be stored in the browser history. Note also, that passing a password in a url is a considerable security risk. When using this method, it's very important to use encrypted (https) connection. See url examples in the description of the sys:username parameter.

Variable Behaviors

Variables can be defined for user session, dashboards and presentation objects which form a scope for the variables. Variables are visible and accessible in the scope where they have been defined. The user session scope can be used to pass information between dashboards.

Each defined variable have a behavior which determine how the variables work when setting and getting their values. The following behaviors are available:

Variable behavior Description
Local variable Local variables are visible in the scope where the variable is defined. When initialized, the local variable gets a value that is in its definition (in the Variables tab). When a local variable value is changed, its new value only lives as long as the dashboard is open.
Stored variable Stored variables work like Local variables, except that when the dashboard is saved, the current value of the Stored variable is saved to the dashboard at the level where the Stored variable is defined.
Optional parameter Optional parameters work like the local variables, except that the optional parameters get their initial values from the upper scope when the variables are initialized. For example, optional parameters in dashboard scope get their values from the session when a dashboard is opened. If a variable having the same name doesn't exist in any of the upper scope, the optional parameter will have the value that is set in its definition (in the Variables tab). After the optional parameter value is initialized, any changes in the upper scope variables don't affect the optional parameter value.
Default value Unlike local variables and optional parameters, Default value variables are not independent variables but they are just default values for non-existing variables. Thus, if a variable with the same name exists in the upper scope, the defined default value variable doesn't have any effect. Only if no upper scope variable exists, the value defined for the default value variable (in the Variables tab) is used in the default value variables' scope when referring to a variable with that name. Default value variable values cannot be set by presentation objects, so when trying to set an default value variable value, the value is set to the session scope variable.

Variables in the session cannot be defined like the dashboard variables, because session variables are created when they are set for the first time during a user session.

Variables and Web Browser History

When session variables are changed, new browser history entries is created. The preceding values in the session variables can be restored when clicking the browser Back button. In most browsers, left-clicking the Back button will restore the previous session variables values, whereas right-clicking the Back button will show a list of session variables changes to select from. Selecting an entry on the list will restore the session variables from that entry.

File:BrowserHistory.png

Defining Variables in URL

It's possible to define variables in the url when opening QPR ProcessAnalyzer. To do this, for each variable add "&<variable name>=<variable value>" in the end of the URL. For example:

https://SERVERNAME/ui/#/dashboard?sys:dashboard=1234&myvariable1=myvalue1&myvariable2=myvalue2

Note that when using variables a url, variable values need to be url encoded (more information: https://www.w3schools.com/tags/ref_urlencode.asp).