Implement the BeoordelingEscaleren escalation capability on the Flowable Workflow Client: acquire escalation jobs, find the still-open Beoordelen task in the instance and swap its candidate group behandelaar -> teamlead via task identity links, and complete the job. Segregated onto IBeoordelingEscalatieClient so the OpenZaak worker is unaffected (ADR-0015). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
39 lines
2.2 KiB
C#
39 lines
2.2 KiB
C#
using Big.Application;
|
|
|
|
namespace Big.Infrastructure;
|
|
|
|
/// <summary>
|
|
/// The worker-facing side of the Workflow Client: acquiring and completing Flowable external-worker
|
|
/// jobs (ADR-0009). Kept separate from the Application's <see cref="IWorkflowClient"/> because job
|
|
/// acquisition is a Flowable-specific polling mechanic the application never needs to know about.
|
|
/// Implemented by <see cref="FlowableWorkflowClient"/> — the only code that talks to Flowable (§8.2).
|
|
/// </summary>
|
|
public interface IExternalWorkerClient
|
|
{
|
|
/// <summary>Acquire and lock up to <paramref name="maxJobs"/> <c>OpenZaakAanmaken</c> jobs.</summary>
|
|
Task<IReadOnlyList<OpenZaakJob>> AcquireOpenZaakJobsAsync(int maxJobs, CancellationToken ct = default);
|
|
|
|
/// <summary>Complete an acquired job, passing the opened zaak URL back into the process.</summary>
|
|
Task CompleteOpenZaakJobAsync(string jobId, Uri zaakUrl, CancellationToken ct = default);
|
|
}
|
|
|
|
/// <summary>
|
|
/// The escalation side of the Workflow Client (S-14): the <c>BeoordelingEscaleren</c> external-worker
|
|
/// jobs parked by the 14-day boundary timer on <c>Beoordelen</c>, and the reassignment they drive.
|
|
/// Kept separate from <see cref="IExternalWorkerClient"/> (interface segregation) so the OpenZaak
|
|
/// worker never sees escalation. Implemented by <see cref="FlowableWorkflowClient"/> — the only code
|
|
/// that talks to Flowable (§8.2, ADR-0015).
|
|
/// </summary>
|
|
public interface IBeoordelingEscalatieClient
|
|
{
|
|
/// <summary>Acquire and lock up to <paramref name="maxJobs"/> <c>BeoordelingEscaleren</c> jobs.</summary>
|
|
Task<IReadOnlyList<EscalatieJob>> AcquireBeoordelingEscalatieJobsAsync(int maxJobs, CancellationToken ct = default);
|
|
|
|
/// <summary>Reassign the still-open <c>Beoordelen</c> task in the given process instance from the
|
|
/// behandelaar group to teamlead. Best-effort no-op if the task is no longer open.</summary>
|
|
Task ReassignBeoordelingToTeamleadAsync(string processInstanceId, CancellationToken ct = default);
|
|
|
|
/// <summary>Complete an acquired escalation job so its token reaches the escalation end event.</summary>
|
|
Task CompleteBeoordelingEscalatieJobAsync(string jobId, CancellationToken ct = default);
|
|
}
|