feat(workflow): beoordeling escalation to teamlead after 14 days (S-14, closes #15) #99
@@ -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"
|
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)"
|
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; }
|
[ -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
|
# Move the timer job to an executable async job. Flowable's async executor (running in flowable-rest)
|
||||||
# without depending on the async executor's schedule.
|
# 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
|
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)"
|
async_id="$(flcurl "$fl_base/management/jobs?processInstanceId=$pid3" 2>/dev/null | first_job_id || true)"
|
||||||
[ -n "$async_id" ] || { echo "FAIL — timer job did not become an executable job" >&2; exit 1; }
|
if [ -n "$async_id" ]; then
|
||||||
flcurl -X POST "$fl_base/management/jobs/$async_id" -H 'Content-Type: application/json' -d '{"action":"execute"}' >/dev/null
|
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 ">> timer fired; the BeoordelingEscaleren token is parked for the domain worker"
|
||||||
|
|
||||||
echo ">> polling until the escalation worker reassigns the beoordeling to the teamlead"
|
echo ">> polling until the escalation worker reassigns the beoordeling to the teamlead"
|
||||||
|
|||||||
Reference in New Issue
Block a user