extensibility:assessments:confirmation:example
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| extensibility:assessments:confirmation:example [2025/07/17 13:05] – agoldman | extensibility:assessments:confirmation:example [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ==== Beispielcode für ein Plugin vom Typ " | ||
| - | |||
| - | < | ||
| - | 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< | ||
| - | { | ||
| - | var candidate = RequestMsgHelper.GetSingleOrDefault< | ||
| - | ResponseMsg? | ||
| - | |||
| - | if (candidate == null) | ||
| - | { | ||
| - | return (request, null); | ||
| - | } | ||
| - | |||
| - | // evaluate conditions to decide whether confirmation is needed | ||
| - | // set to " | ||
| - | 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 | ||
| - | <ul> | ||
| - | < | ||
| - | < | ||
| - | </ul> | ||
| - | Bitte bestätigen: | ||
| - | |||
| - | response = ResponseMsg.PromptForConfirmation( | ||
| - | dialogTitle: | ||
| - | dialogPrompt: | ||
| - | [ | ||
| - | (choiceDialogResult: | ||
| - | (choiceDialogResult: | ||
| - | ] | ||
| - | ); | ||
| - | } | ||
| - | |||
| - | return await Task.FromResult((request, | ||
| - | } | ||
| - | } | ||
| - | </ | ||
extensibility/assessments/confirmation/example.1752757547.txt.gz · Zuletzt geändert: von agoldman
