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 33160fa7d0 - Show all commits

View File

@@ -14,6 +14,24 @@ public sealed class BeoordelingEscalatieProcessor(
ILogger<BeoordelingEscalatieProcessor> logger) ILogger<BeoordelingEscalatieProcessor> logger)
{ {
/// <summary>Acquire and process up to <paramref name="maxJobs"/> escalations. Returns the number acquired.</summary> /// <summary>Acquire and process up to <paramref name="maxJobs"/> escalations. Returns the number acquired.</summary>
public Task<int> PumpOnceAsync(int maxJobs, CancellationToken ct = default) public async Task<int> PumpOnceAsync(int maxJobs, CancellationToken ct = default)
=> throw new NotImplementedException(); {
var jobs = await client.AcquireBeoordelingEscalatieJobsAsync(maxJobs, ct);
foreach (var job in jobs)
{
try
{
await client.ReassignBeoordelingToTeamleadAsync(job.ProcessInstanceId, ct);
await client.CompleteBeoordelingEscalatieJobAsync(job.JobId, ct);
}
catch (Exception ex)
{
// Leave the job un-completed: its lock expires and Flowable redelivers it (§8.6).
logger.LogError(ex, "BeoordelingEscaleren job {JobId} failed; leaving it for redelivery.", job.JobId);
}
}
return jobs.Count;
}
} }