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