The main purpose of the core module (sap.apf.core) is to handle and process analysis paths. A path and its steps are created, accessed, and processed using the APF API. During path processing, the following tasks are executed going through all steps in the order of their positions in the analysis path:
-
Execute the OData requests of the steps
-
Supply the representations of the steps with the response data
-
Notify the application UI using a callback function
In addition, the path logic accumulates filters that are derived from selections made in representations, and applies those filters in subsequent OData requests.
An analysis path contains an ordered sequence of one or more analysis steps.
A step is created using the APF API method createStep(<id>,<callback>). It is inserted at the end of the path. The first method parameter is a unique identifier, which refers to the configuration entity that defines the step. The second parameter supplies a callback function, which is called once after the step has been created and processed.
Path processing is triggered using the APF API method updatePath(<callback>). The callback function is called each time after a step has been processed.
The following runtime objects exist:
-
A
stepobject consists of arequestobject and abindingobject. -
A
requestobject defines an OData server request. It creates and processes the OData request, processes the response, and sends the response data to the corresponding step. -
The
bindingobject sends the response data to the selectedrepresentationobject. Abindingobject associates a step with one or morerepresentationobjects and identifies and handles therepresentationobject that is currently selected. Thebindingobject also defines how the selected representation translates its selection into a filter object. -
A
representationobject wraps a chart, a table, or any other representation of data. When the user switches the representation, a differentrepresentationobject is selected and supplied with data. -
A
filterobject represents the selections made on the charts.
The relation between the objects described above is depicted in the following figure:
Runtime Objects of a Path
The steps are processed in the order of their positions in the path. The first step is processed first. The filter resulting from the first step is used to process the second step, and so on.
To describe the processing of an analysis path in more details, the following variables are relevant:
|
Variable |
Description |
|---|---|
|
|
Path of length n |
|
|
Step |
|
|
Request for step |
|
|
Binding for step |
|
|
Selected representation object for step |
|
|
Filter object associated to step |
|
|
Filter for the entire path. This filter is either empty or it is the filter set by the APF API method |
The processing of step S_i begins with requesting the filter F_(i-1) of the previous step. Note that for step S_1, this is filter F_0.
Step S_i is further processed by sending an OData request R_i to the server. The filter expression of request R_i is defined by the previous filter F_(i-1).
When request R_i returns successfully, it sends its response data to the selected representation object RO_i_s. This representation object then creates its own filter based on this data and its own UI selections. This filter can be requested by the subsequent step.
The filter F_i is defined as a conjunctive accumulation of the previous filter F_(i-1) and the filter defined by the selected representation object (RO_i_s). The filter F_i is used for processing step S_(i+1).
Filter F_0 is defined by URL parameters passed to the application, such as SAPCLIENT, and by filters. In the figure above, F_0 is represented as the "Filter/Context" object directly associated to the path object.
