ADR: document-wait timeout cancellation (S-10a) — Verlopen status + interrupting P30D timer worker #104

Closed
opened 2026-07-20 07:39:13 +00:00 by not · 1 comment
Contributor

Context. S-10a (#102) adds a WachtOpDocumenten user task with a 30-day interrupting boundary timer to the registratie process. On timeout the case is cancelled. The non-obvious decisions (§14):

  1. Where the wait-task sits. Proposed: immediately after OpenZaakAanmaken, before the diploma-eligibility DMN — the zaak exists, then the process parks waiting for the citizen's documents; on "documents received" it continues into the existing DMN routing → Beoordelen. (Alternative: after the gateway, just before Beoordelen. Rejected — waiting should gate the whole assessment, and the DMN/CBGV routing is assessment work.)

  2. How the timeout cancels, and how the domain stays in sync. Proposed (mirrors S-14 escalation ADR-0015 + S-11 withdrawal ADR-0014): cancelActivity="true" P30D timer boundary on WachtOpDocumenten → a RegistratieVerlopen external-worker task → endVerlopen end-event. A domain worker (pump/processor, like BeoordelingEscalatie*) drains the RegistratieVerlopen job carrying registrationId, loads the aggregate, and moves it to a new terminal status Verlopen (Registration.Expire()), keeping the domain authoritative (the projection/openbaar view reads status). Idempotent per §8.6 — a redelivered job that finds an already-Verlopen aggregate still completes.

  3. Documents-in-time transition. A CompleteDocumentWaitAsync(processInstanceId) on the Workflow Client (the only code that talks to Flowable, §8.2) completes the WachtOpDocumenten task; a ProvideDocuments application handler drives it. The trigger (portal upload → BFF → domain) is wired in S-10b; S-10a builds and unit-tests the completion path with the trigger stubbed.

  4. ZGW zaak on expiry — scope boundary. S-10a marks the domain aggregate Verlopen and ends the process. Setting the ZGW zaak to a cancellation status needs a new ACL method + statustype seeding, which overlaps S-10b's ACL/infra work — proposed to fold the zaak-close into S-10b (or a follow-up), keeping S-10a the pure workflow/domain spine.

Decision to record in ADR-0017 (lands in the PR for #102): items 1–3 as proposed; item 4 noted as the S-10a/S-10b boundary.

Does not bend any §8 rule (Workflow Client remains the only Flowable caller; no new ZGW boundary in S-10a). Opening per §13/§14 before coding.

**Context.** S-10a (#102) adds a `WachtOpDocumenten` user task with a 30-day interrupting boundary timer to the registratie process. On timeout the case is cancelled. The non-obvious decisions (§14): 1. **Where the wait-task sits.** Proposed: immediately after `OpenZaakAanmaken`, before the diploma-eligibility DMN — the zaak exists, then the process parks waiting for the citizen's documents; on "documents received" it continues into the existing DMN routing → Beoordelen. (Alternative: after the gateway, just before Beoordelen. Rejected — waiting should gate the whole assessment, and the DMN/CBGV routing is assessment work.) 2. **How the timeout cancels, and how the domain stays in sync.** Proposed (mirrors S-14 escalation ADR-0015 + S-11 withdrawal ADR-0014): `cancelActivity="true"` P30D timer boundary on `WachtOpDocumenten` → a `RegistratieVerlopen` external-worker task → `endVerlopen` end-event. A domain worker (pump/processor, like `BeoordelingEscalatie*`) drains the `RegistratieVerlopen` job carrying `registrationId`, loads the aggregate, and moves it to a **new terminal status `Verlopen`** (`Registration.Expire()`), keeping the domain authoritative (the projection/openbaar view reads status). Idempotent per §8.6 — a redelivered job that finds an already-`Verlopen` aggregate still completes. 3. **Documents-in-time transition.** A `CompleteDocumentWaitAsync(processInstanceId)` on the Workflow Client (the only code that talks to Flowable, §8.2) completes the `WachtOpDocumenten` task; a `ProvideDocuments` application handler drives it. The *trigger* (portal upload → BFF → domain) is wired in S-10b; S-10a builds and unit-tests the completion path with the trigger stubbed. 4. **ZGW zaak on expiry — scope boundary.** S-10a marks the domain aggregate `Verlopen` and ends the process. Setting the ZGW *zaak* to a cancellation status needs a new ACL method + statustype seeding, which overlaps S-10b's ACL/infra work — proposed to fold the zaak-close into S-10b (or a follow-up), keeping S-10a the pure workflow/domain spine. **Decision to record in ADR-0017** (lands in the PR for #102): items 1–3 as proposed; item 4 noted as the S-10a/S-10b boundary. Does not bend any §8 rule (Workflow Client remains the only Flowable caller; no new ZGW boundary in S-10a). Opening per §13/§14 before coding.
not added this to the Iteration 2 — Flow Completeness milestone 2026-07-20 07:39:13 +00:00
not added the type:adr-proposalarea:domainarea:workflow labels 2026-07-20 07:39:21 +00:00
Author
Contributor

Resolved: ADR-0017 landed in PR #105 (S-10a, merged). Closing.

Resolved: ADR-0017 landed in PR #105 (S-10a, merged). Closing.
not closed this issue 2026-07-20 09:42:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eho/register-referentie#104