Class RuntimeExtensions
public static class RuntimeExtensions
- Inheritance
-
RuntimeExtensions
- Inherited Members
Methods
CommitDataTransactionAsync(Runtime, Model, Activity, IEnumerable<LogEntry>, Dictionary<string, string>?, Dictionary<string, string>?, List<LogEntry>?, CancellationToken?)
Commit form log onto current model
public static Task<Model> CommitDataTransactionAsync(this Runtime runtime, Model model, Activity form, IEnumerable<LogEntry> entries, Dictionary<string, string>? context = null, Dictionary<string, string>? secrets = null, List<LogEntry>? trace = null, CancellationToken? cts = null)
Parameters
runtime
Runtimemodel
Modelform
ActivityThe activity carrying the data. This activity must have Kind either Form or Event (leaf activity).
entries
IEnumerable<LogEntry>The log to replay. If the
form
parameter is Event (leaf activity) the log can contain only DCR.Dto.EventLogEntry (see remarks).context
Dictionary<string, string>secrets
Dictionary<string, string>trace
List<LogEntry>cts
CancellationToken?
Returns
Remarks
DCR client-side data entry happens via either
- a single event, or
- a form. In either case, you split off the relevant component, ask some UI component (DCR.FormServer, DCR.Flow, your own implementation) to show it to the user, and receive back a log of user inputs.
(1) Single data event. The modeller likely expects the users input to occur atomically, to avoid relations (like spawn) firing once for each ui input event. To support this intuition, we do not replay, but simply execute the last entry in the log, which will be the final value of the event as seen by the user.
In this case, the input log can contain only executions of that event, and nothing else.
(2) Form. Here we do regular replay.
Exceptions
- InvalidOperationException
Thrown if the form event is of kind Event but the log contains entries other than DCR.Dto.EventLogEntry.