1 You need to pass Event id to the package from url logger as a command line parameter
const fs = require("fs");
const { spawn } = require("child_process");
try {
const WORKING_DIRECTORY = "C:\\Program Files\\DB Software Laboratory\\Advanced ETL Processor Enterprise\\";
const fileToExecute = "C:\\Program Files\\DB Software Laboratory\\Advanced ETL Processor Enterprise\\aetlcl.exe";
const objectId = 8687
const parameters = [objectId,logId];
logger.info(parameters);
spawn(fileToExecute, parameters, { cwd: WORKING_DIRECTORY, detached: true });
return 200;
} catch (err) {
logger.error(`Caught an error: ${err.message ? err.message : err}`);
return 500; // Any error caught here results in a 500 status
}
2 Than you need read this command line parameter and save it in to the variable
Here is the script:
begin
SetVariable('<EventId>',CommandLineParameter(2));
Result:=True;
end;
3 Next step is to pass this variable as a parameter to the report
Please read the following article
www.etl-tools.com/wiki/advanced-etl-processor/advanced/reports/
4 Since the data is in JSON format we have to covert it into proper dataset using SQL so it can be used as the source for the report.
DECLARE @json NVarChar(max)
select top 1 @json=text_field_02 from event_log
select * from OpenJson(@json)
WITH ("candidate _ID" VARCHAR(100) '$."candidate _ID"',
"name" VARCHAR(100) '$.name',
"mobile" VARCHAR(100) '$.mobile',
"related_recruiter" VARCHAR(100) '$.related_recruiter',
"is_filled_by_recuriter" VARCHAR(100) '$.is_filled_by_recuriter',
"resume" VARCHAR(100) '$.resume',
"parent_entry_id" VARCHAR(100) '$.parent_entry_id',
"recruiter_email" VARCHAR(100) '$.recruiter_email',
"recruiter_name" VARCHAR(100) '$.recruiter_name',
"join_date" VARCHAR(100) '$.join_date',
"recruiter_code" VARCHAR(100) '$.recruiter_code'
)