Skip to content

Groovy DSL Enhancements - #2010

Merged
ashishvijaywargiya merged 6 commits into
apache:trunkfrom
ashishvijaywargiya:groovy-dsl-enhancement
Sep 15, 2026
Merged

ashishvijaywargiya merged 6 commits into
apache:trunkfrom
ashishvijaywargiya:groovy-dsl-enhancement

Conversation

@ashishvijaywargiya

Copy link
Copy Markdown
Contributor

Groovy DSL Enhancements - Here comes one more pass after so many years!!

  1. Added resource/key i18n overloads to success()/error()/failure() in the Groovy DSL, resolving the long-standing TODOs in GroovyBaseScript.

  2. Added a fluent write-side entity DSL: create(), update().where().set(), and delete().where(), matching the existing read-side select()/from()/where().

  3. 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.

  4. Added runAsyncService() and the runAsync service:, with: calling form for persisted (Job Scheduler backed) async service calls, mirroring run()/runService().

  5. Covered by new unit and integration tests in GroovyDslServiceEngineTests, all passing.

…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().
@ashishvijaywargiya
ashishvijaywargiya merged commit ccd8f03 into apache:trunk Sep 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant