Adds RegistratieVerlopenJob, IRegistratieVerlopenClient, the ExpireRegistrationWorker application handler, and the RegistratieVerlopenProcessor drain loop — the timeout counterpart to the OpenZaak/escalation worker trios. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
55 lines
3.1 KiB
C#
55 lines
3.1 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);
|
|
}
|
|
|
|
/// <summary>
|
|
/// The document-timeout side of the Workflow Client (S-10a): the <c>RegistratieVerlopen</c>
|
|
/// external-worker jobs parked by the 30-day boundary timer on <c>WachtOpDocumenten</c>. Kept separate
|
|
/// from the other worker ports (interface segregation) so neither the OpenZaak nor escalation worker
|
|
/// sees expiry. Implemented by <see cref="FlowableWorkflowClient"/> — the only code that talks to
|
|
/// Flowable (§8.2, ADR-0017).
|
|
/// </summary>
|
|
public interface IRegistratieVerlopenClient
|
|
{
|
|
/// <summary>Acquire and lock up to <paramref name="maxJobs"/> <c>RegistratieVerlopen</c> jobs.</summary>
|
|
Task<IReadOnlyList<RegistratieVerlopenJob>> AcquireRegistratieVerlopenJobsAsync(int maxJobs, CancellationToken ct = default);
|
|
|
|
/// <summary>Complete an acquired expiry job so its token reaches the <c>endVerlopen</c> end event.</summary>
|
|
Task CompleteRegistratieVerlopenJobAsync(string jobId, CancellationToken ct = default);
|
|
}
|