Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnExternalNote.cs
1
using
System.Threading.Tasks;
2
using
System.Xml;
3
using
Waher.Content.Xml
;
4
using
Waher.Persistence.Attributes
;
5
using
Waher.Service.IoTBroker.StateMachines.Model.Attributes
;
6
7
namespace
Waher.Service.IoTBroker.StateMachines.Model.Events
8
{
12
public
abstract
class
OnExternalNote
:
OnNote
13
{
14
private
ScriptableStringAttribute
privilege;
15
private
ScriptableStringAttribute
sourceVariable;
16
20
public
OnExternalNote
()
21
: base()
22
{
23
}
24
28
[DefaultValueNull]
29
public
string
PrivilegeDefinition
30
{
31
get
=> this.privilege?.
Definition
;
32
set
=> this.privilege =
new
ScriptableStringAttribute
(value,
this
);
33
}
34
38
[DefaultValueNull]
39
public
string
SourceVariableDefinition
40
{
41
get
=> this.sourceVariable?.
Definition
;
42
set
=> this.sourceVariable =
new
ScriptableStringAttribute
(value,
this
);
43
}
44
49
public
override
Task
Parse
(XmlElement Xml)
50
{
51
this.sourceVariable =
new
ScriptableStringAttribute
(
XML
.
Attribute
(Xml,
"sourceVariable"
),
this
);
52
this.privilege =
new
ScriptableStringAttribute
(
XML
.
Attribute
(Xml,
"privilege"
),
this
);
53
54
return
base.Parse(Xml);
55
}
56
62
protected
Task<string>
GetSourceVariable
(
EvaluationArguments
Arguments)
63
{
64
return
this.sourceVariable.
Evaluate
(Arguments.
Variables
);
65
}
66
72
protected
Task<string>
GetPrivilege
(
EvaluationArguments
Arguments)
73
{
74
return
this.privilege.
Evaluate
(Arguments.
Variables
);
75
}
76
}
77
}
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:19
Waher.Content.Xml.XML.Attribute
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition:
XML.cs:914
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableAttribute.Evaluate
async Task< T > Evaluate(Variables Variables)
Evaluates the attribute
Definition:
ScriptableAttribute.cs:66
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableAttribute.Definition
string Definition
Attribute definition
Definition:
ScriptableAttribute.cs:37
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableStringAttribute
Scriptable string attribute.
Definition:
ScriptableStringAttribute.cs:7
Waher.Service.IoTBroker.StateMachines.Model.EvaluationArguments
Contains information required for evaluating script in a state-machine.
Definition:
EvaluationArguments.cs:15
Waher.Service.IoTBroker.StateMachines.Model.EvaluationArguments.Variables
Variables Variables
Current set of variables.
Definition:
EvaluationArguments.cs:47
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote
Abstract base class for external note events.
Definition:
OnExternalNote.cs:13
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote.Parse
override Task Parse(XmlElement Xml)
Parses the State-machine node.
Definition:
OnExternalNote.cs:49
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote.OnExternalNote
OnExternalNote()
Abstract base class for external note events.
Definition:
OnExternalNote.cs:20
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote.SourceVariableDefinition
string SourceVariableDefinition
Source Variable definition.
Definition:
OnExternalNote.cs:40
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote.GetSourceVariable
Task< string > GetSourceVariable(EvaluationArguments Arguments)
Evaluates the source variable to use (if any).
Definition:
OnExternalNote.cs:62
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote.GetPrivilege
Task< string > GetPrivilege(EvaluationArguments Arguments)
Evaluates the privilege to require (if any).
Definition:
OnExternalNote.cs:72
Waher.Service.IoTBroker.StateMachines.Model.Events.OnExternalNote.PrivilegeDefinition
string PrivilegeDefinition
Privilege definition.
Definition:
OnExternalNote.cs:30
Waher.Service.IoTBroker.StateMachines.Model.Events.OnNote
Abstract base class for note events.
Definition:
OnNote.cs:13
Waher.Content.Xml
Definition:
XmlCodec.cs:11
Waher.Persistence.Attributes
Definition:
ArchivingTimeAttribute.cs:4
Waher.Service.IoTBroker.StateMachines.Model.Attributes
Definition:
ExpressionAttribute.cs:9
Waher.Service.IoTBroker.StateMachines.Model.Events
Definition:
EntryEventNode.cs:12
Waher.Service.IoTBroker
StateMachines
Model
Events
OnExternalNote.cs
Generated by
1.9.5