FCCS Groovy: How to properly write CSV files to outbox?
Summary:I'm trying to write a Groovy script for FCCS that retrieves data from an external API and writes it to CSV files in the outbox, then triggers a data load rule. I'm having issues specifically with the file writing part of the script.Here's the relevant part of my code:
// Step 1: Connections
def apiConn = operation.application.getConnection("ExternalAPI")
def dmConn = operation.application.getConnection("DM")
// Step 2: Call External API
HttpResponse<String> dataResp = apiConn.get("/").asString()
if (!(200..299).contains(dataResp.status)) {
throwVetoException("❌ API failed: ${dataResp.status} - ${dataResp.statusText}")
}
// Explicit cast to List<Map> for strict Groovy typing in FCCS
def jsonData = (List<Map>) new groovy.json.JsonSlurper().parseText(dataResp.body)