internal async Task PerformLeafTypeBehavior()

in Forge.TreeWalker/src/TreeWalkerSession.cs [551:573]


        internal async Task PerformLeafTypeBehavior(TreeNode treeNode)
        {
            // Check if Leaf node contains the LeafNodeSummaryAction and commit ActionInput as ActionResponse if it does.
            if (treeNode.Actions == null || treeNode.Actions.Count != 1)
            {
                return;
            }

            foreach (KeyValuePair<string, TreeAction> kvp in treeNode.Actions)
            {
                string treeActionKey = kvp.Key;
                TreeAction treeAction = kvp.Value;

                if (treeAction.Action != LeafNodeSummaryAction)
                {
                    return;
                }

                ActionResponse actionResponse = await this.EvaluateDynamicProperty(treeAction.Input, typeof(ActionResponse)).ConfigureAwait(false);
                await this.CommitActionResponse(treeActionKey, actionResponse).ConfigureAwait(false);
                return;
            }
        }