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