Esempio n. 1
0
        public async Task <bool> CompleteAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
        {
            TModel model = scope.GetModel();
            await scope.RunWorkflowAsync <TModel>(this.builder, model, token);

            scope.SetModel(model);

            return(await Task.FromResult(true));
        }
Esempio n. 2
0
        public async Task <bool> EvaluateAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
        {
            //thinking out-loud
            //if single rule where truecondition == false, then isTrue = false, set result to false.  good that.
            //if multi-rules mixed... then or is inferred, so if any where truecondition == true, then result = true

            bool isTrue = this.rules.Any(a => a.TrueCondition);

            trace.TraceStep(string.Format("Preset:{0}", isTrue));

            return(await Task.FromResult(isTrue));
        }
Esempio n. 3
0
 public async Task <bool> EvaluateAsync(IEngineScope <string> scope, IEngineTrace trace, CancellationToken token)
 {
     return(await Task.FromResult(true));
 }
Esempio n. 4
0
 public async Task <bool> CompleteAsync(IEngineScope <string> scope, IEngineTrace trace, CancellationToken token)
 {
     Console.WriteLine("did it");
     return(true);
 }
Esempio n. 5
0
 public async Task ValidateAsync(IEngineScope <TModel> scope, IEngineTrace trace, IRuleResult result, CancellationToken token)
 {
     await this.validator(scope, trace, result, token);
 }
Esempio n. 6
0
 public async Task <bool> EvaluateAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
 {
     return(await this.evaluator(scope, trace, token));
 }
Esempio n. 7
0
 public async Task <bool> CompleteAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
 {
     return(await this.action(scope, trace, token));
 }
Esempio n. 8
0
 public async Task <bool> EvaluateAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
 {
     trace.TraceStep("Always True");
     return(await Task.FromResult(true));
 }
Esempio n. 9
0
 public async Task <bool> CompleteAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
 {
     return(await Task.FromResult <bool>(true));
 }
Esempio n. 10
0
 public Task <bool> CompleteAsync(IEngineScope <TModel> scope, IEngineTrace trace, CancellationToken token)
 {
     trace.TraceStep(Definition.Id);
     return(Task.FromResult <bool>(true));
 }