2018-10-14 10:24:36 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using Flowsharp.Models;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Flowsharp.Activities
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Workflow
|
|
|
|
|
|
{
|
2018-10-14 15:16:33 +00:00
|
|
|
|
public Workflow(IEnumerable<IActivity> activities, IEnumerable<Connection> connections) : this()
|
2018-10-14 10:24:36 +00:00
|
|
|
|
{
|
|
|
|
|
|
Activities = activities.ToList();
|
2018-10-14 11:49:29 +00:00
|
|
|
|
Connections = connections.ToList();
|
2018-10-14 10:24:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-10-14 15:16:33 +00:00
|
|
|
|
public Workflow()
|
|
|
|
|
|
{
|
|
|
|
|
|
CurrentScope = new WorkflowExecutionScope();
|
|
|
|
|
|
Scopes = new Stack<WorkflowExecutionScope>(new[]{ CurrentScope });
|
|
|
|
|
|
Arguments = new Variables();
|
|
|
|
|
|
HaltedActivities = new List<IActivity>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public WorkflowStatus Status { get; set; }
|
2018-10-14 10:24:36 +00:00
|
|
|
|
public IList<IActivity> Activities { get; set; } = new List<IActivity>();
|
|
|
|
|
|
public IList<Connection> Connections { get; set; } = new List<Connection>();
|
2018-10-14 11:49:29 +00:00
|
|
|
|
public Stack<WorkflowExecutionScope> Scopes { get; set; }
|
|
|
|
|
|
public WorkflowExecutionScope CurrentScope { get; set; }
|
2018-10-14 15:16:33 +00:00
|
|
|
|
public Variables Arguments { get; set; }
|
|
|
|
|
|
public IList<IActivity> HaltedActivities { get; set; }
|
2018-10-14 10:24:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|