@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-11T19:24:32.679Z") @Stability(value=Experimental) public enum EventEvaluation extends Enum<EventEvaluation>
Example:
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
IFunction func;
Input input = Input.Builder.create(this, "MyInput")
.inputName("my_input") // optional
.attributeJsonPaths(List.of("payload.deviceId", "payload.temperature"))
.build();
State warmState = State.Builder.create()
.stateName("warm")
.onEnter(List.of(Event.builder()
.eventName("test-enter-event")
.condition(Expression.currentInput(input))
.actions(List.of(new LambdaInvokeAction(func)))
.build()))
.onInput(List.of(Event.builder() // optional
.eventName("test-input-event")
.actions(List.of(new LambdaInvokeAction(func))).build()))
.onExit(List.of(Event.builder() // optional
.eventName("test-exit-event")
.actions(List.of(new LambdaInvokeAction(func))).build()))
.build();
State coldState = State.Builder.create()
.stateName("cold")
.build();
// transit to coldState when temperature is less than 15
warmState.transitionTo(coldState, TransitionOptions.builder()
.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(List.of(new LambdaInvokeAction(func)))
.build());
// transit to warmState when temperature is greater than or equal to 15
coldState.transitionTo(warmState, TransitionOptions.builder()
.when(Expression.gte(Expression.inputAttribute(input, "payload.temperature"), Expression.fromString("15")))
.build());
DetectorModel.Builder.create(this, "MyDetectorModel")
.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)
.build();
| Enum Constant and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
static EventEvaluation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EventEvaluation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Experimental) public static final EventEvaluation BATCH
@Stability(value=Experimental) public static final EventEvaluation SERIAL
public static EventEvaluation[] values()
for (EventEvaluation c : EventEvaluation.values()) System.out.println(c);
public static EventEvaluation valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.