Lifecycle Hook Scripts
| Hook Point |
Description |
Sample Scripts |
| startBursting |
Runs once before bursting begins |
fetch_distribution_details_from_database.groovy
fetch_distribution_details_from_csv_file.groovy
skip_current_file_distribution_if.groovy |
| endExtractDocument |
Runs after EACH burst document is extracted |
add_and_format_page_numbers.groovy, exec_pdftk_background.groovy, overlay.groovy, merge_with_external_files.groovy, encrypt.groovy, zip.groovy, curl_payslip2portal.groovy, curl_invoice2portal.groovy, curl_paystub2portal.groovy |
| endDistributeDocument |
Runs after EACH document is distributed |
curl_ftp.groovy, curl_sftp.groovy, rclone_sync_cloud.groovy, copy_shared_folder.groovy, batch_pdf_print.groovy, print.groovy, email_html_cid_embedded_images.groovy |
| endBursting |
Runs once after all documents processed |
(User-created summary/notification scripts) |
Document Manipulation (Post-Extraction)
| Script |
What It Does |
Example Use Case |
add_and_format_page_numbers.groovy | Adds page numbers to PDF | "Page 1 of 3" footer on payslips |
exec_pdftk_background.groovy | Applies background template | Company letterhead on all invoices |
overlay.groovy | Overlays images/text | "CONFIDENTIAL" watermark on sensitive docs |
merge_with_external_files.groovy | Merges with other PDFs | Attach terms & conditions to contracts |
encrypt.groovy | Password-protects PDF | Email payslips with SSN as password |
zip.groovy | Compresses to ZIP | Bundle all documents for one customer |
File Transfer & Upload (Post-Distribution)
| Script |
Protocol |
Use Case |
curl_ftp.groovy | FTP | Upload to legacy FTP server |
curl_sftp.groovy | SFTP/SSH | Secure upload to partner servers |
rclone_sync_cloud.groovy | Cloud (S3, GDrive, Dropbox) | Archive to cloud storage |
copy_shared_folder.groovy | Network share | Copy to department folder |
ant_ftp.groovy | FTP (Ant-based) | Legacy FTP uploads |
ant_scp_sftp.groovy | SCP/SFTP (Ant-based) | Legacy secure transfers |
Portal Publishing (Post-Extraction)
| Script |
Target |
Auto-Creates User? |
curl_payslip2portal.groovy | WordPress (payslip CPT) | Yes |
curl_invoice2portal.groovy | WordPress (invoice CPT) | Yes |
curl_paystub2portal.groovy | WordPress (paystub CPT) | Yes |
Email & Printing (Post-Distribution)
| Script |
Purpose |
email_html_cid_embedded_images.groovy | Embed images directly in HTML emails (no external attachments) |
ant_mail.groovy | Send emails via SMTP (Ant-based) |
batch_pdf_print.groovy | Print multiple documents at once |
print.groovy | Print individual documents |
Dynamic Data Fetching (Pre-Bursting)
| Script |
Source |
Use Case |
fetch_distribution_details_from_database.groovy | Database (JDBC) | Fetch email recipients from customer table |
fetch_distribution_details_from_csv_file.groovy | CSV file | Read distribution list from external file |
skip_current_file_distribution_if.groovy | Custom condition | Skip distribution for inactive customers |