elsa-core/src/modules/Elsa.Python/Models/OutcomeProxy.cs
2023-11-19 21:13:19 +01:00

34 lines
1,010 B
C#

using Elsa.Expressions.Models;
// ReSharper disable InconsistentNaming
namespace Elsa.Python.Models;
/// <summary>
/// Provides access to activity outcomes.
/// </summary>
public class OutcomeProxy
{
/// <summary>
/// Gets the key of the outcomes property.
/// </summary>
public static readonly object OutcomePropertiesKey = new();
/// <summary>
/// Initializes a new instance of the <see cref="OutcomeProxy"/> class.
/// </summary>
public OutcomeProxy(ExpressionExecutionContext expressionExecutionContext)
{
ExpressionExecutionContext = expressionExecutionContext;
}
private ExpressionExecutionContext ExpressionExecutionContext { get; }
/// <summary>
/// Sets the outcome of the current activity.
/// </summary>
/// <param name="outcomeNames">The names of the outcomes.</param>
public void Set(params string[] outcomeNames)
{
ExpressionExecutionContext.TransientProperties[OutcomePropertiesKey] = outcomeNames;
}
}