Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%DeepSee] >  [AbstractKPI]
Private  Storage   

abstract class %DeepSee.AbstractKPI extends %CSP.Page, %ZEN.DataModel.ObjectDataModel, %DeepSee.QuerySource

This is a common base class to different types of KPI.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
4 11 40


Summary

Properties
%filterValues %fromCache %id %message
%rangeLower %rangeUpper %seriesCount %seriesNames
%source %thresholdLower %thresholdUpper

Methods
%AddToSaveSet %ApplyDefaults %CheckResource %ClassIsLatestVersion
%ClassName %ClearKPICache %ConstructClone %CreateKPIController
%CreateModelInstance %DeleteModel %DispatchClassMethod %DispatchGetModified
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %Extends
%GetFilterDisplayValue %GetFilterKey %GetFilterLogicalValue %GetJSValidationCode
%GetKPICaption %GetKPICaptionName %GetKPIClassTimeStamp %GetKPIName
%GetKPIPropertyCaption %GetKPIValue %GetKPIValueArray %GetParameter
%GetPropertyInfo %GetSourceType %InvokeAction %IsA
%IsAsync %IsCacheable %IsModified %IsPublic
%IsReadOnly %New %NormalizeObject %ObjectModified
%OnCopyDataFromModel %OnCopyDataToModel %OnDashboardAction %OnDeleteModel
%OnDeleteSource %OnExecute %OnGetActionList %OnGetFilterList
%OnGetFilterMembers %OnGetKPICaption %OnGetKPIPropertyInfo %OnGetListingResultSet
%OnGetListingSQL %OnGetPropertyInfo %OnInvokeAction %OnLoadKPI
%OnLoadModel %OnNewSource %OnOpenSource %OnSaveSource
%OnStoreModel %OnSubmit %OpenModel %OriginalNamespace
%PackageName %PrintValue %RemoveFromSaveSet %SaveModel
%SerializeObject %SetModified %SubmitHandler %ValidateObject
ConvertParameter Decrypt Encrypt EscapeHTML
EscapeURL HyperEventCall HyperEventHead Include
InsertHiddenField InsertHiddenFields IsPrivate Link
OnHTTPHeader OnPage OnPageError OnPostHTTP
OnPostHyperEvent OnPreHTTP OnPreHyperEvent Page
QuoteJS RewriteURL ShowError StartTimer
StopTimer ThrowError UnescapeHTML UnescapeURL

Subclasses
%DeepSee.KPI %DeepSee.KPIWorksheet Ens.BusinessMetricKPI

Parameters

• parameter FORCECOMPUTE = 0;
If true, always recompute the value of this KPI when used within an MDX query.
Typically a KPI (especially a plug-in) used within an MDX query does not need to be recalculated unless the class defining the KPI is recompiled. For KPIs that depend on external data, it may be convenient to always recompute the KPI value. Setting this parameter to true has the same effect as recompiling the KPI class before each use.
• parameter PUBLIC = 1;
If true, this KPI is available for public use within dashboard (subject also to the RESOURCE parameter).
If false it is not listed as an available KPI within the dashboard tools, but it can be used within pivot tables and may be visible within the Analyzer.
• parameter READONLYMODEL = 1;
KPI cannot be modified from a client (part of DataModel API).
• parameter RESOURCE;
The resource needed to use this KPI:
If defined and the current user holds the USE privilege on this resource, then the user may view (run queries against) this item.

Properties

• property %filterValues as %ZEN.proxyObject(ZENHIDDEN=1);
Proxy object containing filter values from the client.
• property %fromCache as %String(ZENHIDDEN=1) [ InitialExpression = 0 ];
Set true if the current results are from the cache.
• property %message as %String(ZENHIDDEN=1);
Message to be displayed by dashboard widget.
• property %rangeLower as %Double(ZENHIDDEN=1);
Lower range value for any meters connected to this KPI.
• property %rangeUpper as %Double(ZENHIDDEN=1);
Upper range value for any meters connected to this KPI.
• property %thresholdLower as %Double(ZENHIDDEN=1);
Lower threshold value for any meters connected to this KPI.
• property %thresholdUpper as %Double(ZENHIDDEN=1);
Upper threshold value for any meters connected to this KPI.

Methods

• method %ApplyDefaults()
Apply property defaults from the KPI model.
• classmethod %CheckResource() as %Boolean
Test if the current user has access to this KPI.
• classmethod %ClearKPICache() as %Status
Utility method. Clear all KPI cache entries for this KPI.
• classmethod %CreateKPIController(Output pController As %ZEN.Auxiliary.dataController, pKPIName As %String, ByRef pFilters As %String, pCellContext As %String = "", pParentQueryKey As %String = "") as %Status
Set up the context for and execute this KPI. Return the instance of data controller used to drive the KPI.
• classmethod %GetFilterDisplayValue(pFilter As %String, pValue As %String, pDataSourceName As %String = "") as %String
Given a filter and its logical value, return its display value.
• method %GetFilterKey() as %String
Utility method. Compute a hash code based on the current filter values for this KPI. This is used for caching KPI results.
• classmethod %GetFilterLogicalValue(pFilter As %String, pText As %String, pDataSourceName As %String = "", ByRef pFilterValues) as %String
Given a filter and its display value (pText), return its logical value. If there is not a one-to-one correspondence for logic and display values, then the result of this call is indeterminate.
• final classmethod %GetKPICaption() as %String
Return the caption for this KPI.
This is either: (a) the value returned by %OnGetKPICaption, (b) the value of the caption attribute in the KPI definition, or (c) the name of the KPI, in that order.
• classmethod %GetKPICaptionName(pName As %String = "") as %String
Return the caption as defined in the XML for this KPI.
• classmethod %GetKPIClassTimeStamp() as %String
Return the last modified date for this KPI class.
• classmethod %GetKPIName(pName As %String = "") as %String
Return the logical name in its original form for this KPI. pName is the canonic form of the name.
• classmethod %GetKPIPropertyCaption(pProperty As %String) as %String
Return the display name for a property within this KPI.
• classmethod %GetKPIValue(pKPIName As %String, Output pValue As %String, pKPIProperty As %String = "", pSeries As %String = "", ByRef pFilters As %String, pCellContext As %String = "", ByRef pCacheKey As %String, Output pPctComplete As %Integer, pParentQueryKey As %String = "", Output pKPIStatus As %Status) as %Status
Get a specific value from this KPI.
This is best used with simple KPIs implemented in manual mode as it can be expensive otherwise.
On return, pPctComplete indicates whether this value is completely computed (100) or in progress (that is, it is being computed by a background agent).
pCacheKey is the cache key associated with this request in the case of an asynchronous KPI. This is returned by reference.
pFilters is an array of filters and their (display) values.
pCellContext is the cell context passed in by the %KPI function.
• classmethod %GetKPIValueArray(pKPIName As %String, Output pValues As %String, pPropertyList As %List, ByRef pFilters As %String) as %Status
Get an array of values from this KPI.
pPropertyList is a $List of property names: $LB(prop1,prop2). On return, pValues contains an array of values of the properties listed in pPropertyList: pValues(n) = $LB(prop1,prop2)
Use "%series" in property list to get the series name
.
• classmethod %GetSourceType() as %String
Return the sourceType for this KPI
• classmethod %IsAsync() as %Boolean
Return true if this kpi should be computed asynchronously (for plug-ins).
• classmethod %IsCacheable() as %String
Return the cube this KPI is based on.
• classmethod %IsPublic() as %Boolean
Return true if this KPI is public.
• classmethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject, pDataSourceName As %String = "") as %Status
This callback is invoked from a dashboard when an action defined by this dashboard is invoked.
pAction is the logical name of the action.
pContext is a proxy object that contains various information about the action and provides a way for the method to return information to the client.
• method %OnExecute() as %Status
Get data for this KPI manually. This is implemented by subclasses that provide manual data.
• classmethod %OnGetActionList(ByRef pActions As %List, pDataSourceName As %String = "") as %Status
Callback to get additional actions for a KPI. This takes the form:
pActions($I(pActions))=$LB(name,caption)
• classmethod %OnGetFilterList(Output pFilters As %List, pDataSourceName As %String = "") as %Status
Callback to get additional possible filters for this KPI. This drives the list of filter selections for widget connected to this KPI. This takes the form:
pFilters($I(pFilters))=$LB(name,caption,value,multiSelect,dependsOn)
• classmethod %OnGetFilterMembers(pFilter As %String, Output pMembers As %List, pSearchKey As %String = "", pDataSourceName As %String = "", ByRef pFilterValues As %String) as %Status
Callback to get additional members for a KPI filter. This takes the form:
pMembers($I(pMembers))=$LB(text,value)
pSearchKey is the search key entered by the user, if applicable.
pFilterValues is an array of all current filter values.
• classmethod %OnGetKPICaption() as %String
This callback can return the (localized) caption for this KPI.
• classmethod %OnGetKPIPropertyInfo(ByRef pList As %String, pPropNo As %Integer, pModelId As %String = "") as %Status
Add additional properties beyond those defined in the KPI block. This takes the form:
pList(n) = name
pList(n,"defaultValue") = value
pList(n,"columnNo") = #
pPropNo is the number of next open slot in the list.
• classmethod %OnGetListingResultSet(ByRef pFilters As %String, ByRef pSelection As %String, pListingName As %String = "", Output pRS As %SQL.StatementResult) as %Status
This callback, if implemented, can prepare and execute a listing query used to provide a "detail listing" for this KPI. pFilters is an array of current filter values.
pListingName is the name of the listing to display. This is reserved for future use.
• classmethod %OnGetListingSQL(ByRef pFilters As %String, ByRef pSelection As %String, pListingName As %String = "") as %String
This callback, if implemented, returns the text of an SQL query used to provide a "detail listing" for this KPI.
pFilters is an array of current filter values: pFilters(name)=value.
pSelection is an array containing information about the current selected items in the pivot. It contains 2 values:
pSelection("selectedRange") contains the current selected cells in the pivot as a string in the form "startRow,startCol,endRow,endCol" (1-based). "" if no cells are selected.
pSelection("rowValues") contains a csv-list of "row" values for the selected rows in the pivot (similar to the $$$VALUELIST value used for OpenWindow URLs. This may contain "\," for "," within the data values.
pListingName is the name of the listing to display. This is reserved for future use.
This method is simply a convenient alternative to the %OnGetListingResultSet method. It takes precedence over the %OnGetListingResultSet method.
• final classmethod %OnGetPropertyInfo(pIndex As %Integer, ByRef pList As %String, pExtended As %Boolean = 0, pModelId As %String = "") as %Status
Return list of properties. This is part of the DataModel API; this version returns the set of properties defined by this KPI.
• method %OnLoadKPI() as %Status
Notify subclass that KPI is has just be executed. This is a good place to override properties, such as range and threshold.
• method %OnLoadModel(pSource As %RegisteredObject) as %Status
This callback method does the actual work of loading values from the source object.
• classmethod %PrintValue(pKPIProperty As %String = "", pSeries As %String = "", ByRef pFilters As %String, pAsync As %Boolean = 0) as %Status
Get the value of the given KPI property and print it to the console.
This is provided as a diagnostic aid for KPIs. The KPI is forced to execute in the foreground, even if it is defined to be asynchronous, unless pAsync is set to true (1).
• classmethod OnPage() as %Status
Draw the test page.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.