Generic Properties in Expression Language: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
Line 48: Line 48:
||AvailableVirtualMemory (Integer)
||AvailableVirtualMemory (Integer)
||Returns the available (free) virtual memory (in bytes) of the computer where QPR ProcessAnalyzer server is running.
||Returns the available (free) virtual memory (in bytes) of the computer where QPR ProcessAnalyzer server is running.
|-
||PerformanceCounterCpu (Float)
||Returns processor usage of the computer where QPR ProcessAnalyzer server is running. Processor usage is calculated as a sum of the cores where each core value is between 0 and 100. In the [[Web.config_file#Common_Settings|web.config]], EnableProcessPerformanceCounter=True needs to be set for this setting to work, otherwise it returns ''null''.
|-
||PerformanceCounterMemory (Float)
||Returns the current number of bytes in working set of the process memory in the computer where QPR ProcessAnalyzer server is running. In the [[Web.config_file#Common_Settings|web.config]], EnableProcessPerformanceCounter=True needs to be set for this setting to work, otherwise it returns ''null''.
|-
|-
||TotalPhysicalMemory (Integer)
||TotalPhysicalMemory (Integer)

Revision as of 13:12, 3 February 2023

Metadata properties

Property Description
ComparisonEventLog (EventLog)

Returns eventlog calculated by applying the Comparison property for the EventLog in the context. ComparisonEventLog is available only in the expression query when the ContextType is Eventlog. The ComparisonEventLog helps in implementing the root causes analysis.

CurrentUser (User) Returns the current user as User object.
EventLog (EventLog)

Returns the EventLog in which context the expression is being evaluated.

Models (Model*) All Model objects in the QPR ProcessAnalyzer server (that the user have rights).
Projects (Project*) All Projects in the QPR ProcessAnalyzer system (that the user have rights).
RecycleBin.Objects (Model/Project*) Return all items that are deleted, i.e. in the recycle bin. This operation is available only for the system administrators. This is the only way to get the deleted models and projects. Note that when a project is deleted, also its containing models are listed in the recycle bin.

Calling Recyclebin.DeletePermanently() deletes permanently multiple objects (models and projects) at the same time. Takes an array of entities as parameter. Deleting multiple objects at the same time is useful when objects are children of each other, as deleting them one by one should be done in a correct order starting from the leaf level of hierarchy.

Scripts (Script*) All system level Scripts (i.e. scripts that are not linked to a project).
UserGroups (User*) Returns an array of user groups visible for the current user as User objects.
Users (User*) Returns an array of users visible for the current user as User objects.

System properties

Property Description
AvailablePhysicalMemory (Integer) Returns the available (free) physical memory (in bytes) of the computer where QPR ProcessAnalyzer server is running.
AvailableVirtualMemory (Integer) Returns the available (free) virtual memory (in bytes) of the computer where QPR ProcessAnalyzer server is running.
TotalPhysicalMemory (Integer) Returns the total physical memory (in bytes) of the computer where QPR ProcessAnalyzer server is running.
TotalVirtualMemory (Integer) Returns the total virtual memory (in bytes) of the computer where QPR ProcessAnalyzer server is running.
UsedProcessMemory (Integer) Current memory consumption by the QPR ProcessAnalyzer Server in bytes.

Other Properties

Property Description
_

Refers to the current context. See more information about expression context.

null Returns a special null value. Usually null represents non-existing or missing value. Null value is similar to EMPTY value, except null values can also be recursed.
_empty

Returns an object which represent a non-existent value. Textual representation of this value is "EMPTY".

_query (Dictionary) Returns configuration of the query being currently made as a dictionary. If run in a context where there is no query being made, a reference to undefined variable exception will be thrown.

Example: Returns the Filter parameter in the query:

_query.Configuration.Filter
_remove

A special value which, when traversing through a hierarchical object, means that an item in the hierarchical object should be removed.

Examples:

[1, 2, 3, 4].(2 * _)
Returns: [2, 4, 6, 8]

[1, 2, 3, 4].if(_ == 2,_remove,_)
Returns: [1, 3, 4]

For("i", 0, i < 10, i + 1, i).Where(_ % 2 == 0)
For("i", 0, i < 10, i + 1, i).If(_ % 2 == 0, _, _remove)
Both return:
[0, 2, 4, 6, 8]
Now (DateTime) DateTime object representing the current date and time.
AllBuiltInFunctions Returns all the built in functions as FunctionDefinition objects (as an array) no matter what their calculation context is.
AllBuiltInProperties Returns all the built in properties as FunctionDefinition objects (as an array) no matter what their calculation context is.
BuiltInFunctions Returns all the built in functions as FunctionDefinition objects (as an array) valid for the current calculation context.
BuiltInProperties Returns all the built in properties as FunctionDefinition objects (as an array) valid for the current calculation context.
CachedItems (String*) Returns a string array of all keys of the items currently stored in the in the memory cache. Global ManageOperations permission is needed.
CalcId (String)

Returns an id that is unique among all QPR ProcessAnalyzer objects in the server. CalcId remains the same at least for the duration of the expression calculation. It is possible that CalcId for an object is different in the next calculation.

CalculationContextTypeName (String)

Returns the type of the current calculation context.

Examples:

CalculationContextTypeName
Returns: "Generic"

[1, "a", [1, 2], Timespan(1, 2, 3, 4), DateTime(2016,1,1), Def("", _ + 1)].CalculationContextTypeName
Returns: ["Generic", "String", "Generic", "Timespan", "DateTime", "FunctionDefinition"]

EventLogById(<event log id>).CalculationContextTypeName
Returns: EventLog
InternalTypeName (String) Returns the .NET type name of the context object.