elsa-core/src/Flowsharp.Abstractions/Models/WorkflowExecutionScope.cs

32 lines
778 B
C#
Raw Normal View History

2018-10-14 10:24:36 +00:00
using System.Collections.Generic;
using Newtonsoft.Json;
2018-10-14 10:24:36 +00:00
namespace Flowsharp.Models
{
public class WorkflowExecutionScope
{
public WorkflowExecutionScope()
{
Variables = new Variables();
2018-10-14 10:24:36 +00:00
}
public object LastResult { get; set; }
public Variables Variables { get; }
2018-10-14 10:24:36 +00:00
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);
}
}
[JsonDictionary(ItemTypeNameHandling = TypeNameHandling.None)]
public class Variables : Dictionary<string, object>
{
}
2018-10-14 10:24:36 +00:00
}