QPR ProcessAnalyzer Objects in Expression Language: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
Line 213: Line 213:
<pre>
<pre>
ModelById(123).TriggerNotifications(["Notification 1", "Notification 2"]);
ModelById(123).TriggerNotifications(["Notification 1", "Notification 2"]);
Triggers notifications Notification 1 and Notification 2 in model id 123.


ModelById(123).TriggerNotifications();
ModelById(123).TriggerNotifications();
Triggers all notifications in model id 123.
</pre>
</pre>
|}
|}

Revision as of 17:02, 10 February 2021

DataFrame

Datatable

Datatables are used to store data in QPR ProcessAnalyzer persistently. Datatables consist of one-to-many named columns and zero-to-many rows. The Datatable entity in the expression language is used to access Datatables metadata, such as name, description and audit information. The actual data contents can be accessed by using the DataFrame property, which causes the actual data to be loaded from the database into memory for calculations.

Datatables have many usecases:

  • Models can load their data from Datatables.
  • Datatables can be used to store data extracted from external systems
  • Intermediate ETL calculation results can be stored to Datatables
  • It's possible to visualize data from Datatables directly in the dashboards without building a QPR ProcessAnalyzer model

Datatables are stored to QPR ProcessAnalyzer database as database tables. Each datatable belongs to a project.

Datatable properties Description
ColumnNames (String*) Array of Datatable column names in the order they are in the DataTable. The DataTable doesn't need to be loaded into memory to get the column names.
CreatedDate (DateTime) Timestamp when the datatable was created.
DataFrame (DataFrame) Contents of the DataTable as a DataFrame.
Description (String) Datatable description. The datatable description may contain line breaks.
Id (Integer) Datatable Id. Datatable Id is generated by QPR ProcessAnalyzer when the datatable is created.
LastImportDate (DateTime) Timestamp when data was the last time imported to the datatable.
LastModifiedDate (DateTime) Timestamp when the datatable was modified the last time, such as name or desctiption. When importing data to the datatable, the LastModifiedDate is not changed.
Name (String) Name of the datatable.
NColumns (Integer) Number of columns in the datatable.
NRows (Integer) Number of data rows in the datatable.
Project (Project) Project the datatable belongs to.
Function Parameters Description
DataTableById

datatable id (Integer)

Return DataTable with given id. An exception is given if a DataTable with the given id is not found.

Examples:

DataTableById(27)
Returns: DataTable for the data table having id 27.

Model

Model properties Description
Calendars (BusinessCalendar*)

Returns all business calendars stored to the Model as an array. Returns an empty array, if there are no business calendars stored to the model. Note: UI allows to set only one business calendar for a Model.

CaseAttributes (AttributeType*) CaseAttributes in the model returned in the alphabetical order. Using this property requires that the model is loaded in the memory. If the model is not in the memory, it's loaded when this property is used.
CasesDatatable (Datatable) Returns the Datatable the model uses as a datasource for cases. Returns null if the cases Datatable is not defined or if model uses other than the Datatable datasource.
ConfigurationJson (String) Returns an model configuration in JSON format.
CreatedDate (DateTime) Timestamp when the model was created.
CreatedBy (User) User who created the Model.
DefaultCalendar (BusinessCalendar) Returns the default business calendar of the Model. Returns null, if there are no calendars in the Model or no calendar has been set as a default calendar. Note: UI allows to set only one business calendar for a Model, which is also the default calendar.
DefaultFilterId (Integer) Default filter id of the model. Returns null if the model does not have a default filter.
Description (String) Model description. The model description may contain line breaks.
DeletedDate (DateTime) Timestamp when Model was deleted (moved to the recycle bin).
DeletedByUser (User) User how deleted the Model.
EstimatedMemory (Integer) Returns an estimation of how much memory in bytes the model requires.
EventsDatatable (Datatable) Returns the Datatable the model uses as a datasource for events. Returns null if the events Datatable is not defined or if model uses other than the Datatable datasource.
EventAttributes (AttributeType*) EventAttributes in the model returned in the alphabetical order. Using this property requires that the model is loaded in the memory. If the model is not in the memory, it's loaded when this property is used.
EventLog (EventLog) EventLog containing the entire model (i.e. event log where no filters have been applied). Using this property requires that the model is loaded in the memory. If the model is not in the memory, it's loaded when this property is used.
Id (Integer) Model Id. Model Id is generated by QPR ProcessAnalyzer when the model is created.
LastImportDate (DateTime) Timestamp when data was the last time imported to the model.
LastModifiedDate (DateTime) Timestamp when the model was modified the last time.
LastModifiedBy (User) User how last time modified the Model. The modification refers to the properties of the Model (not importing data to the model).
Name (String) Model name.
NBookmarks (Integer) Number of bookmarks in the model.
NCache (Integer) Number of objects related to the model when the model is loaded into the memory.
NCaseAttributes (Integer) Number of CaseAttributes in model.
NCases (Integer) Number of Cases in the model.
NEventAttributes (Integer) Number of EventAttributes in model.
NEvents (Integer) Number of Events in model.
NEventTypes (Integer) Number of EventTypes in the model.
NFilters (Integer) Number of filters in the model.
NOpens (Integer) Number of times analysis has been requested from the model.
Project (Project) Project the model belongs to.
ProjectId (Integer) Project id the model belongs to.
Status (String)

Memory availability status of the model. There are the following statuses:

  • Loading: The model is currently loading into the memory. When the loading is ready, the status changes to online. If the loading fails, the status changes to offline.
  • Offline: The model is currently not loaded into the memory. The model needs to be loaded into the memory, so that analyses can be calculated from the model (occurs automatically when an analysis is requested).
  • Online: The model is in the memory and ready for analysis calculation. If the model is dropped from the memory, its status changes to offline.

Notes:

  • For models that are offline, the object counts represent the situation when the model was last time online (loaded into the memory). null is returned if the model has never been loaded into the memory.
  • If Case permissions are used for the model, and user doesn't have GenericWrite permission for the model, null is returned for data security reasons. Users that have the GenericWrite permission, see null when the model is offline, and when online, they see counts where the case level permissions settings are applied.
  • Using CaseAttributes, EventAttributes and Eventlog properties requires the model to be loaded into the memory. If the model is not in the memory, it is loaded when these properties is used. Other Model object properties down require the model to be in the memory.
Model Function Parameters Description
CalendarByName (BusinessCalendar)

name (String)

Returns a business calendar stored to the Model by the name of the calendar. Business calendars can be stored to models in the model properties. Returns null, if a calendar with the provided name is not stored to the model.

Examples:

ModelById(123).CalendarByName("MyCalendar")
DeletePermanently (none) Deletes the Model permanently. Note that the model doesn't need to be in the recycle bin, to be able to delete it permanently.
Restore (none)

Restores the Model from the recycle bin back to the original location.

TriggerNotifications (Boolean) Notification names (String*) Triggers the given notifications for the Model. Notifications are given by their names. Triggering means that the configured rules are run and notification emails are sent as defined by the rules. If the notification names parameter is not provided, all notifications in the Model are triggered.

The function return true if any notification were triggered, otherwise false.

ModelById(123).TriggerNotifications(["Notification 1", "Notification 2"]);
Triggers notifications Notification 1 and Notification 2 in model id 123.

ModelById(123).TriggerNotifications();
Triggers all notifications in model id 123.
Function Parameters Description
ModelById
  • ModelId (Integer)

Returns Model object corresponding to the provided model Id.

Project

Project properties Description
CreatedDate (DateTime) Timestamp when the Project was created.
CreatedBy (User) User who created the Model.
Datatables (Datatable*) Returns all Datatables in the project.
DeletedDate (DateTime) Timestamp when the Project was deleted (moved to the recycle bin).
DeletedBy (User) User who deleted the Project.
Id (Integer) Id of the Project. It's generated by QPR ProcessAnalyzer when the model is loaded.
LastModifiedDate (DateTime) Timestamp when the Project was last modified.
LastModifiedBy (User) User who last modified the Project.
Name (String) Name of the Project.
Models (Model*) Models that are in the Project.
parent (Project) Parent project, i.e. a project where the project is located in the project's hierarchy.
Project function Parameters Description
DeletePermanently (none) Deletes the Project permanently. Note that the Project doesn't need to be in the recycle bin, to be able to delete it permanently.
Restore (none)

Restores the Project from the recycle bin back to the original location.

User/Group

User objects represents users and user groups. Note that some properties can only be used for users and some for groups.

User properties Description
Description (String) Description of the user.
Email (String) Email address of the user.
FullName (String) Full name of the user or group name.
GlobalPermissions (String*) Array of global permissions of the user. Global permissions come from the global roles assigned to the user and groups that the user belongs to. To get the actual (effective) permissions for certain objects, also project specific permissions need to be taken into account.
GroupMemberNames (String*) Array of names of members of a user group. This property is available for groups.
GroupMembers (User*) Array of members of a user group. This property is available for groups.
GroupNames (String*) Array of names of user groups the user belongs to. This property is available for users.
Groups (User*) Array of user groups the user belongs to. This property is available for users.
Id (Integer) Id of the user, which is unique for every user.
IsActive (Boolean) Returns true only if the user is active (not disabled).
IsGroup (Boolean) Returns true if the user is a user group.
Name (String) Login name of the user or group.
Roles (String*) System roles of user as string array.

Functions for User/Group:

Function Parameters Description
EffectivePermissionsFor (String Array)
  • Project to get permissions

Returns effective (actual) permission of the user to the given project. Project is given as a project object (not as a project id). Effective permissions determine the actual permissions that the user has, i.e. a combination of all permissions assigned to the user and groups the user belong to, including both project specific and global roles.

Permissions for the EffectivePermissionsFor function are as follows:

  • All users can query their own permissions
  • To get permissions for any user, the user needs to have ManageUsers permission.

Note that inactive users don't have any effective permissions, so the EffectivePermissionsFor function does not return any permissions for those users.

Examples:

EffectivePermissionsFor(ModelById(1234).Project)
Returns (for example): ["EditDashboards", "Filtering", "GenericRead"]