diff --git a/src/WorkflowEngine.Core/ExpressionEngineExtensions.cs b/src/WorkflowEngine.Core/ExpressionEngineExtensions.cs index 149823f..60bdba8 100644 --- a/src/WorkflowEngine.Core/ExpressionEngineExtensions.cs +++ b/src/WorkflowEngine.Core/ExpressionEngineExtensions.cs @@ -20,6 +20,7 @@ public static IServiceCollection AddFunctions(this IServiceCollection services) services.RegisterScopedFunctionAlias("triggerBody"); services.RegisterScopedFunctionAlias("triggerOutputs"); services.RegisterScopedFunctionAlias("outputs"); + services.RegisterScopedFunctionAlias("outputsBody"); services.RegisterScopedFunctionAlias("items"); diff --git a/src/WorkflowEngine.Core/Expressions/OutputsBodyFunction.cs b/src/WorkflowEngine.Core/Expressions/OutputsBodyFunction.cs new file mode 100644 index 0000000..9adfb65 --- /dev/null +++ b/src/WorkflowEngine.Core/Expressions/OutputsBodyFunction.cs @@ -0,0 +1,22 @@ +using ExpressionEngine; +using ExpressionEngine.Functions.Base; +using System.Threading.Tasks; + +namespace WorkflowEngine.Core.Expressions +{ + public class OutputsBodyFunction : IFunction + { + private readonly OutputsFunction _outputsFunction; + + public OutputsBodyFunction(OutputsFunction outputsFunction) + { + _outputsFunction = outputsFunction; + } + public async ValueTask ExecuteFunction(params ValueContainer[] parameters) + { + var output = await _outputsFunction.ExecuteFunction(parameters); + + return output?["body"]; + } + } +} diff --git a/src/WorkflowEngine.Core/Expressions/OutputsFunction.cs b/src/WorkflowEngine.Core/Expressions/OutputsFunction.cs index 7ff5329..91e32d8 100644 --- a/src/WorkflowEngine.Core/Expressions/OutputsFunction.cs +++ b/src/WorkflowEngine.Core/Expressions/OutputsFunction.cs @@ -1,4 +1,4 @@ -using ExpressionEngine; +using ExpressionEngine; using ExpressionEngine.Functions.Base; using Newtonsoft.Json.Linq; using System.Threading.Tasks;