DEE Template Orders

This section provides an overview of DEE template orders.

Template Orders

DEE supports order templates. These templates are DEE Orders that you can pre-configure with placeholders which can be filled in when executing the template order. Compared to a normal DEE Order, a template can contain placeholders which will be replaced by the values provided for the execution.

The placeholders in the template order follow the below format:

{{placeholder_key}}

Executing Template Orders

Register Template Order

Template Orders can automatically be registered by adding the Template Order Json file into the data.extraction.templates.base.dir.path directory.

Or the following services also expose methods to add/update and remove a template:

  • addTemplateOrder/{orderName} - Registers the provided JSON DeeOrder provided in the REST body.
  • removeTemplateOrder/{orderName}) - Removes a template order with the provided name

Below is an example of registering a template order through the REST services:

URL

.../connectors/rest/dee/VERSION/addTemplateOrder/MyNewTemplateOrder

JSON POST Body

{
  "name": "Any_Order_Name",
  "maxMdxNbRetries": 2,
  "priority": "NORMAL",
  "queries": [
    {
      "@type": "MdxQuery",
      "mdx": "select * from [cube] where {{MDX_FILTER_PLACEHOLDER}}"
    }
  ],
  "output": {
    "@type": "fileOutput",
    "columns": [
      {
        "@type": "levelOutputColumn",
        "dimensionName": "dim1",
        "hierarchyName": "hier1",
        "levelName": "lvl1"
      },
      {
        "@type": "measureOutputColumn",
        "name": "measure1",
        "format": "{{FORMATTER_PLACEHOLDER}}",
        "valueIfNull": "N/A"
      }
    ]
  }
}

Here we have a placeholder in the MDX statement as well as in the Formatter of the measure output column.

Read more about DEE Order Structure.

Executing Template Orders

Template orders can be executed by calling the /submitTemplateOrders endpoint and sending the JsonTemplateOrder object as seen below:

URL

.../connectors/rest/dee/VERSION/submitTemplateOrders

JSON POST Body

{
  "templateOrderName": "MyNewTemplateOrder",
  "templatePlaceholders": {
    "MDX_FILTER_PLACEHOLDER": "Date=Today",
    "FORMATTER_PLACEHOLDER": "##.##"
  }
}