Class AsposeAgentTimelinePdfRenderer
java.lang.Object
com.flowable.agent.engine.impl.report.AsposeAgentTimelinePdfRenderer
- All Implemented Interfaces:
AgentTimelinePdfRenderer
AgentTimelinePdfRenderer implementation that renders an AgentTimelineReport as an audit-complete,
visually structured PDF using Aspose.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classOne invocation enriched with its hierarchical number and owning agent name, shared by Overview and Details. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final doubleprotected static final com.aspose.pdf.Colorprotected static final com.aspose.pdf.Colorprotected static final com.aspose.pdf.Colorprotected static final com.aspose.pdf.Colorprotected static final com.aspose.pdf.Colorprotected static final com.aspose.pdf.Colorprotected static final com.aspose.pdf.Colorprotected static final doubleprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final Stringprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected static final doubleprotected static final Stringprotected static final doubleprotected static final doubleprotected static final doubleprotected static final doubleprotected static final DateTimeFormatter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddGuardrailCell(com.aspose.pdf.Row row, String value, boolean bold) protected voidaddGuardrailHeaderCell(com.aspose.pdf.Row row, String label) protected voidaddKeyValueRow(com.aspose.pdf.Table table, String label, String value) protected voidaddKpiCell(com.aspose.pdf.Row row, String label, String value) protected voidprotected voidaddLogo(com.aspose.pdf.Page page) protected voidaddOverviewCell(com.aspose.pdf.Row row, String value, boolean bold) protected voidaddOverviewHeaderCell(com.aspose.pdf.Row row, String label) protected voidaddPageFooters(com.aspose.pdf.Document document) protected voidapplyFullLineHeight(com.aspose.pdf.TextFragmentState state, float fontSize) protected com.aspose.pdf.TextFragmentA single "• label" line for the invocation metrics list.protected StringcoverSubtitle(AgentTimelineReport report) protected StringdefinitionLabel(AgentInstanceReport instance) protected InstantendInstant(AgentInvocationReport invocation) Resolves the invocation's end instant, falling back to start + duration whenendTimeis absent.protected longendMillis(AgentInvocationReport invocation) protected voidexpandClipsIn(com.aspose.pdf.OperatorCollection contents) Widens every "re W n" text-clip rectangle in one operator collection by lowering its bottom edge.protected voidexpandTextClipBoxes(com.aspose.pdf.Document document) Fixes descender clipping at its true root cause.protected StringfirstModel(AgentInvocationReport invocation) protected StringformatCost(double cost) protected StringformatDuration(long millis) protected StringformatDuration(Long millis) protected StringformatInstant(Instant instant) protected StringformatInstantOrNull(Instant instant) protected StringformatTokens(long tokens) protected static com.aspose.pdf.Colorprotected StringguardrailOutcome(AgentGuardrailReport guardrail) "Passed" when the guardrail passed, otherwise the fired action (falling back to "Fired").protected booleanprotected booleanprotected com.aspose.pdf.TextFragmentprotected StringinvocationLabel(AgentInvocationReport invocation) protected booleanisClipRectangle(com.aspose.pdf.OperatorCollection contents, int index, int count) True when the operator atindex(anRe) is immediately used as a clip path ("W n").protected com.aspose.pdf.MarginInfomargin(com.aspose.pdf.Table table) protected com.aspose.pdf.MarginInfomargin(com.aspose.pdf.TextFragment fragment) Ensures the fragment has a mutableMarginInfo(Aspose leaves itnullby default) and returns it.protected com.aspose.pdf.PagenewPage(com.aspose.pdf.Document document) Builds the numbered invocation list in definition/detail order, assigning the same hierarchical numbers ("1.1", "1.2", "2.1", ...) that the detail section uses so the Overview and Details stay in sync.protected com.aspose.pdf.Tableprotected com.aspose.pdf.MarginInfoprotected Stringvoidrender(AgentTimelineReport report, OutputStream outputStream) protected voidrenderAgentInstanceDetails(com.aspose.pdf.Page page, AgentTimelineReport report) Single-agent-instance header, shown in place of the work-instance details table.protected voidrenderCover(com.aspose.pdf.Page page, AgentTimelineReport report) protected voidrenderGuardrails(com.aspose.pdf.Page page, AgentInvocationReport invocation) Renders the guardrails sub-section for an invocation: a summary line (evaluated / passed / fired / pass rate) followed by a table with a row per evaluation.protected voidrenderInstanceDetails(com.aspose.pdf.Page page, AgentTimelineReport report) protected voidrenderIntroAndInstanceDetails(com.aspose.pdf.Page page, AgentTimelineReport report) protected voidrenderInvocation(com.aspose.pdf.Page page, AgentInvocationReport invocation, String number, com.aspose.pdf.Page tocPage) protected voidrenderInvocationDetails(com.aspose.pdf.Page page, AgentTimelineReport report, com.aspose.pdf.Page tocPage) protected voidrenderInvocationMeta(com.aspose.pdf.Page page, AgentInvocationReport invocation) Renders the per-invocation metrics as a whitespace-rich bullet list, one metric per line.protected voidrenderOverview(com.aspose.pdf.Page page, AgentTimelineReport report) protected voidrenderPart(com.aspose.pdf.Page page, AgentExchangePartReport part, com.aspose.pdf.Page tocPage) protected voidrenderSummaryKpis(com.aspose.pdf.Page page, AgentTimelineReport report) protected voidrenderTableOfContents(com.aspose.pdf.Page tocPage) protected voidrenderUnpricedModelsNote(com.aspose.pdf.Page page, AgentTimelineReport report) When any chat model on the timeline has no configured price, its cost was counted as 0 and the total is understated - surface this the same way the UI does (a muted note plus the distinct unpriced model names).protected static Stringprotected StringscopeTypeLabel(String scopeType) Maps a raw scope type to a human-readable label ("cmmn" to "Case", "bpmn" to "Process"); null/blank stays null.protected com.aspose.pdf.TextFragmentsectionHeading(String value) A top-level numbered section heading (not part of the index).protected com.aspose.pdf.TextFragmentspacedText(String value, float fontSize, com.aspose.pdf.Color color, double topMargin) protected com.aspose.pdf.TextFragmentspacedText(String value, float fontSize, com.aspose.pdf.Color color, double topMargin, boolean bold) protected longstartMillis(AgentInvocationReport invocation) protected com.aspose.pdf.TextFragmentsubHeading(String value, double topMargin) protected com.aspose.pdf.TextFragmentprotected com.aspose.pdf.HeadingtocHeading(int level, String value, float fontSize, com.aspose.pdf.Color color, com.aspose.pdf.Page tocPage) protected com.aspose.pdf.Color
-
Field Details
-
TIMESTAMP_FORMATTER
-
LOGO_RESOURCE
- See Also:
-
FONT_MONOSPACE
- See Also:
-
FONT_COVER_TITLE
protected static final float FONT_COVER_TITLE- See Also:
-
FONT_COVER_SUBTITLE
protected static final float FONT_COVER_SUBTITLE- See Also:
-
FONT_SECTION_HEADING
protected static final float FONT_SECTION_HEADING- See Also:
-
FONT_SUB_HEADING
protected static final float FONT_SUB_HEADING- See Also:
-
FONT_AGENT_HEADING
protected static final float FONT_AGENT_HEADING- See Also:
-
FONT_OPERATION_HEADING
protected static final float FONT_OPERATION_HEADING- See Also:
-
FONT_BODY
protected static final float FONT_BODY- See Also:
-
FONT_LABEL
protected static final float FONT_LABEL- See Also:
-
FONT_SMALL
protected static final float FONT_SMALL- See Also:
-
FONT_MONO
protected static final float FONT_MONO- See Also:
-
FONT_OVERVIEW_TABLE
protected static final float FONT_OVERVIEW_TABLE- See Also:
-
INDEX_LINE_GAP
protected static final float INDEX_LINE_GAP- See Also:
-
INDEX_LEVEL2_INDENT
protected static final float INDEX_LEVEL2_INDENT- See Also:
-
INDEX_LEVEL3_INDENT
protected static final float INDEX_LEVEL3_INDENT- See Also:
-
CLIP_BOTTOM_EXPANSION_RATIO
protected static final double CLIP_BOTTOM_EXPANSION_RATIO- See Also:
-
LINE_SPACING_RATIO
protected static final float LINE_SPACING_RATIO- See Also:
-
PAGE_MARGIN_SIDE
protected static final double PAGE_MARGIN_SIDE- See Also:
-
PAGE_MARGIN_TOP
protected static final double PAGE_MARGIN_TOP- See Also:
-
PAGE_MARGIN_BOTTOM
protected static final double PAGE_MARGIN_BOTTOM- See Also:
-
CONTENT_WIDTH
protected static final double CONTENT_WIDTH- See Also:
-
LOGO_WIDTH
protected static final double LOGO_WIDTH- See Also:
-
LOGO_HEIGHT
protected static final double LOGO_HEIGHT- See Also:
-
COLOR_TEXT
protected static final com.aspose.pdf.Color COLOR_TEXT -
COLOR_MUTED
protected static final com.aspose.pdf.Color COLOR_MUTED -
COLOR_ACCENT
protected static final com.aspose.pdf.Color COLOR_ACCENT -
COLOR_KPI_BG
protected static final com.aspose.pdf.Color COLOR_KPI_BG -
COLOR_KV_BG
protected static final com.aspose.pdf.Color COLOR_KV_BG -
COLOR_BLOCK_BG
protected static final com.aspose.pdf.Color COLOR_BLOCK_BG -
COLOR_BORDER
protected static final com.aspose.pdf.Color COLOR_BORDER -
TYPE_COLORS
-
-
Constructor Details
-
AsposeAgentTimelinePdfRenderer
public AsposeAgentTimelinePdfRenderer()
-
-
Method Details
-
render
- Specified by:
renderin interfaceAgentTimelinePdfRenderer
-
pageMargin
protected com.aspose.pdf.MarginInfo pageMargin() -
expandTextClipBoxes
protected void expandTextClipBoxes(com.aspose.pdf.Document document) Fixes descender clipping at its true root cause. Aspose's paragraph/flow layout wraps every text line in a clip rectangle ("x y w h re W n") whose bottom edge sits only the font's descent (~0.207 x em) below the baseline. A glyph descender (g, y, p) extends ~0.21-0.25 x em below the baseline, so its tip falls outside the clip and strict viewers (Chrome, Adobe, pdf.js) chop it - macOS CoreGraphics happens to ignore the clip, which masked the bug in earlier PNG checks. No line-spacing value, spacing mode, margin, table-cell wrap or explicit rectangle moves this bottom edge: it is pinned to the font descent. Only removing/enlarging the clip helps, and enlarging a clip is always safe (a clip only ever hides content, so a bigger one reveals more). -
expandClipsIn
protected void expandClipsIn(com.aspose.pdf.OperatorCollection contents) Widens every "re W n" text-clip rectangle in one operator collection by lowering its bottom edge. -
isClipRectangle
protected boolean isClipRectangle(com.aspose.pdf.OperatorCollection contents, int index, int count) True when the operator atindex(anRe) is immediately used as a clip path ("W n"). -
newPage
protected com.aspose.pdf.Page newPage(com.aspose.pdf.Document document) -
renderCover
-
addLogo
protected void addLogo(com.aspose.pdf.Page page) -
coverSubtitle
-
renderIntroAndInstanceDetails
-
hasInstanceDetails
-
hasAgentInstanceDetails
-
renderInstanceDetails
-
renderAgentInstanceDetails
Single-agent-instance header, shown in place of the work-instance details table. -
scopeTypeLabel
Maps a raw scope type to a human-readable label ("cmmn" to "Case", "bpmn" to "Process"); null/blank stays null. -
addKeyValueRow
-
renderSummaryKpis
-
renderUnpricedModelsNote
When any chat model on the timeline has no configured price, its cost was counted as 0 and the total is understated - surface this the same way the UI does (a muted note plus the distinct unpriced model names). -
addKpiRow
-
addKpiCell
-
renderTableOfContents
protected void renderTableOfContents(com.aspose.pdf.Page tocPage) -
margin
protected com.aspose.pdf.MarginInfo margin(com.aspose.pdf.Table table) -
numberedInvocations
protected List<AsposeAgentTimelinePdfRenderer.NumberedInvocation> numberedInvocations(AgentTimelineReport report) Builds the numbered invocation list in definition/detail order, assigning the same hierarchical numbers ("1.1", "1.2", "2.1", ...) that the detail section uses so the Overview and Details stay in sync. -
renderOverview
-
groupByConcurrency
protected List<List<AsposeAgentTimelinePdfRenderer.NumberedInvocation>> groupByConcurrency(List<AsposeAgentTimelinePdfRenderer.NumberedInvocation> ordered) -
overviewTable
protected com.aspose.pdf.Table overviewTable(List<AsposeAgentTimelinePdfRenderer.NumberedInvocation> group) -
addOverviewHeaderCell
-
addOverviewCell
-
renderInvocationDetails
protected void renderInvocationDetails(com.aspose.pdf.Page page, AgentTimelineReport report, com.aspose.pdf.Page tocPage) -
renderInvocation
protected void renderInvocation(com.aspose.pdf.Page page, AgentInvocationReport invocation, String number, com.aspose.pdf.Page tocPage) -
renderInvocationMeta
Renders the per-invocation metrics as a whitespace-rich bullet list, one metric per line. -
bullet
A single "• label" line for the invocation metrics list. The last item carries extra bottom whitespace. -
renderGuardrails
Renders the guardrails sub-section for an invocation: a summary line (evaluated / passed / fired / pass rate) followed by a table with a row per evaluation. Skips entirely when no guardrails were evaluated. -
guardrailOutcome
"Passed" when the guardrail passed, otherwise the fired action (falling back to "Fired"). -
addGuardrailHeaderCell
-
addGuardrailCell
-
renderPart
protected void renderPart(com.aspose.pdf.Page page, AgentExchangePartReport part, com.aspose.pdf.Page tocPage) -
sectionHeading
A top-level numbered section heading (not part of the index). -
subHeading
-
tocHeading
protected com.aspose.pdf.Heading tocHeading(int level, String value, float fontSize, com.aspose.pdf.Color color, com.aspose.pdf.Page tocPage) -
heading
protected com.aspose.pdf.TextFragment heading(String value, float fontSize, com.aspose.pdf.Color color) -
margin
protected com.aspose.pdf.MarginInfo margin(com.aspose.pdf.TextFragment fragment) Ensures the fragment has a mutableMarginInfo(Aspose leaves itnullby default) and returns it. -
text
protected com.aspose.pdf.TextFragment text(String value, float fontSize, com.aspose.pdf.Color color, boolean bold) -
applyFullLineHeight
protected void applyFullLineHeight(com.aspose.pdf.TextFragmentState state, float fontSize) -
spacedText
protected com.aspose.pdf.TextFragment spacedText(String value, float fontSize, com.aspose.pdf.Color color, double topMargin) -
spacedText
protected com.aspose.pdf.TextFragment spacedText(String value, float fontSize, com.aspose.pdf.Color color, double topMargin, boolean bold) -
definitionLabel
-
invocationLabel
-
partLabel
-
firstModel
-
formatTokens
-
formatCost
-
formatInstant
-
formatInstantOrNull
-
formatDuration
-
formatDuration
-
startMillis
-
endMillis
-
endInstant
Resolves the invocation's end instant, falling back to start + duration whenendTimeis absent. -
typeColor
-
buildTypeColors
-
fromHex
-
safe
-