Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
StateMachineSample.cs
1using System;
2using Waher.Content;
5
7{
11 [CollectionName("StateMachineSamples")]
12 [TypeName(TypeNameSerialization.None)]
13 [ArchivingTime(nameof(ArchiveDays))]
14 [Index("StateMachineId", "Variable", "Timestamp")]
15 [Index("StateMachineId", "Timestamp", "Variable")]
16 public class StateMachineSample
17 {
21 public const string CurrentStateVariable = "<State>";
22
26 [ObjectId]
27 public string ObjectId { get; set; }
28
32 public string StateMachineId { get; set; }
33
37 public string Variable { get; set; }
38
42 public DateTime Timestamp { get; set; }
43
47 public object Value { get; set; }
48
52 public DateTime Expires { get; set; }
53
57 [DefaultValueNull]
58 public Duration? ArchiveRequired { get; set; }
59
63 [DefaultValueNull]
64 public Duration? ArchiveOptional { get; set; }
65
70 }
71}
static int CalcArchiveDays(DateTime Expires, Duration? ArchiveReq, Duration? ArchiveOpt)
Calculates the number of days an object should be archived in the ledger.
Definition: Token.cs:582
Class representing a persisted state-machine variable value.
Class representing a sample of a state machine variable over time.
Duration? ArchiveOptional
Duration after which token expires, and the required archiving time, the token can optionally be arch...
Duration? ArchiveRequired
Duration after which token expires, the token is required to be archived.
TypeNameSerialization
How the type name should be serialized.
Represents a duration value, as defined by the xsd:duration data type: http://www....
Definition: Duration.cs:13