docs.intersystems.com
InterSystems IRIS Data Platform 2019.2  /  Implementing InterSystems IRIS Business Intelligence  /  Defining Custom Actions

Implementing InterSystems IRIS Business Intelligence
Defining the Behavior of Actions
Previous section           Next section
InterSystems: The power behind what matters   
Search:  


Defining the Behavior of Actions
To define custom actions, you must both declare the actions and define their behavior.
Declaring Actions
To declare actions, do either or both of the following tasks in a KPI class:
Defining the Behavior of the Actions
To define the behavior of the actions, override the %OnDashboardAction() callback method of your KPI class. This method has the following signature:
classmethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject) as %Status
The system executes this callback when a user invokes an action on a dashboard. pAction is the logical name of the action. pContext is an object that contains information about the currently selected scorecard row and that provides a way for the method to return commands to the dashboard; the next sections give the details.
A simple example is as follows:
ClassMethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject) As %Status
{
 Set sc = $$$OK
 Try {
      If (pAction = "Action 1") {
              //this part defines Action 1
              //perform server-side actions
          }
         Elseif (pAction="Action 2")
         {
                //this part defines Action 2
                //perform other server-side actions
                 }
        }
        Catch(ex) {
                Set sc = ex.AsStatus()
        }
 Quit sc
}
This method defines two actions, Action 1 and Action 2.
Note:
Because %OnDashboardAction() is a class method, you do not have access to %seriesNames or other properties of the KPI class from within this method (no class instance is available from the method).


Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-10-17 05:24:16