%DeepSee.AbstractKPI
Class %DeepSee.AbstractKPI Extends (%CSP.Page, %ZEN.DataModel.ObjectDataModel, %DeepSee.QuerySource) [ Abstract, System = 4 ]
This is a common base class to different types of KPI.
Parameters
READONLYMODEL
Parameter READONLYMODEL = 1;
KPI cannot be modified from a client (part of DataModel API).
PUBLIC
Parameter PUBLIC As BOOL = 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.
RESOURCE
Parameter RESOURCE As STRING;
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.
FORCECOMPUTE
Parameter FORCECOMPUTE As BOOL = 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.
Properties
%thresholdLower
Property %thresholdLower As %Double(ZENHIDDEN = 1);
Lower threshold value for any meters connected to this KPI.
%thresholdUpper
Property %thresholdUpper As %Double(ZENHIDDEN = 1);
Upper threshold value for any meters connected to this KPI.
%rangeLower
Property %rangeLower As %Double(ZENHIDDEN = 1);
Lower range value for any meters connected to this KPI.
%rangeUpper
Property %rangeUpper As %Double(ZENHIDDEN = 1);
Upper range value for any meters connected to this KPI.
%message
Property %message As %String(ZENHIDDEN = 1);
Message to be displayed by dashboard widget.
%filterValues
Property %filterValues As %ZEN.proxyObject(ZENHIDDEN = 1);
Proxy object containing filter values from the client.
%fromCache
Property %fromCache As %String(ZENHIDDEN = 1) [ InitialExpression = 0 ];
Set true if the current results are from the cache.
%cacheKey
Property %cacheKey As %String(ZENHIDDEN = 1) [ Internal ];
Cache key used for this query.
%cubeName
Property %cubeName As %String(ZENHIDDEN = 1) [ Internal ];
Internal property that holds the current cube name used by this KPI (if any). Used for caching.
%queryKey
Property %queryKey As %String(ZENHIDDEN = 1) [ Internal ];
Internal property that holds the current MDX query key used by this KPI (if any). Used for caching.
%cellContext
Property %cellContext As %ZEN.proxyObject(ZENHIDDEN = 1) [ Internal, MultiDimensional ];
Internal property that holds the current cell context when this KPI is invoked from within an MDX statement.
(Note: type is an object to prevent MVC code generation).
Methods
%IsPublic
ClassMethod %IsPublic() As %Boolean
Return true if this KPI is public.
OnPage
ClassMethod OnPage() As %Status
Draw the test page.
%CheckResource
ClassMethod %CheckResource() As %Boolean
Test if the current user has access to this KPI.
%GetKPIName
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.
%GetKPICaptionName
ClassMethod %GetKPICaptionName(pName As %String = "") As %String
Return the caption as defined in the XML for this KPI.
%GetKPICaption
ClassMethod %GetKPICaption() As %String [ Final ]
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.
%OnGetKPICaption
ClassMethod %OnGetKPICaption() As %String
This callback can return the (localized) caption for this KPI.
%OnGetListingSQL
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.
%OnGetListingResultSet
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.
%GetSourceType
ClassMethod %GetSourceType() As %String
Return the sourceType for this KPI
%ApplyDefaults
Method %ApplyDefaults()
Apply property defaults from the KPI model.
%OnLoadModel
Method %OnLoadModel(pSource As %RegisteredObject) As %Status
This callback method does the actual work of loading values from the source object.
%OnLoadKPI
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.
%GetKPIPropertyCaption
ClassMethod %GetKPIPropertyCaption(pProperty As %String) As %String
Return the display name for a property within this KPI.
%OnGetPropertyInfo
ClassMethod %OnGetPropertyInfo(pIndex As %Integer, ByRef pList As %String, pExtended As %Boolean = 0, pModelId As %String = "") As %Status [ Final ]
Return list of properties. This is part of the DataModel API; this version returns the set of properties defined by this KPI.
%GetKPIPropertyInfo
ClassMethod %GetKPIPropertyInfo(Output pList As %String, pModelId As %String = "") As %Status [ Internal ]
Return information on properties defined in the KPI block. This takes the form:
pList(n) = name
pList(n,"caption") = displayed caption
pList(n,"defaultValue") = value
pList(n,"columnNo") = #
%OnGetKPIPropertyInfo
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.
%OnExecute
Method %OnExecute() As %Status
Get data for this KPI manually. This is implemented by subclasses that provide manual data.
%GetFilterList
ClassMethod %GetFilterList(Output pFilters As %List, pDataSourceName As %String = "") As %Status [ Internal ]
Return list of possible filters for this KPI. This drives the list of filter selections for widget connected to this KPI. This takes the form:
pFilters(n)=$LB(name,caption,filterProperty,multiSelect,dependsOn)
%OnGetFilterList
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)
%GetFilterMembers
ClassMethod %GetFilterMembers(pFilter As %String, Output pMembers As %List, Output pDefaultValue As %String, pSearchKey As %String = "", pDataSourceName As %String = "", ByRef pFilterValues As %String) As %Status [ Internal ]
Return a list of possible filter values for a given filter. This takes the form:
pMembers(n)=$LB(text,value)
%OnGetFilterMembers
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.
%GetFilterDisplayValue
ClassMethod %GetFilterDisplayValue(pFilter As %String, pValue As %String, pDataSourceName As %String = "") As %String
Given a filter and its logical value, return its display value.
%GetFilterLogicalValue
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.
%GetActionList
ClassMethod %GetActionList(ByRef pActions As %List, pDataSourceName As %String = "") As %Status [ Internal ]
Return list of possible actions for this KPI. This drives the list of action selections for widget connected to this KPI. This takes the form:
pActions(n)=$LB(name,caption)
%OnGetActionList
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)
%InvokeDashboardAction
ClassMethod %InvokeDashboardAction(pAction As %String, pContext As %ZEN.proxyObject, pDataSourceName As %String = "") As %Status [ Internal ]
Internal method that gets invoked from a client dashboard and dispatches to a user callback.
%OnDashboardAction
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.
%IsAsync
ClassMethod %IsAsync() As %Boolean
Return true if this kpi should be computed asynchronously (for plug-ins).
%IsCacheable
ClassMethod %IsCacheable() As %String
Return the cube this KPI is based on.
%GetKPIValue
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.
%PrintValue
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).
%CreateKPIController
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.
%GetKPIValueArray
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
.
%GetMDX
Method %GetMDX(Output pMDX As %String) As %Status [ Internal ]
Return an MDX statement to provide the KPI data.
%GetSQL
Method %GetSQL(Output pSQL As %String) As %Status [ Internal ]
Return an MDX statement to provide the KPI data.
%ClearKPICache
ClassMethod %ClearKPICache() As %Status
Utility method. Clear all KPI cache entries for this KPI.
%GetFilterKey
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.
%CreateLocalController
ClassMethod %CreateLocalController(Output pController As %ZEN.Auxiliary.dataController, pModelClass As %String, pModelId As %String, pCriteria As %ZEN.proxyObject) As %Status [ Internal ]
Utility method. Create a local instance of data controller to drive the KPI. This is used to get values from a KPI on the server.
%GetKPIClassTimeStamp
ClassMethod %GetKPIClassTimeStamp() As %String
Return the last modified date for this KPI class.