fix(workflow): query Flowable tasks at service/query/tasks, not runtime/tasks/query (refs #13)
Some checks failed
CI / lint (pull_request) Successful in 1m17s
CI / build (pull_request) Successful in 1m14s
CI / unit (pull_request) Successful in 1m17s
CI / frontend (pull_request) Successful in 2m41s
CI / mutation (pull_request) Successful in 5m9s
CI / verify-stack (pull_request) Failing after 7m53s

The task-query endpoint is service/query/tasks; the wrong path 404'd, so verify-domain's
werkbak poll got an empty body and the JSON parser aborted the check. Correct the path
in the Workflow Client (and its unit test) and make the live-check parser tolerant of a
transient empty/non-JSON body so the poll retries instead of crashing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-15 09:57:11 +02:00
parent 57b8755f9d
commit c53354cd22
3 changed files with 10 additions and 5 deletions

View File

@@ -80,8 +80,13 @@ fl_base="http://$(ip "$fl"):8080/flowable-rest/service"
reg_id="${loc##*/}"
# Extracts the Beoordelen task id for our registration from a Flowable task-query response on stdin.
# Tolerates an empty/non-JSON body (a transient failure during the poll) by printing nothing.
task_for_reg() { REG_ID="$reg_id" python3 -c "import os,sys,json
d=json.load(sys.stdin); rid=os.environ['REG_ID']
try:
d=json.load(sys.stdin)
except Exception:
d={}
rid=os.environ['REG_ID']
print(next((t['id'] for t in (d.get('data') or [])
if any(v.get('name')=='registrationId' and v.get('value')==rid for v in (t.get('processVariables') or []))), ''))"; }
@@ -91,7 +96,7 @@ query='{"processDefinitionKey":"registratie","taskDefinitionKey":"Beoordelen","i
echo ">> polling Flowable for the Beoordelen user task (werkbak)"
task_id=""
for _ in $(seq 1 30); do
resp="$(flcurl -X POST "$fl_base/runtime/tasks/query" -H 'Content-Type: application/json' -d "$query" 2>/dev/null || true)"
resp="$(flcurl -X POST "$fl_base/query/tasks" -H 'Content-Type: application/json' -d "$query" 2>/dev/null || true)"
task_id="$(printf '%s' "$resp" | task_for_reg)"
[ -n "$task_id" ] && break
sleep 2
@@ -108,7 +113,7 @@ flcurl -X POST "$fl_base/runtime/tasks/$task_id" -H 'Content-Type: application/j
-d '{"action":"complete","variables":[{"name":"besluit","type":"string","value":"goedkeuren"}]}' >/dev/null
echo ">> asserting the process finished (no Beoordelen task remains for the registration)"
resp="$(flcurl -X POST "$fl_base/runtime/tasks/query" -H 'Content-Type: application/json' -d "$query")"
resp="$(flcurl -X POST "$fl_base/query/tasks" -H 'Content-Type: application/json' -d "$query")"
still="$(printf '%s' "$resp" | task_for_reg)"
[ -z "$still" ] || { echo "FAIL — Beoordelen task $still still active after completion" >&2; exit 1; }
echo "OK — behandelaar claimed and completed the Beoordelen task; the registratie process finished"