Dashboard in Expression Language: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
In QPR ProcessAnalyzer, '''diagram''' can be used to create user-defined business process and architecture designs. The diagram is a drawing canvas where elements can be added from a tool palette and relation between them defined. Each diagram belongs to the model in QPR ProcessAnalyzer and there can be several diagrams in each model.
In QPR ProcessAnalyzer, '''dashboard''' consists of a canvas where charts and other visualization components can be added. Each dashboard belongs to project, and dashboards have a mandatory name and optional identifier. The identifier is used when creating links between dashboards.


==Dashboard properties==
==Dashboard properties==
Line 7: Line 7:
! '''Description'''
! '''Description'''
|-
|-
||Content
||Content (Dictionary)
||Returns the dashboard content (dictionary).
||Returns dashboard content (charts and other components contained by the dashboard).
|-
|-
||CreatedBy
||CreatedBy (User)
||Returns the user (#30964#) who created this dashboard (object).
||Returns user who created the dashboard.
|-
|-
||CreatedDate
||CreatedDate (DateTime)
||Returns the dashboard created date (datetime).
||Returns date when the dashboard was created.
|-
|-
||Description
||Description (String)
||Returns the description of the dashboard (string).
||Returns description text of the dashboard.
|-
|-
||Id
||Id (Integer)
||Returns the id of the dashboard (integer).
||Returns id of the dashboard.
|-
|-
||Identifier
||Identifier (String)
||Returns the identifier of the dashboard (string).
||Returns identifier of the dashboard.
|-
|-
||LastModifiedBy
||LastModifiedBy (User)
||Returns the user (#30964#) who last modified this dashboard (object).
||Returns user who last modified this dashboard.
|-
|-
||LastModifiedDate
||LastModifiedDate (DateTime)
||Returns the dashboard last modified date (datetime).
||Returns date when the dashboard was last time modified.
|-
|-
||Name
||Name (String)
||Returns the name of the dashboard (string).
||Returns the name of the dashboard.
|-
|-
||Project
||Project (Project)
||Returns the project (#27622#) that this dashboard belongs to (object).
||Returns project object where the dashboard belongs to.
|-
|-
||ProjectId
||ProjectId (Integer)
||Returns the project id that this dashboard belongs to (integer).
||Returns project id where this dashboard belongs to.
|}
|}


== Diagram functions ==
== Dashboard functions ==
Diagram objects in the expression language have the functions described below. To create new diagrams, use function [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#Model|Model.CreateDiagram()]], and to list existing diagram, use property [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#Model|Model.Diagrams]].
Dashboard objects in the expression language have functions described below. To create new dashboards, use function [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#Model|Model.CreateDashboard()]], and to list dashboards, use property [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#Model|Project.Dashboards]].
{| class="wikitable"
{| class="wikitable"
!'''Function'''
!'''Function'''
Line 48: Line 48:
! '''Description'''
! '''Description'''
|-
|-
||DeletePermanently
||
||
||Deletes the dashboard permanently. ''EditDashboards'' permission to the project is required.
Example: delete all dashboards in a project:
<pre>
ProjectById(1).Dashboards.DeletePermanently()
</pre>
|-
||Modify
||Parameters dictionary
||
||
||
Modifies the dashboard. The parameter is a dictionary containing dashboard properties to be updated. ''EditDashboards'' permission to the project is required. Following properties are supported:
* '''Name''' (String): Name of the dashboard.
* '''Identifier''' (String): Identifier of the dashboard.
* '''Description''' (String): Description of the dashboard.
* '''ProjectId''' (Integer): Project id where the dashboard belongs to, i.e., moves the dashboard to other project.
* '''Content''' (Dictionary): Dashboard content as dictionary.
 
Example: Change dashboard background color to white.
<pre>
let dashboard = DashboardById(1); // find dashboard
let content = dashboard.content; // get dashboard content
content.layout.Set("backgroundColor", "#ffffff"); // modify content
dashboard.Modify( // store modified content back to the dashboard
  #{ "Content": content }
);
</pre>
 
Example: Remove "Filter" dashboard variable from all dashboards in project.
<pre>
let dashboards = ProjectById(1).Dashboards;
dashboards.{ // loop through dashboards
  let content = _.content; // get dashboard content
  content["variables"].Remove("Filter"); // modify content
  _.Modify( // store modified content back to the dashboard
    #{ "Content": content }
  );
};
</pre>
 
Example: Move dashboards from a project to other.
<pre>
let sourceProjectId = 1;
let targetProjectId = 2;
ProjectById(sourceProjectId).Dashboards.{
  _.Modify(
    #{ "ProjectId": targetProjectId }
  );
};
</pre>
|}
|}


Function to get diagram by dashboard id:
Function to get dashboard by dashboard id:
{| class="wikitable"
{| class="wikitable"
!'''Function'''
!'''Function'''
Line 61: Line 109:
||DashboardById
||DashboardById
||
||
* Diagram id (Integer)
* Dashboard id (Integer)
||
||
Returns diagram object corresponding to the provided diagram id.
Returns dashboard by given dashboard id. Returns the Dashboard object if such exists and user has permissions to it. Throws an exception if dashboard doesn't exist or user doesn't have permissions to it. ''GenericRead'' permission to the project that contains the dashboard is required.
|}
|}

Latest revision as of 13:59, 15 January 2024

In QPR ProcessAnalyzer, dashboard consists of a canvas where charts and other visualization components can be added. Each dashboard belongs to project, and dashboards have a mandatory name and optional identifier. The identifier is used when creating links between dashboards.

Dashboard properties

Dashboard objects in the expression language have the following properties:

Property Description
Content (Dictionary) Returns dashboard content (charts and other components contained by the dashboard).
CreatedBy (User) Returns user who created the dashboard.
CreatedDate (DateTime) Returns date when the dashboard was created.
Description (String) Returns description text of the dashboard.
Id (Integer) Returns id of the dashboard.
Identifier (String) Returns identifier of the dashboard.
LastModifiedBy (User) Returns user who last modified this dashboard.
LastModifiedDate (DateTime) Returns date when the dashboard was last time modified.
Name (String) Returns the name of the dashboard.
Project (Project) Returns project object where the dashboard belongs to.
ProjectId (Integer) Returns project id where this dashboard belongs to.

Dashboard functions

Dashboard objects in the expression language have functions described below. To create new dashboards, use function Model.CreateDashboard(), and to list dashboards, use property Project.Dashboards.

Function Parameters Description
DeletePermanently Deletes the dashboard permanently. EditDashboards permission to the project is required.

Example: delete all dashboards in a project:

ProjectById(1).Dashboards.DeletePermanently()
Modify Parameters dictionary

Modifies the dashboard. The parameter is a dictionary containing dashboard properties to be updated. EditDashboards permission to the project is required. Following properties are supported:

  • Name (String): Name of the dashboard.
  • Identifier (String): Identifier of the dashboard.
  • Description (String): Description of the dashboard.
  • ProjectId (Integer): Project id where the dashboard belongs to, i.e., moves the dashboard to other project.
  • Content (Dictionary): Dashboard content as dictionary.

Example: Change dashboard background color to white.

let dashboard = DashboardById(1); // find dashboard
let content = dashboard.content; // get dashboard content
content.layout.Set("backgroundColor", "#ffffff"); // modify content
dashboard.Modify( // store modified content back to the dashboard
  #{ "Content": content }
);

Example: Remove "Filter" dashboard variable from all dashboards in project.

let dashboards = ProjectById(1).Dashboards;
dashboards.{ // loop through dashboards
  let content = _.content; // get dashboard content
  content["variables"].Remove("Filter"); // modify content
  _.Modify( // store modified content back to the dashboard
    #{ "Content": content }
  );
};

Example: Move dashboards from a project to other.

let sourceProjectId = 1;
let targetProjectId = 2;
ProjectById(sourceProjectId).Dashboards.{
  _.Modify(
    #{ "ProjectId": targetProjectId }
  );
};

Function to get dashboard by dashboard id:

Function Parameters Description
DashboardById
  • Dashboard id (Integer)

Returns dashboard by given dashboard id. Returns the Dashboard object if such exists and user has permissions to it. Throws an exception if dashboard doesn't exist or user doesn't have permissions to it. GenericRead permission to the project that contains the dashboard is required.