Data Action Code Interactions
A data action interacts with Oracle Analytics code when it creates a user interface field, and when a user invokes a data action.
Create the Field for a New Data Action Instance
This interaction starts when Oracle Analytics wants to render a data action user interface field. To do so, it:
- Creates a
PanelGadgetInfo
that acts as the parentGadgetInfo
for theGadgetInfos
that the data action returns. - Calls
getGadgetInfos()
on the data action. - Adds the data action's
GadgetInfos
as children of thePanelGadgetInfo
created in the first step. - Creates the
PanelGadgetView
that renders thePanelGadgetInfo
. - Sets the
HTMLElement
that's the container of thePanelGadgetView
. - Registers the
PanelGadgetView
as a childHostedComponent
of aHostedComponent
that's already attached to theHostedComponent
tree.This renders the data action's gadgets inside the Panel gadget in the order they appear in the array returned by
getGadgetInfos()
.
Invoke a Data Action
This interaction starts when the user invokes a data action through the Oracle Analytics user interface (for example, from the context menu on a data point in a visualization).
In response to the user interaction, the code:
- Publishes an
INVOKE_DATA_ACTION
event containing the data action's ID, theDataVisualization
that the data action is invoked from, and aTransientVizContext
object. - The
DataActionManager
handles this event by:- Obtaining the data action instance from its ID.
- Obtaining the
LogicalFilterTrees
for the marked data points in the specifiedDataVisualization
. - Constructing a
DataActionContext
that contains all the information to pass to the data action's target. - Calling
invoke(oDataActionContext)
on the data action.