files tree made better.

This commit is contained in:
Paul Schneider 2019-01-01 16:28:47 +00:00
commit ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions

View file

@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Yavsc.Abstract.Workflow
{
public interface IExecutionData
{
Task Payload { get; }
ITaskMetaData MetaData { get; }
string [] Args { get; }
IList<IMayBeFixable> Faults { get; }
}
}

View file

@ -0,0 +1,9 @@
namespace Yavsc.Abstract.Workflow
{
public interface IMayBeFixable
{
bool Fixable { get; }
void TryAndFix();
}
}

View file

@ -0,0 +1,7 @@
namespace Yavsc.Models
{
public interface IRequisition
{
bool Eval();
}
}

View file

@ -0,0 +1,11 @@
using System.Collections.Generic;
using Yavsc.Models;
namespace Yavsc.Abstract.Workflow
{
public interface ITaskMetaData
{
string TaskName { get; }
IEnumerable <IRequisition> Prerequisites { get; }
}
}

View file

@ -0,0 +1,7 @@
namespace Yavsc.Abstract.Workflow
{
public interface ITaskRunner
{
IExecutionData Run( ITaskMetaData taskMetaData, string [] args);
}
}

View file

@ -0,0 +1,8 @@
namespace Yavsc.Abstract.Workflow
{
public interface ITaskRunnerProvider
{
ITaskRunner[] FindRunner(string runnerName);
}
}

View file

@ -0,0 +1,20 @@
using System.Collections.Generic;
using System.Linq;
namespace Yavsc.Abstract.Workflow
{
public class TaskManager : ITaskRunnerProvider
{
List<ITaskRunner> runners = new List<ITaskRunner>();
public void Register(ITaskRunner runner)
{
runners.Add(runner);
}
public ITaskRunner[] FindRunner(string runnerName)
{
if (string.IsNullOrWhiteSpace(runnerName))
return runners.ToArray();
return runners.Where(r => r.GetType().Name.IndexOf(runnerName.Trim())>=0).ToArray();
}
}
}