@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-11T19:24:32.685Z") @Stability(value=Experimental) public interface InputProps extends software.amazon.jsii.JsiiSerializable
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();
| Modifier and Type | Interface and Description |
|---|---|
static class |
InputProps.Builder
A builder for
InputProps |
static class |
InputProps.Jsii$Proxy
An implementation for
InputProps |
| Modifier and Type | Method and Description |
|---|---|
static InputProps.Builder |
builder() |
List<String> |
getAttributeJsonPaths()
(experimental) An expression that specifies an attribute-value pair in a JSON structure.
|
default String |
getInputName()
(experimental) The name of the input.
|
@Stability(value=Experimental) @NotNull List<String> getAttributeJsonPaths()
Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to AWS IoT Events (BatchPutMessage). Each such message contains a JSON payload. The attribute (and its paired value) specified here are available for use in the condition expressions used by detectors.
@Stability(value=Experimental) @Nullable default String getInputName()
Default: - CloudFormation will generate a unique name of the input
@Stability(value=Experimental) static InputProps.Builder builder()
InputProps.Builder of InputPropsCopyright © 2022. All rights reserved.