Render RML Template with Parameter using ETL

This entry guide will show you how to render a RML template with parameters using the ETL module. Attached FruitSales.zip file contains the DS, Composite DS and RML sample that was used for this guideline.

Prerequisite

Save the FruitSales.ds in below repository
/ElixirSamples/DataSource/FruitSales.ds

Save the FruitSalesWithParam.ds and FruitSalesWithParam.rml under below repository

/User/admin/FruitSalesWithParam.ds
/User/admin/FruitSalesWithParam.rml

  1. Go to ETL module

  1. Create new ETL chainset e.g Render Report and leave the Copy Form as a default value

  1. Add a new Chains e.g Run Report and leave the Copy From value as a default

  1. Add a new Steps - JSON Record

  1. Edit the JSON Record steps as below. Under Merge Order field select ‘Upstream overrides this’ and under JSON parameter field key in as below:
{
    "rml" : "/User/admin/FruitSalesWithParam.rml",
    "mimeType" : "application/pdf",
    "Fruit" : "Apple"
}

  1. Next is to add the Ambience RML runtime step

  1. Leave all value as default in Edit Step

  1. Final step is to add another step called HTTP Endpoint

  1. On Edit Step, leave all as a default and save it.

  1. Run the step and you will see the log result in Results field

  1. Below are the link to visit the endpoint result

http://localhost:1730/etl/endpoint-bytes/Render Report/Run Report

You can POST to this endpoint to override the Fruit (for example using cURL or PostMan)

http://localhost:1730/etl/endpoint-bytes/FruitSalesWithParam/Run?Fruit=Orange

FruitSales.zip (3.1 KB)