Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Example | Presence Report

Tim S edited this page Jan 13, 2017 · 1 revision

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.

Table of Contents

Overview

This report retrieves user presence and routing status detail data and writes it out to a user-centric report.

Configuration

requests

presence_detail_request

  • 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.

user_resolution_query

  • 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 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.

transforms

agg_user_data_transform

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.

populate_user_ids_transform

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.

write_data

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.

templates

presence_detail_template

This template references an external template file and defines a filename with a template that includes the execution date.

exports

presence_detail_export

This defines where the template output will be stored.

configurations

presence_detail_config

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, then write_data
  • Processes the presence_detail_template template
  • Exports the template using presence_detail_export
  • Defines a custom interval of 1 hour (PT1H)

jobs

presence_detail_job

This job executes the presence_detail_config configuration.

Example

img

Clone this wiki locally