Skip to content

WW-5850 docs: design for declarative multi-step flows - #2130

Draft
lukaszlenart wants to merge 2 commits into
mainfrom
WW-5850-scoped-model-driven-flows
Draft

lukaszlenart wants to merge 2 commits into
mainfrom
WW-5850-scoped-model-driven-flows

Conversation

@lukaszlenart

@lukaszlenart lukaszlenart commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Fixes WW-5850

Design document only, for discussion before implementation: docs/superpowers/specs/2026-11-08-WW-5850-scoped-model-driven-flows-design.md.

Summary

Struts has two mechanisms for keeping form state across several requests: the scope interceptor and scopedModelDriven. Neither has a lifecycle. This design adds declarative multi-step flows, implemented by a new dedicated flow interceptor, as a full alternative to scope for multi-page forms. ScopedModelDrivenInterceptor and ScopedModelDriven are left unchanged, so existing users keep today's code path.

  • A flow is identified by namespace + name. Each action declares its flow and role (start / step / end) in struts.xml or with a Convention annotation.
  • Flow actions implement a new flow model interface (not ScopedModelDriven), so the two interceptors never act on the same action.
  • start creates a new model by default; an action can opt in to resuming an existing one per request via an *Aware interface that receives the existing model.
  • A step or end with no running flow redirects to the flow's start.
  • An end finishes the flow only when the action ran and returned neither input nor error, so a failed final validation keeps the user's data.
  • Flow definitions are validated at startup (one start, at least one end, same model type, flow present before params in the stack).
  • flow is added to defaultStack and does nothing for actions that declare no flow.

Rollout

  • 7.6.0 — this ticket: flows ship, ScopeInterceptor and scopedModelDriven unchanged.
  • 7.7.0 — deprecate ScopeInterceptor with a migration note (separate ticket).
  • 8.0.0 — remove ScopeInterceptor (separate ticket).

Background: the "Is anyone using the scope interceptor?" thread on user@ (2026-10-09).

🤖 Generated with Claude Code

lukaszlenart and others added 2 commits November 8, 2026 10:57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ScopedModelDrivenInterceptor and ScopedModelDriven stay unchanged, so
existing users keep today's code path. Flow actions implement a new
flow model interface instead of ScopedModelDriven.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukaszlenart lukaszlenart changed the title WW-5850 docs: design for declarative multi-step flows on ScopedModelDriven WW-5850 docs: design for declarative multi-step flows Nov 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

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