-
Notifications
You must be signed in to change notification settings - Fork 15
Example | Presence Report
Configuration files, extensions, and templates can be found in the repo at https://github.com/MyPureCloud/open-data-exporter/tree/master/src/examples/presence_report.
This report retrieves user presence and routing status detail data and writes it out to a user-centric report.
- This request is of type
usersDetailsQuery
, which makes an analytics query for presence and routing status change detail data. - The strategy is single, but getAllPages is true, so the query is repeated until the analytics resource returns an empty data set to indicate that all results have been retrieved. The results from each request are aggregated into a single data set.
- The body of the query uses the value from
def.vars.previousInterval
to dynamically gather data from the previous interval relative to whenever the job is executed.
- This request is of type
getUsers
, which makes an API request to retrieve user configuration data - The strategy is single, but getAllPages is true, so the query is repeated until all provided users have been retrieved. The results from each request are aggregated into a single data set.
- The
populate_user_ids_transform
is applied before the request is executed to manipulate the request object itself. The transform aggregates a collection of user IDs and sets the collection asparameters.id
on the request object. This allows the request to dynamically determine the IDs that should be retrieved based on the results of a previous request.
This transform invokes the aggregateUserData
extension module function to organize the results of presence_detail_request
into a single collection based on the user, as well as take other data manipulation steps to arrange the data for templating.
This transform is applied before user_resolution_query
is executed to manipulate the request object itself. The transform aggregates a collection of user IDs and sets the collection as parameters.id
on the request object. This allows the request to dynamically determine the IDs that should be retrieved based on the results of a previous request.
This transform has a single expression that invokes the dataOperations
module's write_data
function to write out the data object to a file for debugging purposes.
This template references an external template file and defines a filename with a template that includes the execution date.
This defines where the template output will be stored.
This configuration:
- Loads the extension file into
def.presence_module
- Defines an execution plan to execute
presence_detail_request
,user_resolution_query
,agg_user_data_transform
, thenwrite_data
- Processes the
presence_detail_template
template - Exports the template using
presence_detail_export
- Defines a custom interval of 1 hour (
PT1H
)
This job executes the presence_detail_config
configuration.