Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnContractSignature.cs
1using System.Threading.Tasks;
2using System.Xml;
8
10{
15 {
16 private ScriptableStringAttribute legalIdVariable;
17 private ScriptableStringAttribute roleVariable;
18
23 : base()
24 {
25 }
26
30 [DefaultValueNull]
32 {
33 get => this.legalIdVariable?.Definition;
34 set => this.legalIdVariable = new ScriptableStringAttribute(value, this);
35 }
36
40 [DefaultValueNull]
42 {
43 get => this.roleVariable?.Definition;
44 set => this.roleVariable = new ScriptableStringAttribute(value, this);
45 }
46
50 public override string LocalName => nameof(OnContractSignature);
51
56 public override IStateMachineNode Create()
57 {
58 return new OnContractSignature();
59 }
60
65 public override Task Parse(XmlElement Xml)
66 {
67 this.legalIdVariable = new ScriptableStringAttribute(XML.Attribute(Xml, "legalIdVariable"), this);
68 this.roleVariable = new ScriptableStringAttribute(XML.Attribute(Xml, "roleVariable"), this);
69
70 return base.Parse(Xml);
71 }
72
82 public override async Task<EventHandlerReference> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
83 {
84 string LegalIdVariable = await this.legalIdVariable.Evaluate(Arguments.Variables);
85 string RoleVariable = await this.roleVariable.Evaluate(Arguments.Variables);
86
87 return await base.Register(EventIndex,Arguments, LegalIdVariable, RoleVariable);
88 }
89 }
90}
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
async Task< T > Evaluate(Variables Variables)
Evaluates the attribute
Contains information required for evaluating script in a state-machine.
Event raised when someone signs a contract where the owner of the associated token is part.
override Task Parse(XmlElement Xml)
Parses the State-machine node.
override async Task< EventHandlerReference > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
OnContractSignature()
Event raised when someone signs a contract where the owner of the associated token is part.
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Action executed when entering a state.
Definition: OnEvent.cs:19