Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ContractAction.cs
1using System.Threading.Tasks;
2using System.Xml;
7
9{
13 public abstract class ContractAction : ActionWithReasonNode
14 {
15 private ScriptableStringAttribute contractId;
16
21 : base()
22 {
23 }
24
28 [DefaultValueNull]
30 {
31 get => this.contractId?.Definition;
32 set => this.contractId = new ScriptableStringAttribute(value, this);
33 }
34
39 public override async Task Parse(XmlElement Xml)
40 {
41 this.contractId = new ScriptableStringAttribute(XML.Attribute(Xml, "contractId"), this);
42
43 await base.Parse(Xml);
44 }
45
51 public override sealed async Task Execute(EvaluationArguments Arguments, string Reason)
52 {
53 string ContractId = await this.contractId.Evaluate(Arguments.Variables);
54
55 await this.Execute(Arguments, Reason, ContractId);
56 }
57
64 public abstract Task Execute(EvaluationArguments Arguments, string Reason, string ContractId);
65 }
66}
Helps with common XML-related tasks.
Definition: XML.cs:21
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:1062
abstract Task Execute(EvaluationArguments Arguments, string Reason, string ContractId)
Evaluates the action node
override async Task Parse(XmlElement Xml)
Parses the State-machine node.
override sealed async Task Execute(EvaluationArguments Arguments, string Reason)
Evaluates the action node
async Task< T > Evaluate(Variables Variables)
Evaluates the attribute
Contains information required for evaluating script in a state-machine.