Class EventEvaluation
(experimental) Information about the order in which events are evaluated and how actions are executed.
Inheritance
Namespace: Amazon.CDK.AWS.IoTEvents
Assembly: Amazon.CDK.AWS.IoTEvents.dll
Syntax (csharp)
public sealed class EventEvaluation : Enum
Syntax (vb)
Public NotInheritable Class EventEvaluation
Inherits
Enum
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.IoTEvents;
using Amazon.CDK.AWS.IoTEvents.Actions;
using Amazon.CDK.AWS.Lambda;
IFunction func;
var input = new Input(this, "MyInput", new InputProps {
InputName = "my_input", // optional
AttributeJsonPaths = new [] { "payload.deviceId", "payload.temperature" }
});
var warmState = new State(new StateProps {
StateName = "warm",
OnEnter = new [] { new Event {
EventName = "test-enter-event",
Condition = Expression.CurrentInput(input),
Actions = new [] { new LambdaInvokeAction(func) }
} },
OnInput = new [] { new Event { // optional
EventName = "test-input-event",
Actions = new [] { new LambdaInvokeAction(func) } } },
OnExit = new [] { new Event { // optional
EventName = "test-exit-event",
Actions = new [] { new LambdaInvokeAction(func) } } }
});
var coldState = new State(new StateProps {
StateName = "cold"
});
// transit to coldState when temperature is less than 15
warmState.TransitionTo(coldState, new TransitionOptions {
EventName = "to_coldState", // optional property, default by combining the names of the States
When = Expression.Lt(Expression.InputAttribute(input, "payload.temperature"), Expression.FromString("15")),
Executing = new [] { new LambdaInvokeAction(func) }
});
// transit to warmState when temperature is greater than or equal to 15
coldState.TransitionTo(warmState, new TransitionOptions {
When = Expression.Gte(Expression.InputAttribute(input, "payload.temperature"), Expression.FromString("15"))
});
new DetectorModel(this, "MyDetectorModel", new DetectorModelProps {
DetectorModelName = "test-detector-model", // optional
Description = "test-detector-model-description", // optional property, default is none
EvaluationMethod = EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH
DetectorKey = "payload.deviceId", // optional property, default is none and single detector instance will be created and all inputs will be routed to it
InitialState = warmState
});
Synopsis
Fields
BATCH | (experimental) When setting to BATCH, variables within a state are updated and events within a state are performed only after all event conditions are evaluated. |
SERIAL | (experimental) When setting to SERIAL, variables are updated and event conditions are evaluated in the order that the events are defined. |
value__ |
Fields
BATCH
(experimental) When setting to BATCH, variables within a state are updated and events within a state are performed only after all event conditions are evaluated.
public const EventEvaluation BATCH
Field Value
Type | Description |
---|---|
EventEvaluation |
Remarks
Stability: Experimental
SERIAL
(experimental) When setting to SERIAL, variables are updated and event conditions are evaluated in the order that the events are defined.
public const EventEvaluation SERIAL
Field Value
Type | Description |
---|---|
EventEvaluation |
Remarks
Stability: Experimental
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |