Skip to main content
Version: 🚧 Next

Automatic report upload to SFTP

What does automatic report upload do?​

Automatic report upload generates a report on a schedule and delivers it straight to the clients SFTP server, with no manual trigger or download needed. See Reports and Data Warehouse for background on how reports and the data warehouse work.

Preconditions​

  • If the customer uses data warehouse, the organization's data warehouse feed must be active, so the gold-layer tables the report query reads from are populated. See Data Warehouse for the general infrastructure context.
  • The FINANCIAL_SP_MANAGEMENT module must be enabled on the FSP.
  • The FINANCIAL_SP_REPORTING module must be enabled on the FSP.

Instructions​

The steps below must be configured in this order, since each one depends on the event the previous one fires.

1. Define the report​

The customer needs their report to be available in the FSP, as described in Reports.

2. Enable the report on the FSP​

Add the report to the reports setting of the FINANCIAL_SP_REPORTING module for the FSP. Leave out fromDate/tillDate parameters — they cannot be combined with a scheduled report provider.

3. Configure the SFTP destination​

Configure an FTP provider using SFTPProvider, pointing at the FSP's own server.

Example

{
"identifier": "SFTP provider - <client>",
"state": "ACTIVE",
"healthCheckLevel": 2,
"implementationClass": "eu.myharmoney.app.providers.ftp.implementations.SFTPProvider",
"resourceUri": "$vault{<client>_FILE_TRANSFER_resourceUri}",
"settings": {
"DIRECTORY": "$vault{<client>_FILE_TRANSFER_settings_DIRECTORY}",
"VERBOSE": false,
"authentication": {
"clientId": "$vault{<client>_FILE_TRANSFER_clientId}",
"clientSecret": "$vault{<client>_FILE_TRANSFER_clientSecret}"
}
}
}

4. Schedule the report generation​

Configure the Report Generation provider (ReportGenerationV3ScheduledProvider), with REPORT_IDENTIFIER matching the identifier from step 1 exactly.

Example

{
"identifier": "Scheduled - Generate Report - <client>",
"state": "ACTIVE",
"healthCheckLevel": 2,
"implementationClass": "eu.myharmoney.app.providers.scheduled.ReportGenerationV3ScheduledProvider",
"settings": {
"CRON_SCHEDULE": "0 4 * * *",
"REPORT_IDENTIFIER": "dossier-data",
"SUPPORTED_FSP": "$vault{<client>_SUPPORTED_FSP}",
"SYSTEM_USER": "$vault{<client>_SYSTEM_USER}"
}
}

More on relative dates here

5. Configure the generate action​

Add the GenerateReportV2 action on the FSP definition, listening to the GENERATE_REPORT_ASYNC event.

6. Configure the upload action​

Add the UploadReportToFileServerV2 action on the FSP definition, listening to the REPORT_GENERATED event, with providerIdentifier pointing at the SFTP provider from step 3.

REPORT_GENERATED fires for every report generated in the FSP, including reports generated from the UI. If only some reports belong on this SFTP server, list them in reportIdentifiers. Every other report is then skipped.

Example

{
"type": "EVENT",
"value": "REPORT_GENERATED",
"className": "eu.myharmoney.app.bll.executors.dossierstatustransition.UploadReportToFileServerV2",
"synchronous": false,
"enabled": true,
"settings": {
"providerIdentifier": "SFTP provider - <client>",
"filename": "${documentName}.csv"
}
}

✅ To test​

  1. Trigger the scheduled provider manually via Organizations > [org] > Triggers (or wait for the configured CRON_SCHEDULE).
  2. Confirm a report was generated in the FSP reporting module.
  3. Check that the file landed in the configured SFTP directory under the expected filename.