Skip to main content
Version: 2.8

Timers

Timing nodes are used to trigger events within a time range.

AttributeDescriptionData Type
IdId of the timing nodeSystem.Guid
NameName of the nodeSystem.String
ModeTiming mode: (“Interval”; “ExactTime” exact timing in month, days, hours, minutes or seconds)
IntervalInterval in C# time span format, only valid if mode is Interval. e. g. 12.13:45:22.8262; = 12 days, 13 hours, 45 minutes 22.8262 secondsSystem.TimeSpan
InitialDelayInitial delay before the first timer event is thrown. Zero means that the first call is done after the interval.System.TimeSpan
ExactSecondEvent at the given secondSystem.Int32
ExactMinuteEvent at the given minuteSystem.Int32
ExactHourEvent at the given hourSystem.Int32
ExactDayEvent at the given daySystem.Int32
ExactMonthEvent at the given monthSystem.Int32

Example of a time firing the timer event every day at 01:30:00:

{
"Timers": [
{
"Id": "6B43DBD5-92FA-4304-8BDA-A2AB5793644A",
"Name": "Timer1",
"Mode": "ExactTime",
"ExactHour": 1,
"ExactMinute": 30,
}
]
}

Example of a time firing the timer event every hour, initially after 5min:

{
"Timers": [
{
"Id": "6B43DBD5-92FA-4304-8BDA-A2AB5793644A",
"Name": "Timer1",
"Mode": "Interval",
"Interval": "0.1:00",
"InitialDelay": "0.0:05",
}
]
}

Triggering Rules with Timers

Timer can be directly combined with rules. This allows to trigger rules within a period of time (interval) or at some exact time.

Example schema triggering a command after 30 min.

{
"Id": "D6680B09-3F70-4332-B8C5-603DE8E79252",
"Name": "HumanOS.Service.IdentityService.Objects.Schema",
"Timers": [
{
"Id": "6B43DBD5-92FA-4304-8BDA-A2AB5793644A",
"Name": "Timer1",
"Mode": "Interval",
"Interval": "0.00:30:00",
"ExactMinute": 30,
}
]
"Rules": [
{
"Name": "Rule1",
"Id": "511E2765-457C-43B9-8BE8-59E26F1B6768",
"Type": "GenericRule",
"TriggerEvent": "OnTimer",
"TriggerCondition": "Node.Name == 'Timer1'",
"Action": {
"Type": "Command",
"Arguments": [],
"CommandExpression": {
"Id": "CB00EE4E-AAE6-4C01-A9D8-C8E949D5AC6F",
"Arguments": []
}
}
}
]
}