elsa-core/src/Flowsharp.Abstractions/Models/WorkflowExecutionScope.cs
2018-10-16 12:26:43 +02:00

28 lines
724 B
C#

namespace Flowsharp.Models
{
public class WorkflowExecutionScope
{
public WorkflowExecutionScope()
{
Variables = new Variables();
}
public object LastResult { get; set; }
public Variables Variables { get; }
public void SetVariable(string variableName, object value)
{
Variables[variableName] = value;
}
public T GetVariable<T>(string name)
{
return Variables.ContainsKey(name) ? (T)Variables[name] : default(T);
}
public object GetVariable(string name)
{
return Variables.ContainsKey(name) ? Variables[name] : null;
}
}
}