2using System.Threading.Tasks;
77 public override async Task
Parse(XmlElement Xml)
79 this.ObjectVariable =
XML.
Attribute(Xml,
"objectVariable");
81 await base.Parse(Xml);
101 base.OnChildNodesUpdated();
103 this.hash = this.GetValueElement<Hash>();
104 this.realm = this.GetValueElement<Realm>();
105 this.then = this.GetChildElement<Then>(
true);
106 this.@
else = this.GetChildElement<Else>(
false);
115 object HashValue = await this.hash.
Evaluate(Arguments);
116 object RealmValue = this.realm is
null ? null : await this.realm.
Evaluate(Arguments);
120 if (!(HashValue is
byte[]
Hash))
123 if (RealmValue is
null)
125 else if (RealmValue is
string s)
132 Realm ??=
string.Empty;
151 await this.then.
Execute(Arguments);
152 else if (!(this.@
else is
null))
153 await this.@
else.Execute(Arguments);
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Represents a case-insensitive string.
Static class managing persistent counters.
static Task< bool > VerifyHash(byte[] Hash)
Verifies if a hash value has been persisted in the database, using the default (empty) realm.
static Task< object > TryGetAssociatedObject(byte[] Hash)
Tries to get the associated object of a hash value that has been persisted in the database,...
Exception related to state machine.
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
Abstract base class for State-Machine action nodes.
Actions executed if condition or conditions not matching.
Conditional execution, using an IFHASH-THEN[-ELSE] statement. Checks if a hash exists in the hash sto...
string ObjectVariable
Optional object variable name.
override string LocalName
Local name
override async Task Parse(XmlElement Xml)
Parses the State-machine node.
Realm Realm
Realm associated with the hash.
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
override IStateMachineNode Create()
Creates a new node of the corresponding type.
override void OnChildNodesUpdated()
Method called whenever ChildNodes is updated.
IfHash()
Conditional execution, using an IFHASH-THEN[-ELSE] statement. Checks if a hash exists in the hash sto...
Actions executed if condition is true.
Contains information required for evaluating script in a state-machine.
StateMachine Machine
Reference to state-machine definition.
Variables Variables
Current set of variables.
void ConvertValueAttributesToElements(XmlElement Xml, Type[] ValueTypes, bool[] Required)
Converts value attributes to parsed elements. The XML definition has to be parsed before,...
Value()
Abstract base class for nodes with a value.
Task< object > Evaluate(EvaluationArguments Arguments)
Evaluates the value node.
Interface for State-Machine nodes