| | | 1 | | using Elsa.Expressions.Helpers; |
| | | 2 | | using Elsa.Expressions.Models; |
| | | 3 | | using Elsa.Extensions; |
| | | 4 | | // ReSharper disable InconsistentNaming |
| | | 5 | | |
| | | 6 | | namespace Elsa.Expressions.Python.Models; |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Provides access to activity outputs. |
| | | 10 | | /// </summary> |
| | | 11 | | public class OutputProxy |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Initializes a new instance of the <see cref="OutputProxy"/> class. |
| | | 15 | | /// </summary> |
| | 0 | 16 | | public OutputProxy(ExpressionExecutionContext expressionExecutionContext) |
| | | 17 | | { |
| | 0 | 18 | | Context = expressionExecutionContext; |
| | 0 | 19 | | } |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Gets the expression execution context. |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public ExpressionExecutionContext Context { get; } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Gets the value of the specified output. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param> |
| | | 30 | | /// <param name="outputName">The name of the output.</param> |
| | | 31 | | /// <returns>The value of the output.</returns> |
| | 0 | 32 | | public object? Get(string activityIdOrName, string? outputName = default) => Context.GetOutput(activityIdOrName, out |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Gets the value of the specified output. |
| | | 36 | | /// </summary> |
| | | 37 | | /// <param name="returnType">The type to convert the output value to.</param> |
| | | 38 | | /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param> |
| | | 39 | | /// <param name="outputName">The name of the output.</param> |
| | | 40 | | /// <returns>The value of the output.</returns> |
| | 0 | 41 | | public object? Get(Type returnType, string activityIdOrName, string? outputName = default) => Get(activityIdOrName, |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// Gets the result of the last activity that executed. |
| | | 45 | | /// </summary> |
| | 0 | 46 | | public object? LastResult => Context.GetLastResult(); |
| | | 47 | | } |