2using System.Collections.Generic;
4using System.Threading.Tasks;
70 public override Task
FromXml(XmlElement Definition)
80 return base.FromXml(Definition);
89 if (this.value is
null)
92 throw new Exception(
"Value already registered.");
107 object Content = this.value is
null ? string.Empty : await this.value.
EvaluateAsync(
Variables) ??
string.Empty;
112 throw new Exception(
"Actor not an XMPP client.");
114 if (Content is XmlDocument Doc)
119 else if (Content is XmlElement E)
127 Body = Content.ToString();
141 public override void ExportPlantUml(StreamWriter Output,
int Indentation,
char QuoteChar)
143 base.ExportPlantUml(Output, Indentation, QuoteChar);
145 Indent(Output, Indentation);
147 Output.Write(this.actor.
Value);
148 Output.Write(
".SendMessage");
154 AppendArgument(Output, Indentation,
"Type", this.type.ToString(),
false, QuoteChar);
156 if (!
string.IsNullOrEmpty(this.subject.
Value))
159 if (!
string.IsNullOrEmpty(this.language.
Value))
162 if (!
string.IsNullOrEmpty(this.threadId.
Value))
165 if (!
string.IsNullOrEmpty(this.parentThreadId.
Value))
166 AppendArgument(Output, Indentation,
"ParentThreadId", this.parentThreadId.
Value,
true, QuoteChar);
168 if (!(this.value is
null))
173 AppendArgument(Output, Indentation,
"Content", this.value, QuoteChar);
176 Output.WriteLine(
");");
188 public static void AppendArgument(StreamWriter Output,
int Indentation,
string Name,
string Value,
bool Quotes,
char QuoteChar)
218 public static void AppendArgument(StreamWriter Output,
int Indentation,
string Name)
221 Indent(Output, Indentation);
Root node of a simulation model
Abstract base class for activity nodes
Executes script in an activity.
override void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
Exports PlantUML
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
abstract void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
Exports PlantUML
Sends a custom message to a recipient
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
static void AppendArgument(StreamWriter Output, int Indentation, string Name, string Value, bool Quotes, char QuoteChar)
Appends an argument
SendMessage(ISimulationNode Parent, Model Model)
Sends a custom message to a recipient
override string Namespace
XML Namespace where the element is defined.
void Register(IValue Value)
Registers a value for the argument.
override string SchemaResource
Points to the embedded XML Schema resource defining the semantics of the XML namespace.
override string LocalName
Local name of XML element defining contents of class.
override async Task< LinkedListNode< IActivityNode > > Execute(Variables Variables)
Executes a node.
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.
static void AppendArgument(StreamWriter Output, int Indentation, string Name, IValue Value, char QuoteChar)
Appends an argument
static void AppendArgument(StreamWriter Output, int Indentation, string Name)
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.
Task SendMessage(MessageType Type, string To, string CustomXml, string Body, string Subject, string Language, string ThreadId, string ParentThreadId)
Sends a simple chat message
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
MessageType
Type of message received.