Declaring Actions
Declaring Actions
To declare actions, do either or both of the following tasks in a KPI class:
-
Within the <kpi> element, include one <action> element for each action.
This element specifies the name of an action available within this KPI class; the user interfaces use this information to create lists of available actions for the users. For example:
<kpi xmlns="http://www.intersystems.com/deepsee/kpi" name="Holefoods Actions"> <action name="ActionA"/> <action name="ActionB"/> <action name="ActionC"/> </kpi>
For information on <action>, see Reference Information for KPI and Plug-in Classes.
-
Override the %OnGetActionList() callback method of your KPI class. This method has the following signature:
ClassMethod %OnGetActionList(ByRef pActions As %List, pDataSourceName As %String = "") As %Status
Where pActions is an array with the following nodes:
Node Value pActions Number of actions pActions(n) Details for the nth action. This is a $LISTBUILD list that consists of the following items: -
A string that equals the logical action name
-
A string that equals the corresponding display name
And pDataSourceName is for future use.
For example:
ClassMethod %OnGetActionList(ByRef pActions As %List, pDataSourceName As %String = "") As %Status { set newaction=$LB("New Action","New Action Display Name") set pActions($I(pFilters))=newaction quit $$$OK }
-