==== Beispielcode für ein Plugin vom Typ "Erweiterung" um einen Bestätigungsdialog zu einem Formular anzuzeigen ==== using Grpc.Core; using System; using System.Threading.Tasks; using Caats.Infrastructure.Authorization; using Caats.Infrastructure.Helper; using Caats.Infrastructure.Extensions; using Caats.Proto; namespace Caats.Service.Infrastructure.Extensibility; [PluginServiceDto(typeof(ChecklistInstanceDto))] public class ChkValidationPoC : PluginBase { public override PluginDto Ident() => new() { }; public async override Task<(RequestMsg, ResponseMsg?)> OnBeforeUpdate(RequestMsg request, Lazy identity, ServerCallContext context) { var candidate = RequestMsgHelper.GetSingleOrDefault(request); ResponseMsg? response = null; if (candidate == null) { return (request, null); } // evaluate conditions to decide whether confirmation is needed // set to "true" for brevity (because this is not the subject of the tutorial) var confirmationNeeded = true; if (request.IsConfirmationPromptAnswered()) { // user has already answered the confirmation prompt } else if (confirmationNeeded) { // this will result in the user being asked for confirmation // (and the update call will not immediately go ahead in the backend) // the prompt supports html (no script) for formatting: var prompt = @"Die eingegebene Leistungszeit liegt mehr als 7 Tage in der Vergangenheit
  • Leistungen eines Einsatzes sollten aufeinanderfolgen
  • Anfahrt und Abfahrt sollten an die Leistungszeit angrenzen
Bitte bestätigen: Trotzdem buchen?"; response = ResponseMsg.PromptForConfirmation( dialogTitle: "Bestätigung erforderlich", dialogPrompt: prompt, [ (choiceDialogResult: ResponseMsg.DialogResult.Save, choiceKey: "indeed", choiceLabel: "COMMON.YES"), (choiceDialogResult: ResponseMsg.DialogResult.Cancel, choiceKey: "nope", choiceLabel: "COMMON.DIALOG_ACTION_CANCEL") ] ); } return await Task.FromResult((request, response)); } }
Die dem Beispiel zugrunde liegende **Checklisten-Definition** sieht in der Excel-Datei folgendermaßen aus: {{ :extensibility:assessments:confirmation:screenshot_2025-07-17_154342.png?nolink |}}