public static void Register(ProcessAlgorithmSymbol processAlgorithm, IProcessAlgorithm algorithm) { if (processAlgorithm == null) { throw AutoInitAttribute.ArgumentNullException(typeof(ProcessAlgorithmSymbol), nameof(processAlgorithm)); } if (algorithm == null) { throw new ArgumentNullException(nameof(algorithm)); } registeredProcesses.Add(processAlgorithm, algorithm); }
public static ProcessEntity Create(this ProcessAlgorithmSymbol process, IProcessDataEntity processData, Entity copyMixinsFrom = null) { using (OperationLogic.AllowSave <ProcessEntity>()) { var result = new ProcessEntity(process) { State = ProcessState.Created, Data = processData, MachineName = JustMyProcesses ? Environment.MachineName : ProcessEntity.None, ApplicationName = JustMyProcesses ? Schema.Current.ApplicationName : ProcessEntity.None, User = UserHolder.Current.ToLite(), }; if (copyMixinsFrom != null) { process.CopyMixinsFrom(copyMixinsFrom); } return(result.Save()); } }
public ProcessEntity(ProcessAlgorithmSymbol process) { this.Algorithm = process; }
public static ProcessEntity?LastProcess(this ProcessAlgorithmSymbol p) => As.Expression(() => p.Processes().OrderByDescending(a => a.ExecutionStart).FirstOrDefault());
public static IQueryable <ProcessEntity> Processes(this ProcessAlgorithmSymbol p) => As.Expression(() => Database.Query <ProcessEntity>().Where(a => a.Algorithm == p));
public static ProcessEntity LastProcess(this ProcessAlgorithmSymbol p) { return(LastProcessFromAlgorithmExpression.Evaluate(p)); }
public static IQueryable <ProcessEntity> Processes(this ProcessAlgorithmSymbol p) { return(ProcessesFromAlgorithmExpression.Evaluate(p)); }
public static IProcessAlgorithm GetProcessAlgorithm(ProcessAlgorithmSymbol processAlgorithm) { return(registeredProcesses.GetOrThrow(processAlgorithm, "The process algorithm {0} is not registered")); }
public static void Register(ProcessAlgorithmSymbol processAlgorithm, Action <ExecutingProcess> action) => Register(processAlgorithm, new ActionProcessAlgorithm(action));