Skip to content

Commit b3c54d5

Browse files
refactor: Refined action state
1 parent 6af5084 commit b3c54d5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

PowerAutomateMockUp/FlowParser/ActionState.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#nullable enable
22
using System.Collections.Generic;
3+
using Newtonsoft.Json.Linq;
34
using Parser.ExpressionParser;
45
using Parser.FlowParser.ActionExecutors;
56

@@ -24,7 +25,7 @@ public class ActionState
2425
public ActionResult? ActionOutput { get; set; }
2526
#nullable disable
2627
public string ActionName { get; set; }
27-
public string ActionType { get; set; }
2828
public int ActionOrder { get; set; }
29+
public JToken ActionInputJson { get; set; }
2930
}
3031
}

PowerAutomateMockUp/FlowParser/FlowRunner.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class FlowRunner : IFlowRunner
2626
private readonly IScopeDepthManager _scopeManager;
2727
private readonly IActionExecutorFactory _actionExecutorFactory;
2828
private readonly ILogger<FlowRunner> _logger;
29+
private readonly IExpressionEngine _expressionEngine;
2930
private readonly Dictionary<string, ActionState> _actionSates;
3031
private int _actionsExecuted;
3132
private JProperty _trigger;
@@ -35,14 +36,16 @@ public FlowRunner(
3536
IScopeDepthManager scopeDepthManager,
3637
IOptions<FlowSettings> flowRunnerSettings,
3738
IActionExecutorFactory actionExecutorFactory,
38-
ILogger<FlowRunner> logger)
39+
ILogger<FlowRunner> logger,
40+
IExpressionEngine expressionEngine)
3941
{
4042
_state = state ?? throw new ArgumentNullException(nameof(state));
4143
_scopeManager = scopeDepthManager;
4244
_flowRunnerSettings = flowRunnerSettings?.Value;
4345
_actionExecutorFactory =
4446
actionExecutorFactory ?? throw new ArgumentNullException(nameof(actionExecutorFactory));
4547
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
48+
_expressionEngine = expressionEngine ?? throw new ArgumentNullException(nameof(expressionEngine));
4649
_actionSates = new Dictionary<string, ActionState>();
4750
_actionsExecuted = 0;
4851
}
@@ -118,8 +121,9 @@ private async Task RunFlow()
118121

119122
_actionSates[currentAd.Name] = new ActionState
120123
{
124+
ActionInputJson = jsonInputs,
121125
ActionInput = actionExecutor?.Inputs ??
122-
(jsonInputs == null ? null : new ValueContainer(jsonInputs)),
126+
(jsonInputs == null ? null : new ValueContainer(jsonInputs, _expressionEngine)),
123127
ActionOutput = actionResult,
124128
ActionOrder = _actionsExecuted++,
125129
ActionName = actionExecutor?.ActionName

0 commit comments

Comments
 (0)