diff --git a/docs/architecture/adr-0016-diploma-eligibility-dmn.md b/docs/architecture/adr-0016-diploma-eligibility-dmn.md index af5e19c..1e8f9d5 100644 --- a/docs/architecture/adr-0016-diploma-eligibility-dmn.md +++ b/docs/architecture/adr-0016-diploma-eligibility-dmn.md @@ -1,4 +1,4 @@ -# ADR-0016: Diploma eligibility is a DMN evaluated inline as a BPMN businessRuleTask +# ADR-0016: Diploma eligibility is a DMN evaluated inline as a BPMN DMN service task - **Status:** Accepted - **Date:** 2026-07-17 @@ -22,14 +22,16 @@ back. That is one option; it is not the only one, and it is not the cleanest. ## Decision **The diploma-eligibility DMN is deployed to Flowable and evaluated inline by the registratie process -as a `businessRuleTask`; an exclusive gateway routes on its output. The domain's only new job is to -carry the diploma origin and pass it into the process as a start variable.** +as a DMN service task (`flowable:type="dmn"`); an exclusive gateway routes on its output. The domain's +only new job is to carry the diploma origin and pass it into the process as a start variable.** - **The decision lives in the workflow.** `workflows/diploma-eligibility.dmn` maps `diplomaOrigin` - → `route` (`Buitenlands` ⇒ `CBGV_ADVIES`, otherwise `DIRECT`). A `businessRuleTask` + → `route` (`Buitenlands` ⇒ `CBGV_ADVIES`, otherwise `DIRECT`). A DMN service task (`flowable:type="dmn"`, `decisionTableReferenceKey=diploma-eligibility`) runs it between `OpenZaakAanmaken` and `Beoordelen`, and an exclusive gateway sends `CBGV_ADVIES` through a new - `CBGVAdvies` user task before `Beoordelen`, `DIRECT` straight there. + `CBGVAdvies` user task before `Beoordelen`, `DIRECT` straight there. (A `businessRuleTask` would + bind Flowable's legacy Drools/KIE implementation, which `flowable-rest` does not bundle — its parse + handler throws `NoClassDefFoundError` at deploy time; the DMN service task is the supported route.) - **The domain carries the input, not the decision.** The `Registration` aggregate gains a `DiplomaOrigin` (Binnenlands/Buitenlands); `SubmitRegistration` passes it to `StartRegistrationProcessAsync`, which sets it as the `diplomaOrigin` start variable. The domain @@ -52,7 +54,7 @@ carry the diploma origin and pass it into the process as a start variable.** - Deviates from #14's literal "evaluated by the Domain Service via Workflow Client" wording (noted on the issue). The outcome — DMN decides eligibility, foreign diplomas get the CBGV step — is unchanged. -- The DMN and its `businessRuleTask` wiring are validated live (verify-domain drives a foreign +- The DMN and its service-task wiring are validated live (verify-domain drives a foreign registration through CBGV-advies and a domestic one straight to beoordeling, exercising both branches), not in unit tests — consistent with ADR-0009/0014/0015. The domain unit/acceptance tests cover only that the origin is carried into the process. diff --git a/docs/demo-script.md b/docs/demo-script.md index d2fcacb..436fbcb 100644 --- a/docs/demo-script.md +++ b/docs/demo-script.md @@ -346,7 +346,7 @@ candidate group behandelaar → teamlead (§8.2). ## S-13 — Diploma-eligibility: foreign diplomas route through CBGV-advies (#14, ADR-0016) -A registration's diploma origin decides its route. A DMN `businessRuleTask` in the registratie +A registration's diploma origin decides its route. A DMN service task in the registratie process evaluates the `diploma-eligibility` decision on the `diplomaOrigin` start variable: a **foreign** (Buitenlands) diploma is routed through an extra **CBGV-advies** user task before beoordeling; a **domestic** (Binnenlands) one goes straight to beoordeling. The decision lives in the @@ -376,7 +376,7 @@ curl -s -u rest-admin:test -X POST "$FL/runtime/tasks/$TID" \ ``` **The path:** domain sets the `diplomaOrigin` start variable → registratie process DMN -`businessRuleTask` sets `route` → exclusive gateway → foreign: `CBGVAdvies` user task → `Beoordelen`; +DMN service task sets `route` → exclusive gateway → foreign: `CBGVAdvies` user task → `Beoordelen`; domestic: `Beoordelen` directly (§8.2, ADR-0016). > The domestic/foreign paths are covered by the `Een diploma op herkomst routeren` acceptance diff --git a/infra/docker-compose.yml b/infra/docker-compose.yml index 357b675..6c87c92 100644 --- a/infra/docker-compose.yml +++ b/infra/docker-compose.yml @@ -270,7 +270,7 @@ services: until curl -sf -u rest-admin:test "$$base" >/dev/null 2>&1; do echo "waiting for flowable-rest..."; sleep 3; done # Deploy the diploma-eligibility DMN via the process repository: the flowable-rest image embeds # the DMN engine but does not expose the dmn-api app, so the process deployment cross-deploys the - # .dmn resource to the DMN engine, where the registratie businessRuleTask resolves it by key + # .dmn resource to the DMN engine, where the registratie DMN service task resolves it by key # (S-13, ADR-0016). if curl -s -u rest-admin:test "$$base?name=diploma-eligibility" | grep -q '"name":"diploma-eligibility"'; then echo "diploma-eligibility already deployed; skip" diff --git a/infra/flowable/docker-compose.yml b/infra/flowable/docker-compose.yml index b29ff3c..3662f5c 100644 --- a/infra/flowable/docker-compose.yml +++ b/infra/flowable/docker-compose.yml @@ -51,7 +51,7 @@ services: until curl -sf -u rest-admin:test "$$base" >/dev/null 2>&1; do echo "waiting for flowable-rest..."; sleep 3; done # Deploy the diploma-eligibility DMN via the process repository: the flowable-rest image embeds # the DMN engine but does not expose the dmn-api app, so the process deployment cross-deploys the - # .dmn resource to the DMN engine, where the registratie businessRuleTask resolves it by key + # .dmn resource to the DMN engine, where the registratie DMN service task resolves it by key # (S-13, ADR-0016). if curl -s -u rest-admin:test "$$base?name=diploma-eligibility" | grep -q '"name":"diploma-eligibility"'; then echo "diploma-eligibility already deployed; skip" diff --git a/infra/run-domain-check.sh b/infra/run-domain-check.sh index 409ea76..814683d 100755 --- a/infra/run-domain-check.sh +++ b/infra/run-domain-check.sh @@ -159,7 +159,7 @@ done echo "OK — withdrawal cancelled the Beoordelen task; the registratie process ended (ingetrokken)" # ── S-13: diploma-eligibility routing. A registration with a FOREIGN diploma must route through the -# extra CBGVAdvies user task before Beoordelen (the DMN businessRuleTask sets route=CBGV_ADVIES and the +# extra CBGVAdvies user task before Beoordelen (the DMN service task sets route=CBGV_ADVIES and the # gateway branches, ADR-0016). The domestic DIRECT path is already proven by the first registration # above, which parked straight at Beoordelen. ────────────────────────────────────────────────────── cbgv_query='{"processDefinitionKey":"registratie","taskDefinitionKey":"CBGVAdvies","includeProcessVariables":true}' diff --git a/workflows/diploma-eligibility.dmn b/workflows/diploma-eligibility.dmn index 4dde9c2..de6e5cc 100644 --- a/workflows/diploma-eligibility.dmn +++ b/workflows/diploma-eligibility.dmn @@ -1,6 +1,6 @@ diff --git a/workflows/registratie.bpmn b/workflows/registratie.bpmn index 8180567..360297e 100644 --- a/workflows/registratie.bpmn +++ b/workflows/registratie.bpmn @@ -22,9 +22,9 @@ (BeoordelingEscaleren); the Workflow Client reassigns the still-open Beoordelen task from the behandelaar group to teamlead (ADR-0015). The Beoordelen task stays open throughout — the timer only changes who may claim it. - S-13 adds diploma-eligibility routing: between OpenZaakAanmaken and Beoordelen a DMN - businessRuleTask evaluates the `diploma-eligibility` decision on the diplomaOrigin start - variable; an exclusive gateway routes a foreign diploma through the CBGV-advies user task + S-13 adds diploma-eligibility routing: between OpenZaakAanmaken and Beoordelen a DMN service + task (flowable:type="dmn") evaluates the `diploma-eligibility` decision on the diplomaOrigin + start variable; an exclusive gateway routes a foreign diploma through the CBGV-advies user task before Beoordelen, a domestic one straight there (ADR-0016). --> @@ -40,17 +40,19 @@ - - + + - +