PADFoundationloggingrun-trackingfooterdurationfoundationcleanup
Run Finalizer
Closes out a flow run by calculating duration, setting final status, and building a formatted summary footer. Pairs with Variable Bootstrap and Run Header Initializer to provide complete run lifecycle tracking with duration and record counts.
0 copies
Section 1: Capture End Time and Calculate Duration
Section 2: Determine Final Status
Section 3: Build Run Footer
Usage Notes
- Place this pattern at the very end of your Main flow, after all business logic has completed
dtRunStartmust already exist from the Variable Bootstrap pattern — the duration calculation subtracts start from endnumErrorCountandnumRecordsProcessedare expected to have been incremented during the flow processing loopsstrRunFooterproduces a single pipe-delimited summary line matching the format of the Run Header Initializer output- Use
strRunFooteras the final entry written by Log Detail Writer so every log file ends with a complete execution summary boolSuccessprovides a simple flag for conditional logic after finalization (e.g., send success email vs. failure alert)- Duration is displayed as
Xm Ys(e.g.,3m 45s) — for sub-minute flows, it shows0m Xs - The three Foundation patterns form a complete lifecycle: Variable Bootstrap → Run Header Initializer → (business logic) → Run Finalizer
Requirements
dtRunStartmust be initialized by the Variable Bootstrap pattern before this runsnumErrorCountandnumRecordsProcessedmust be initialized (by Variable Bootstrap or manually set to 0)strRunIdmust be set by the Variable Bootstrap pattern for the footer output- DateTime.Subtract action requires PAD DateTime actions (included in all PAD versions)
- Text.ConvertNumberToText action requires PAD text actions (included in all PAD versions)
- No external dependencies — uses only built-in PAD actions