Generic Properties in Expression Language

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search

Configuration data properties

Property Description
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.
CurrentUser (User) Returns the current user as User object.
Models (Model*) All Model objects in the QPR ProcessAnalyzer server (that the user have rights).
OperationLog (SqlDataFrame) Returns the operation log (task log) as SqlDataFrame where each log entry is as a row. There is an entry in the operation log for all requests that have been done to the server api. Also script runs and loading of model can be seen as operations.

If user has ManageOperations permission, user sees all entries in the log. Other users can only see her/his own log entries.

There are following columns in the SqlDataFrame:

  • Id (integer): Operation log entry unique id.
  • Type (string): Operation log entry type.
  • SessionId: Id of the user session that created the operation.
  • UserId (integer): Id of the user who created the operation.
  • ModelId (integer): Id of the model where the operation is related to.
  • StartTime (date): Start timestamp of the operation.
  • EndTime (date): End timestamp of the operation. If the operation is still in progress, the EndTime is null. Note that the operation log may also contain ended entries where EndTime is not defined because the server might have shutdown forcefully.
  • Result (string): Error message for failed operations.
  • Parameters (string): Input parameters of the operation.
  • UserName (string): User login name who created the operation.
  • UserFullName (string): User full name who created the operation.
  • ModelName (string): Model name where the operation is related to.
  • Cancelled (boolean): Whether the operation was requested to be cancelled by a user. The system tries to stop the cancelled operations as soon as possible.

Example: Return all log entries made by user qpr starting from year 2023:

OperationLog
  .Where(Column("UserName") == "qpr" && Column("StartTime") > #expr{DateTime(2023)})
  .Collect();
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 memory usage properties

Property Description
AvailablePhysicalMemory (Integer) Returns the available (free) physical 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.
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]
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.
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
CurrentOperationId (String) Returns id of the currently in-progress operation where the CurrentOperationId is called.
InternalTypeName (String) Returns the .NET type name of the context object.
ServerStartupTime (DateTime) Returns the timestamp when the QPR ProcessAnalyzer Server instance was last time started.