Difference between revisions of "Variables in QPR UI"

From Mea Wiki
Jump to navigation Jump to search
(403760)
Line 64: Line 64:
  
 
== Context and Navigating the Views ==
 
== Context and Navigating the Views ==
Any time the '''session context''' is modified (like when clicking a [[Pushbutton_Properties|Pushbutton]] or modifying [[QPR_ProcessAnalyzer_in_QPR_UI#QPR_ProcessAnalyzer_Presentation_Object_.28PAPO.29|ProcessAnalyzer Presentation Object]] settings that cause session variables to be modified), a browser history entry is created. The preceding values in the session context can be restored via the browser's '''Back''' button. Left-clicking the Back button will restore the previous session context values, whereas right-clicking the Back button will show a list of session context changes to select from. Selecting an entry on the list will restore the session context from that entry.
+
Any time the '''session context''' is modified (like when clicking a [[Pushbutton_Properties|Pushbutton]] or modifying [[QPR_ProcessAnalyzer_Presentation_Object_(PAPO)#QPR_ProcessAnalyzer_Presentation_Object_.28PAPO.29|ProcessAnalyzer Presentation Object]] settings that cause session variables to be modified), a browser history entry is created. The preceding values in the session context can be restored via the browser's '''Back''' button. Left-clicking the Back button will restore the previous session context values, whereas right-clicking the Back button will show a list of session context changes to select from. Selecting an entry on the list will restore the session context from that entry.
 
<br>
 
<br>
 
[[File:BrowserHistory.png]]
 
[[File:BrowserHistory.png]]

Revision as of 13:39, 19 November 2017

Context in QPR UI is an integration mechanism for storing and communicating configuration and settings data between the different elements (views, panels, presentation objects, external applications) in QPR UI. For example, the context can define the starting point for querying data from QPR ProcessAnalyzer or QPR Suite Web Services, or it can be used, for example, to define the chart type and chart colors.

Effective Context and Context Inheritance

The context is defined with context variables that have a certain values. The context variables in QPR UI have two types of behavior: Default and Fixed. There are four levels where the context is defined: Session, View, Panel, and Presentation Object. The context variable behavior type defines how the context variable value is inherited from the Session context, i.e. what the effective contexts of the view, its panel(s), and presentation object(s) are:

  • Default: context variables with the "Default" behavior will inherit the context variable value from the higher level (Session -> View -> Panel -> Presentation Object), if there is an effective context variable value on the higher level. If there isn't an effective context variable value on the higher level, the value defined for the View, Panel, or Presentation Object will be used.
  • Fixed: the value of the context variable will overwrite any existing effective value of the same context variable.

Example

There is a view with one panel, in which there is one presentation object.

The Session context variable values are defined as follows:
800px

In the View Properties, the following context variable values are defined:
800px

In the Panel Properties, the following context variable values are defined:
800px

In the Presentation Object Properties, the following context variable values are defined:
800px

In the Effective View Context, these result into the values shown below. Note the Source column displaying the information where the effective context comes from: 800px

In the Effective Panel Context, these result into the values shown below. Note the Source column displaying the information where the effective context comes from: 800px

In the Effective Presentation Object Context, these result into the values shown below. Note the Source column displaying the information where the effective context comes from: 800px

To put it more concisely, the context variable values (and their behaviors) are as follows:

Context Variable Session View Panel Presentation Object
AccountManager William Taylor John Smith (Default) Susan Chapman (Fixed)
Country Sweden Finland (Default) Norway (Fixed)
ProductGroup Umbrellas Pants (Fixed)

The effective context values are:

Context Variable Session View Panel Presentation Object
AccountManager William Taylor William Taylor Susan Chapman Susan Chapman
Country Sweden Sweden Sweden Norway
ProductGroup Umbrellas Pants Pants Pants

Context and Navigating the Views

Any time the session context is modified (like when clicking a Pushbutton or modifying ProcessAnalyzer Presentation Object settings that cause session variables to be modified), a browser history entry is created. The preceding values in the session context can be restored via the browser's Back button. Left-clicking the Back button will restore the previous session context values, whereas right-clicking the Back button will show a list of session context changes to select from. Selecting an entry on the list will restore the session context from that entry.
BrowserHistory.png

Defining View Properties and Variables

To define context variables, type in the name of the variable to the text field and click the check mark. After that, you can click the value field and type in the value for your context variable. Context variables starting with "sys:" are system variables which have special purpose in QPR UI - use them only for their intended purpose. The Behavior selection affects the context variable used explained in Context Variable Behaviors. To see what context variable values are used in the view, panel, or presentation object, select the Show effective context check box in the Context tab of the view, panel, or presentation object properties pages.

Variables Usage Example

There is a view with one panel, in which there is one presentation object. The Session variable values are defined as follows:

Variable name Value
AccountManager John Smith
Country Sweden

In the View Properties, the following variable values are defined:

Variable name Value Behavior
AccountManager William Taylor Stored variable
CustomerGroup Kids Local variable

In the Panel Properties, the following variable values are defined:

Variable name Value Behavior
AccountManager Susan Chapman Local variable
Country Finland Local variable

In the Presentation Object Properties, the following variable values are defined:

Variable name Value Behavior
ProductGroup Umbrellas Stored variable

In the Effective View Context, these result into the values shown below. Note the Source column displaying the information where the effective context comes from:

Variable name Value Source Scope
AccountManager William Taylor Scope of the view View
Country Sweden Inherited from session context Session
CustomerGroup Kids Scope of the view View

In the Effective Panel Context, these result into the values shown below. Note the Source column displaying the information where the effective context comes from:

Variable name Value Source Scope
AccountManager Susan Chapman Initialized from the panel's context Panel
Country Finland Initialized from the panel's context Panel
CustomerGroup Kids Inherited from the effective context of the view View

In the Effective Presentation Object Context, these result into the values shown below. Note the Source column displaying the information where the effective context comes from:

Variable name Value Source Scope
AccountManager Susan Chapman Inherited from the effective context of the panel Panel
Country Finland Inherited from the effective context of the panel Panel
ProductGroup Umbrellas Scope of the presentation object Presentation object
CustomerGroup Kids Inherited from the effective context of the view View

To put it more concisely, the context variable values (and their behaviors) are as follows:

Context Variable Session View Panel Presentation Object
AccountManager John Smith William Taylor (Stored variable) Susan Chapman (Local variable)
Country Sweden Finland (Local variable)
ProductGroup Umbrellas (Stored variable)
CustomerGroup Kids (Local variable)

The effective context values are:

Context Variable Session View Panel Presentation Object
AccountManager John Smith William Taylor Susan Chapman Susan Chapman
Country Sweden Sweden Finland Finland
ProductGroup Umbrellas
CustomerGroup Kids Kids Kids