| | | 1 | | using System.Text.Json; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Provides the immutable values available to an output converter. |
| | | 7 | | /// </summary> |
| | | 8 | | public sealed record OutputConversionContext |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new instance of the <see cref="OutputConversionContext"/> class. |
| | | 12 | | /// </summary> |
| | 11 | 13 | | public OutputConversionContext(object value, Type sourceType, Type destinationType, JsonElement? settings) |
| | | 14 | | { |
| | 11 | 15 | | Value = value; |
| | 11 | 16 | | SourceType = sourceType; |
| | 11 | 17 | | DestinationType = destinationType; |
| | 11 | 18 | | Settings = settings?.Clone(); |
| | 11 | 19 | | } |
| | | 20 | | |
| | | 21 | | /// <summary>The non-null native activity output.</summary> |
| | 5 | 22 | | public object Value { get; } |
| | | 23 | | |
| | | 24 | | /// <summary>The activity output's declared type.</summary> |
| | 0 | 25 | | public Type SourceType { get; } |
| | | 26 | | |
| | | 27 | | /// <summary>The binding destination's declared type.</summary> |
| | 0 | 28 | | public Type DestinationType { get; } |
| | | 29 | | |
| | | 30 | | /// <summary>A clone of the optional per-binding JSON settings.</summary> |
| | 1 | 31 | | public JsonElement? Settings { get; } |
| | | 32 | | } |