feat(workflow): beoordeling escalation to teamlead after 14 days (S-14, closes #15) #99

Merged
not merged 10 commits from feat/15-beoordeling-escalation into main 2026-07-17 09:45:37 +00:00
Showing only changes of commit eeb2a9cb40 - Show all commits

View File

@@ -216,12 +216,14 @@ before="$(flcurl "$fl_base/runtime/tasks/$task_id3/identitylinks" | candidate_gr
echo ">> firing the 14-day boundary timer early via the management API"
timer_id="$(flcurl "$fl_base/management/timer-jobs?processInstanceId=$pid3" | first_job_id)"
[ -n "$timer_id" ] || { echo "FAIL — no timer job found for instance $pid3" >&2; exit 1; }
# Move the timer job to an executable async job, then execute it — firing the non-interrupting event
# without depending on the async executor's schedule.
# Move the timer job to an executable async job. Flowable's async executor (running in flowable-rest)
# then picks it up and fires the non-interrupting boundary event. It may run the job before we can
# look, so executing it explicitly is a best-effort nudge — tolerate the job already being gone.
flcurl -X POST "$fl_base/management/timer-jobs/$timer_id" -H 'Content-Type: application/json' -d '{"action":"move"}' >/dev/null
async_id="$(flcurl "$fl_base/management/jobs?processInstanceId=$pid3" | first_job_id)"
[ -n "$async_id" ] || { echo "FAIL — timer job did not become an executable job" >&2; exit 1; }
flcurl -X POST "$fl_base/management/jobs/$async_id" -H 'Content-Type: application/json' -d '{"action":"execute"}' >/dev/null
async_id="$(flcurl "$fl_base/management/jobs?processInstanceId=$pid3" 2>/dev/null | first_job_id || true)"
if [ -n "$async_id" ]; then
flcurl -X POST "$fl_base/management/jobs/$async_id" -H 'Content-Type: application/json' -d '{"action":"execute"}' >/dev/null 2>&1 || true
fi
echo ">> timer fired; the BeoordelingEscaleren token is parked for the domain worker"
echo ">> polling until the escalation worker reassigns the beoordeling to the teamlead"