Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OwnerEventNode.cs
1using System.Threading.Tasks;
6
8{
12 public abstract class OwnerEventNode : EventNode
13 {
18 : base()
19 {
20 }
21
31 public override async Task<EventHandlerReference> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
32 {
33 if (Arguments.Token is null)
34 throw new StateMachineException(Arguments.Machine, "State Machine does not have single token owner.");
35
36 OwnerEventHandler Handler = new OwnerEventHandler(Arguments, EventIndex, this, Arguments.Token.OwnerJid);
37
38 await Database.Insert(Handler);
39 await Handler.AddToCache();
40
41 return null;
42 }
43
44 }
45}
Static interface for database persistence. In order to work, a database provider has to be assigned t...
Definition: Database.cs:21
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Definition: Database.cs:97
async Task AddToCache()
Removes the event handler from the cache.
Contains information required for evaluating script in a state-machine.
StateMachine Machine
Reference to state-machine definition.
Abstract base class for State-Machine event nodes.
Definition: EventNode.cs:11
override async Task< EventHandlerReference > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
OwnerEventNode()
Abstract base class for owner event nodes.
Action executed when entering a state.
Definition: OnEvent.cs:19