public async Task <T> EvaluateAsync <T>(string expression,
                                                WorkflowExecutionContext workflowContext,
                                                IDictionary <string, object> arguments = null,
                                                CancellationToken cancellationToken    = default)
        {
            var templateContext = await CreateTemplateContextAsync(workflowContext);

            var expressionContext = new WorkflowExecutionLiquidContext(templateContext, workflowContext);

            await _workflowContextHandlers.InvokeAsync(x => x.EvaluatingLiquidAsync(expressionContext), _logger);

            var result = await _liquidTemplateManager.RenderAsync(expression,
                                                                  System.Text.Encodings.Web.JavaScriptEncoder.Default, templateContext);

            return(string.IsNullOrWhiteSpace(result) ? default : (T)Convert.ChangeType(result, typeof(T)));
        }
Beispiel #2
0
 public Task EvaluatingLiquidAsync(WorkflowExecutionLiquidContext context)
 {
     return(Task.CompletedTask);
 }