Using DEE Template Orders

This section provides an overview of the DEE template orders included in the Accelerator.

DEE Template Orders

DEE Template orders are one way of interacting with the DEE. For more information about the DEE, see Data Extraction Engine.

Included template orders

The Accelerator provides template orders for:

  • The extraction of trade-level data for loading into appropriate summary cubes
  • CRIF-format extraction of StandardisedApproachCube data

Extraction orders are located in the directory frtb-starter/src/main/resources/DEETemplateOrders

Extraction order JSON file Details
CrifExtraction StandardisedApproachCube export in CRIF format
IMACubeExport InternalModelApproachCube data export for load into IMASummaryCube
IMADRCCubeExport IMADRCCube data export for load into IMADRCSummaryCube
PLCubeExport PLCube data export for load into PLSummaryCube

Executing Template Orders

To execute template orders, we use the submitTemplateOrders POST REST endpoint.

Examples

URL

http://localhost:8080/frtb-starter/connectors/rest/dee/v1/submitTemplateOrders

Body - Summary Cube Extraction

The following example can be used for IMACubeExport, IMADRCCubeExport, and PLCubeExport by changing the templateOrderName to the relevant template order name.

{
  "templateOrderName": "PLCubeExport"
}

Body - CRIF Extraction

{
  "templateOrderName": "CrifExtraction",
  "templatePlaceholders": {
    "AsOfDate": "2018-06-29"
  }
}

Diving into the template

Template orders describe the name of the template order, the query being executed, and the format of the output file.

Query

Within the query object we state the levels (locations), measures (measureSelections), and the cube (pivotId). Additionally, we describe the context values, for example a description is provided for ReferenceCurrency.

Output

Within the output object we state the directory and name of the output file. Lastly, we describe where each column will get its data.

The output file’s columns map to one of the following types:

  • Level (levelOutputColumn)

  • Measure (measureOutputColumn)

  • Static value (echoOutputColumn)

  • Value which requires some logic (extractProcValueOutputColumn)

    note

    These values are currently tied to measures which are often used as placeholders and may not appear in your query

Template Placeholders

We can use placeholders (templatePlaceholders) when we want to modify our template order each time before executing it. For example, in our CRIF template order we use the AsOfDate placeholder to describe the value of the AsOfDate level in our query. We can also use the same placeholder within our filename to distinguish between unique template orders.

Extraction Procedures

Not all columns come directly from the value of a measure or level, so in these cases we need to use an extraction procedure which can be found in the following directory:

frtb-activepivot/src/main/java/com/activeviam/frtb/ref/services/dee/impl/

  • For our summary cube template orders we use FRTBVectorExtractionProcedure to format vector output columns to what is expected by the ETL of summary cubes

  • For our CRIF extraction template order we use FRTBCrifExtractionProcedure for a majority of our output columns so that they appear in the correct format