I created two CSV Config files one for Tax Rate and another for Description. The Tax Rate CSV gets written first using this code that I wrote in a JSR223 PostProcessor.
temp_tax = new FileOutputStream("temp_tax_rate.csv", true);
file = new PrintStream(temp_tax);
String tax_rate = source[parent]["tax_rate"]
file.println(tax_rate+","+tax_rate+","+tax_rate)
file.close();
temp_tax.close();`
Then another JSR223 PostProcessor to write into the Description CSV
def input_data(webSite,productClass,cityOrTown,stateOrProvince,postalCode,final_tax-1,final_tax-2,final_tax-3,taxable_amount-1,taxable_amount-2,taxable_amount-3,tax_amount-1,tax_amount-2,tax_amount-3)
{
temp_data = new FileOutputStream("Tax_Description_D1_Non-Reseller.csv", true);
file = new PrintStream(temp_data);
file.println(webSite+","+productClass+","+cityOrTown+","+stateOrProvince+","+postalCode+","
+final_tax-1+","+final_tax-2+","+final_tax-3+","
+taxable_amount-1+","+taxable_amount-2+","+taxable_amount-3+","
+tax_amount-1+","+tax_amount-2+","+tax_amount-3);
file.close();
temp_data.close();
}
After writing to the Tax Rate csv the Description Postprocessor also needs to call the tax_rate variable from the CSV config to do some computation but every time it is called it returns an error which i logged
2021-08-20 17:02:51,208 INFO o.a.j.e.J.JSR223 PostProcessor for Description: Tax Rate<EOF>
My guess is that the description postprocessor is still looking at the outdated Tax Rate csv where nothing has been written on it yet instead of the written version of it. This is my current project file structure