2using System.Collections.Generic;
4using System.Threading.Tasks;
65 public override Task
FromXml(XmlElement Definition)
71 return base.FromXml(Definition);
80 if (this.value is
null)
83 throw new Exception(
"Value already registered.");
97 throw new Exception(
"Actor not an XMPP client.");
99 object Content = this.value is
null ? string.Empty : await this.value.
EvaluateAsync(
Variables) ??
string.Empty;
102 if (Content is XmlDocument Doc)
104 else if (Content is XmlElement E)
106 else if (Content is
null)
109 throw new Exception(
"Responses must be XML, or empty.");
122 public override void ExportPlantUml(StreamWriter Output,
int Indentation,
char QuoteChar)
124 base.ExportPlantUml(Output, Indentation, QuoteChar);
126 Indent(Output, Indentation);
128 Output.Write(this.actor.
Value);
129 Output.Write(
".Respond");
137 if (!(this.value is
null))
145 Output.WriteLine(
");");
Root node of a simulation model
Abstract base class for activity nodes
async Task< object > GetActorObjectAsync(StringAttribute Actor, Variables Variables)
Gets an actor object, given a string representation, possibly containing script, of the actor.
static void Indent(StreamWriter Output, int Indentation)
Adds indentation to the current row.
Contains the value of a string attribute, possibly with embedded script.
async Task< string > GetValueAsync(Variables Variables)
Gets the value of the attribute.
string Value
String value, from definition
Abstract base class for values
Sends a custom IQ response to a recipient
override string LocalName
Local name of XML element defining contents of class.
override string Namespace
XML Namespace where the element is defined.
override string SchemaResource
Points to the embedded XML Schema resource defining the semantics of the XML namespace.
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
void Register(IValue Value)
Registers a value for the argument.
override void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
Exports PlantUML
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Respond(ISimulationNode Parent, Model Model)
Sends a custom IQ response to a recipient
override async Task< LinkedListNode< IActivityNode > > Execute(Variables Variables)
Executes a node.
Sends a custom message to a recipient
static void AppendArgument(StreamWriter Output, int Indentation, string Name, string Value, bool Quotes, char QuoteChar)
Appends an argument
Object used in simulation activities.
Abstract base class for XMPP actors.
XmppClient Client
XMPP Client
const string XmppSchema
TAG.Simulator.XMPP.Schema.ComSimXmpp.xsd
const string XmppNamespace
http://lab.tagroot.io/Schema/ComSim/XMPP.xsd
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.
Task< object > EvaluateAsync(Variables Variables)
Evaluates the value.
Interface for nodes holding a value node