Skip to content

Commit

Permalink
fix: Added outputsbody function
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Sep 13, 2024
1 parent 589ce2a commit b9a269f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/WorkflowEngine.Core/ExpressionEngineExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static IServiceCollection AddFunctions(this IServiceCollection services)
services.RegisterScopedFunctionAlias<TriggerBodyFunction>("triggerBody");
services.RegisterScopedFunctionAlias<TriggerOutputsFunction>("triggerOutputs");
services.RegisterScopedFunctionAlias<OutputsFunction>("outputs");
services.RegisterScopedFunctionAlias<OutputsBodyFunction>("outputsBody");
services.RegisterScopedFunctionAlias<ItemsFunction>("items");


Expand Down
22 changes: 22 additions & 0 deletions src/WorkflowEngine.Core/Expressions/OutputsBodyFunction.cs
Original file line number Diff line number Diff line change
@@ -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<ValueContainer> ExecuteFunction(params ValueContainer[] parameters)
{
var output = await _outputsFunction.ExecuteFunction(parameters);

return output?["body"];
}
}
}
2 changes: 1 addition & 1 deletion src/WorkflowEngine.Core/Expressions/OutputsFunction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ExpressionEngine;
using ExpressionEngine;
using ExpressionEngine.Functions.Base;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
Expand Down

0 comments on commit b9a269f

Please sign in to comment.