Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnContractSignature.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.EventHandlers
;
6
using
Waher.Service.IoTBroker.StateMachines.Model.Attributes
;
7
using
Waher.Service.IoTBroker.StateMachines.Model.States
;
8
9
namespace
Waher.Service.IoTBroker.StateMachines.Model.Events
10
{
14
public
class
OnContractSignature
:
ContractEventNode
15
{
16
private
ScriptableStringAttribute
legalIdVariable;
17
private
ScriptableStringAttribute
roleVariable;
18
22
public
OnContractSignature
()
23
: base()
24
{
25
}
26
30
[DefaultValueNull]
31
public
string
LegalIdVariableDefinition
32
{
33
get
=> this.legalIdVariable?.
Definition
;
34
set
=> this.legalIdVariable =
new
ScriptableStringAttribute
(value,
this
);
35
}
36
40
[DefaultValueNull]
41
public
string
RoleVariableDefinition
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
}
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:21
Waher.Content.Xml.XML.Attribute
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition:
XML.cs:1062
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.ContractEventNode
Abstract base class for contract event nodes.
Definition:
ContractEventNode.cs:19
Waher.Service.IoTBroker.StateMachines.Model.Events.Event
Represents an event definition.
Definition:
Event.cs:14
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature
Event raised when someone signs a contract where the owner of the associated token is part.
Definition:
OnContractSignature.cs:15
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.Parse
override Task Parse(XmlElement Xml)
Parses the State-machine node.
Definition:
OnContractSignature.cs:65
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.RoleVariableDefinition
string RoleVariableDefinition
Role Variable definition.
Definition:
OnContractSignature.cs:42
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.LocalName
override string LocalName
Local name
Definition:
OnContractSignature.cs:50
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.Register
override async Task< EventHandlerReference > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
Definition:
OnContractSignature.cs:82
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.LegalIdVariableDefinition
string LegalIdVariableDefinition
Legal ID Variable definition.
Definition:
OnContractSignature.cs:32
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.OnContractSignature
OnContractSignature()
Event raised when someone signs a contract where the owner of the associated token is part.
Definition:
OnContractSignature.cs:22
Waher.Service.IoTBroker.StateMachines.Model.Events.OnContractSignature.Create
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition:
OnContractSignature.cs:56
Waher.Service.IoTBroker.StateMachines.Model.States.OnEvent
Action executed when entering a state.
Definition:
OnEvent.cs:19
Waher.Service.IoTBroker.StateMachines.Model.IStateMachineNode
Interface for State-Machine nodes
Definition:
IStateMachineNode.cs:11
Waher.Content.Xml
Definition:
Attribute.cs:7
Waher.Persistence.Attributes
Definition:
ArchivingTimeAttribute.cs:4
Waher.Service.IoTBroker.StateMachines.EventHandlers
Definition:
CachedEventHandler.cs:11
Waher.Service.IoTBroker.StateMachines.Model.Attributes
Definition:
ExpressionAttribute.cs:9
Waher.Service.IoTBroker.StateMachines.Model.Events
Definition:
ContractEventNode.cs:14
Waher.Service.IoTBroker.StateMachines.Model.States
Definition:
OnEnter.cs:4
Waher.Service.IoTBroker
StateMachines
Model
Events
OnContractSignature.cs
Generated by
1.9.5