Skip to main content

Customizing Other Cube Callbacks

Customizing Other Cube Callbacks

The class %DeepSee.CubeDefinitionOpens in a new tab provides callback methods that you can override to customize the cube behavior further. This section describes some commonly overridden methods.

Also see %OnProcessFact() Callback and Filtering a Cube or Subject Area Dynamically, elsewhere in this page.

See the class reference for %DeepSee.CubeDefinitionOpens in a new tab for additional options.

%OnAfterProcessFact() Callback

The %OnAfterProcessFact() callback enables you to add custom code that runs after any given record is added or updated in the fact table of the cube.

ClassMethod %OnAfterProcessFact(pID As %String, ByRef pFactArray As %String, pUpdateStatus As %Status) as %Status

The system passes the following information to this callback:

  • pID is the id of the row in the source data being processed.

  • pFacts is an array containing the values that will be used for the row, subscripted by fact name.

  • pUpdateStatus is the status about to be returned by %ProcessFact(). If an error is passed in, this error will already be logged in the Business Intelligence logs and the ^DeepSee.BuildErrors global.

The %ProcessFact() method ignores the value returned by this method.

%OnGetDefaultListing() Callback

The %OnGetDefaultListing() callback enables you to programmatically specify the name of the listing to use, in the case where the system uses the default listing. The signature of this method is as follows:

ClassMethod %OnGetDefaultListing() as %String

This callback is called when a user requests the default listing and has no effect when a specific listing is requested. The following shows an example:

ClassMethod %OnGetDefaultListing() As %String {     Quit "Listing By Product" }

You could use this, for example, to check the role to which a user belongs and display a suitable listing for that role.

%OnExecuteListing() Callback

In some cases, additional setup work is required before a listing query can run.

To do this, implement the %OnExecuteListing() method in your cube definition class:

ClassMethod %OnExecuteListing(pSQL As %String) as %Status

The system calls this method immediately before it executes a listing query. When the system calls this method, it passes the value pSQL, which is the listing query that will be executed.

%OnAfterBuildCube() Callback

The %OnAfterBuildCube() callback, if defined, is called after the cube is built.

ClassMethod %OnAfterBuildCube(pBuildStatus As %Status, pBuildErrors As %Boolean = 0) As %Status

The system calls this as the last step in the %BuildCube method in %DeepSee.UtilsOpens in a new tab. The system passes the following information to this callback:

  • buildStatus is the status of the cube build thus far

  • factErrorCount is the count of any facts for which there were build errors.

Your implementation should return an instance of %StatusOpens in a new tab.

This method is called before the lock on the cube build is released, which means that only one process can execute the callback at once.

FeedbackOpens in a new tab