Groovy DSL Enhancements - #2010
Merged
ashishvijaywargiya merged 6 commits intoSep 15, 2026
Merged
Conversation
…ovy DSL Adds resource/key overloads next to the existing plain-string success()/error()/ failure() on GroovyBaseScript, resolving through the existing label() method. Closes the three long-standing i18n TODOs; plain-string overloads are unchanged. Includes integration tests exercising resolution across locales and context placeholder substitution.
Adds ServiceErrorException (extends ExecutionServiceException) and fail()/require() on GroovyBaseScript, plus resource/key i18n variants. Requires no engine changes: GroovyEngine and GroovyEventHandler already recognize/catch ExecutionServiceException and any Exception respectively. EntityUpdateBuilder's not-found throw now uses the more specific ServiceErrorException instead of the base ExecutionServiceException. Includes integration tests covering both fail() and require() branches, resource/key resolution, and a nested-closure case proving the throw unwinds past closure boundaries that a plain return error(...) cannot.
…with: runAsync(Map args) mirrors run(Map args)'s service:/with: named-argument form, giving the async DSL path the same calling convention the sync path already has via run()/runService().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groovy DSL Enhancements - Here comes one more pass after so many years!!
Added resource/key i18n overloads to success()/error()/failure() in the Groovy DSL, resolving the long-standing TODOs in GroovyBaseScript.
Added a fluent write-side entity DSL: create(), update().where().set(), and delete().where(), matching the existing read-side select()/from()/where().
Added require()/fail() control-flow sugar backed by a new ServiceErrorException, so a failed check unwinds past nested closures instead of only exiting them like return error(...) does.
Added runAsyncService() and the runAsync service:, with: calling form for persisted (Job Scheduler backed) async service calls, mirroring run()/runService().
Covered by new unit and integration tests in GroovyDslServiceEngineTests, all passing.