#1053: ScriptExecutionResult.kt

projectforge-business/src/main/kotlin/org/projectforge/business/scripting/ScriptExecutionResult.kt Script Result Object, projectforge-business/src/main/kotlin/org/projectforge/business/scripting/ScriptExecutionResult.kt 68 lines · 26 code · 33 comments · 9 blank
Result container returned by script execution. Holds the execution output, exception info, the effective script text (with auto-imports), download availability messages, and the raw result object. Provides HTML-escaped output formatting for display in the UI.

Fields

FieldTypePurpose
scriptLoggerScriptLoggerCaptures log messages from script execution
resultAny?Raw return value from the script
exceptionThrowable?Exception (if script threw one)
outputString?Standard output captured during execution
scriptStringThe effective script text with auto-imports
downloadAvailableString?User-friendly message if a download is ready
resultAsUserFriendlyStringString?Formatted string representation

Helper Methods

hasResult() checks if result is non-null. hasException() checks both exception and whether result itself is a Throwable. resultAsHtmlString escapes HTML characters and replaces newlines with <br/>.

Git History

868d6abb7 2025 -> 2026
bbdb5825b Scripts: exception -> log, UserContext.refreshUser() handling changed.
63081666f Source file headers: 2024-> 2025.
ae9962eb7 Script execution improved (logging for end user).
aeff942b5 Script execution improved (logging for end user).
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
a080e9dd5 WIP scripting...
5f7ef41b8 Copyright 2021 -> 2022
ceb63e8a1 Source code header: (C) 2001-2021.
52d9c1d88 WIP: Kotlin scripts...
c5aa8210b WIP: Support of Kotlin scripts added in addition to Groovy...
7c79f1922 Copyright of source header -> 2020.
dd5ca38ac CopyRight of all java file-header updated or created.
9ebb88522 Initial commit