## What & why S-13: a diploma's origin decides its route. A **DMN** (`diploma-eligibility`) is evaluated inline by the registratie process as a **`businessRuleTask`**; an exclusive gateway routes a **foreign** (Buitenlands) diploma through a new **CBGVAdvies** user task before `Beoordelen`, a **domestic** one straight there (PRD flow 4). The domain's only new job is carrying the diploma origin and passing it as a process start variable. Chose **Option B (DMN in the BPMN)** over the issue's literal "evaluated by the Domain Service via Workflow Client" wording — keeps the decision a first-class workflow artefact and §8.2 clean. Rationale in **ADR-0016** (proposal #100); noted on this issue. Closes #14 ## Definition of Done - [x] Linked Gitea issue (above). - [x] Failing test committed before the implementation. - [x] Implementation makes the test pass. - [x] Conventional Commits referencing the issue (`refs #14`). - [ ] CI green — all Gitea Actions jobs. - [x] `docker compose up` from a fresh clone reaches green health checks within 3 minutes (additive; DMN deployed by flowable-init). - [x] Docs updated (ADR-0016, demo note). - [x] ADR added (`docs/architecture/adr-0016-diploma-eligibility-dmn.md`). - [x] Demo note in `docs/demo-script.md`. ## How it was built (TDD) - **Domain**: `DiplomaOrigin` on the aggregate + submit command; threaded through the process-start port so the Workflow Client emits a `diplomaOrigin` start variable. Red → green. - **DMN + BPMN**: `workflows/diploma-eligibility.dmn` (origin → route); `businessRuleTask` + exclusive gateway + `CBGVAdvies` user task in `registratie.bpmn`; DMN deployed to Flowable's DMN engine by `flowable-init`. - **Both paths**: `Een diploma op herkomst routeren` acceptance scenarios (origin carried into the process) + unit tests; verify-domain drives a foreign registration through CBGVAdvies→Beoordelen and the domestic one straight to Beoordelen — exercising both DMN branches live. ## Notes for reviewers - Deviation from the issue's Option-A wording is deliberate and recorded (ADR-0016); the outcome is unchanged. - The self-service eIDAS→foreign wiring is out of scope here (this slice is area:domain + area:workflow); the domain submit accepts an optional `diplomaOrigin` so the foreign path is drivable. - Local green: domain unit 109, acceptance 15, `dotnet format`, Release build (0 errors), **domain mutation 95.39%** (break 90). The DMN/`businessRuleTask` REST wiring is CI-verified on verify-stack (no local full-stack run here). Reviewed-on: #101
82 lines
3.2 KiB
YAML
82 lines
3.2 KiB
YAML
# Flowable (S-03): the flowable-rest engine on Postgres.
|
|
# The registratie.bpmn model is deployed via the REST API on startup by flowable-init.
|
|
#
|
|
# docker compose -f infra/flowable/docker-compose.yml up -d
|
|
# # REST API (basic auth) under http://localhost:8090/flowable-rest/service/
|
|
#
|
|
# Host port 8090 (8000/8001/8080/8180 are taken by OpenZaak/NRC/BFF/Keycloak).
|
|
services:
|
|
flowable-db:
|
|
image: docker.io/library/postgres:16
|
|
environment:
|
|
POSTGRES_USER: flowable
|
|
POSTGRES_PASSWORD: flowable
|
|
POSTGRES_DB: flowable
|
|
volumes:
|
|
- flowable-db:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U flowable -d flowable"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
networks: [cg]
|
|
|
|
flowable-rest:
|
|
image: docker.io/flowable/flowable-rest:latest
|
|
environment:
|
|
SPRING_DATASOURCE_DRIVER-CLASS-NAME: org.postgresql.Driver
|
|
SPRING_DATASOURCE_URL: jdbc:postgresql://flowable-db:5432/flowable
|
|
SPRING_DATASOURCE_USERNAME: flowable
|
|
SPRING_DATASOURCE_PASSWORD: flowable
|
|
ports:
|
|
- "8090:8080"
|
|
depends_on:
|
|
flowable-db:
|
|
condition: service_healthy
|
|
networks: [cg]
|
|
|
|
# Deploys registratie.bpmn (process engine) and diploma-eligibility.dmn (DMN engine) via the REST
|
|
# API once flowable-rest is up. Idempotent: skips each if already deployed.
|
|
flowable-init:
|
|
image: docker.io/curlimages/curl:latest
|
|
restart: "no"
|
|
# registratie.bpmn + diploma-eligibility.dmn are streamed into this external volume by
|
|
# infra/seed-config.sh.
|
|
volumes:
|
|
- fl-bpmn:/work:ro
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
svc=http://flowable-rest:8080/flowable-rest/service/repository/deployments
|
|
dmn=http://flowable-rest:8080/flowable-rest/dmn-api/dmn-repository/deployments
|
|
until curl -sf -u rest-admin:test "$$svc" >/dev/null 2>&1; do echo "waiting for flowable-rest..."; sleep 3; done
|
|
# Deploy the DMN to the DMN engine and the BPMN to the process engine as SEPARATE deployments:
|
|
# flowable-rest does NOT cascade a .dmn bundled in a process .bar into the DMN engine, so the DMN
|
|
# must go via dmn-api. The process's DMN service task then resolves the decision across deployments
|
|
# by key (S-13, ADR-0016). Both steps are idempotent (skip if already deployed).
|
|
if curl -s -u rest-admin:test "$$dmn" | grep -q '"name":"diploma-eligibility.dmn"'; then
|
|
echo "diploma-eligibility DMN already deployed; skip"
|
|
else
|
|
curl -sf -u rest-admin:test -F 'file=@/work/diploma-eligibility.dmn;filename=diploma-eligibility.dmn' "$$dmn" >/dev/null && echo "deployed diploma-eligibility DMN"
|
|
fi
|
|
if curl -s -u rest-admin:test "$$svc?name=registratie" | grep -q '"name":"registratie"'; then
|
|
echo "registratie BPMN already deployed; skip"
|
|
else
|
|
curl -sf -u rest-admin:test -F 'file=@/work/registratie.bpmn;filename=registratie.bpmn' "$$svc" >/dev/null && echo "deployed registratie BPMN"
|
|
fi
|
|
depends_on:
|
|
flowable-rest:
|
|
condition: service_started
|
|
networks: [cg]
|
|
|
|
volumes:
|
|
flowable-db:
|
|
# populated out-of-band by infra/seed-config.sh (docker cp) — see that script.
|
|
fl-bpmn:
|
|
external: true
|
|
name: rr-fl-bpmn
|
|
|
|
networks:
|
|
cg:
|