Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ActionWithReasonNode.cs
1using System.Threading.Tasks;
2using System.Xml;
3
5{
9 public abstract class ActionWithReasonNode : ActionNode
10 {
11 private Reason reason;
12
17 : base()
18 {
19 }
20
25 public override async Task Parse(XmlElement Xml)
26 {
27 await base.Parse(Xml);
28
29 this.ConvertValueAttributeToElement<Reason>(Xml, true);
30 }
31
35 protected override void OnChildNodesUpdated()
36 {
37 base.OnChildNodesUpdated();
38
39 this.reason = this.GetValueElement<Reason>();
40 }
41
46 public override sealed async Task Execute(EvaluationArguments Arguments)
47 {
48 string Reason = (await this.reason.Evaluate(Arguments))?.ToString();
49
50 await this.Execute(Arguments, Reason);
51 }
52
58 public abstract Task Execute(EvaluationArguments Arguments, string Reason);
59 }
60}
Abstract base class for State-Machine action nodes.
Definition: ActionNode.cs:9
override void OnChildNodesUpdated()
Method called whenever ChildNodes is updated.
ActionWithReasonNode()
Abstract base class for actions with reason property.
abstract Task Execute(EvaluationArguments Arguments, string Reason)
Evaluates the action node
override async Task Parse(XmlElement Xml)
Parses the State-machine node.
override sealed async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
Contains information required for evaluating script in a state-machine.
Task< object > Evaluate(EvaluationArguments Arguments)
Evaluates the value node.
Definition: Value.cs:147