ADR proposal · External-task job-worker pattern for the Domain Service ↔ Flowable #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
S-05 (#6) introduces the BIG Domain Service, which must orchestrate: start a Flowable
registratieprocess → theOpenZaakAanmakenexternal task executes the ACLOpenZaak→ the zaak URL is stored on the Registration aggregate.The BPMN
OpenZaakAanmakentask is a Flowable external-worker service task (S-03). Something has to acquire/lock that job, do the work, and complete it. This is an ADR-worthy moment per CLAUDE.md §14 (a service boundary is defined; the Workflow Client↔Flowable coupling rule §8.2 is exercised).Decision to record
The Workflow Client (Infrastructure of the Domain Service) is the only code that talks to Flowable (§8.2). It acts as an external-task job worker (PRD §36): a hosted background worker polls Flowable for
OpenZaakAanmakenjobs, locks one, calls the ACL to open a zaak (§8.1 — only the ACL talks to ZGW), attaches the resulting zaak URL to the aggregate, and completes the job. Orchestration is therefore eventually consistent, not request-synchronous.Options considered
Consequences
BackgroundServicein Infrastructure.ADR file
docs/architecture/adr-0009-external-task-job-worker.mdlands in the PR that implements #6.