Class CheckResultsSection
java.lang.Object
com.scivicslab.actoriac.report.sections.basic.CheckResultsSection
- All Implemented Interfaces:
SectionBuilder
POJO section builder that collects and outputs messages with % prefix.
Pure business logic - no CallableByActionName.
Use CheckResultsSectionIIAR to expose as an actor.
The % prefix is used in workflows to mark lines that should be collected and displayed in the final report. This is useful for check/status reporting:
Usage in workflows:
- actor: this
method: executeCommand
arguments:
- |
if command -v node > /dev/null; then
echo "%[OK] Node.js: $(node --version)"
else
echo "%[ERROR] Node.js: not found"
fi
Output example:
[Check Results] [OK] Node.js: v18.0.0 [OK] yarn: 1.22.19 [ERROR] Maven: not found
- Since:
- 2.16.0
- Author:
- devteam@scivicslab.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Connectionprivate static final Loggerprivate static final StringPrefix for messages to be included in the report.private long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generates the section content.Get messages with % prefix from logs.getTitle()Returns the section title.voidsetConnection(Connection connection) Sets the database connection for log queries.voidsetSessionId(long sessionId) Sets the session ID to query logs from.
-
Field Details
-
logger
-
REPORT_PREFIX
Prefix for messages to be included in the report.- See Also:
-
connection
-
sessionId
-
-
Constructor Details
-
CheckResultsSection
public CheckResultsSection()
-
-
Method Details
-
setConnection
Sets the database connection for log queries.- Parameters:
connection- the JDBC connection to the H2 log database
-
setSessionId
Sets the session ID to query logs from.- Parameters:
sessionId- the session ID
-
generate
Description copied from interface:SectionBuilderGenerates the section content.- Specified by:
generatein interfaceSectionBuilder- Returns:
- the section content as a string
-
getReportMessages
Get messages with % prefix from logs.- Returns:
- list of messages (without the % prefix)
- Throws:
SQLException- if database query fails
-
getTitle
Description copied from interface:SectionBuilderReturns the section title.If null or empty, the section content is output without a title line.
- Specified by:
getTitlein interfaceSectionBuilder- Returns:
- the section title, or null for no title
-