Class Wait
Define a Wait state in the state machine.
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Wait : State, IChainable, INextable
Syntax (vb)
Public Class Wait Inherits State Implements IChainable, INextable
Remarks
A Wait state can be used to delay execution of the state machine for a while.
ExampleMetadata: infused
Examples
var convertToSeconds = new EvaluateExpression(this, "Convert to seconds", new EvaluateExpressionProps {
Expression = "$.waitMilliseconds / 1000",
ResultPath = "$.waitSeconds"
});
var createMessage = new EvaluateExpression(this, "Create message", new EvaluateExpressionProps {
// Note: this is a string inside a string.
Expression = "`Now waiting ${$.waitSeconds} seconds...`",
Runtime = Runtime.NODEJS_LATEST,
ResultPath = "$.message"
});
var publishMessage = new SnsPublish(this, "Publish message", new SnsPublishProps {
Topic = new Topic(this, "cool-topic"),
Message = TaskInput.FromJsonPathAt("$.message"),
ResultPath = "$.sns"
});
var wait = new Wait(this, "Wait", new WaitProps {
Time = WaitTime.SecondsPath("$.waitSeconds")
});
new StateMachine(this, "StateMachine", new StateMachineProps {
Definition = convertToSeconds.Next(createMessage).Next(publishMessage).Next(wait)
});
Synopsis
Constructors
Wait(Construct, string, IWaitProps) | Define a Wait state in the state machine. |
Properties
EndStates | Continuable states of this Chainable. |
Methods
JsonPath(Construct, string, IWaitJsonPathProps) | Define a Wait state using JSONPath in the state machine. |
Jsonata(Construct, string, IWaitJsonataProps) | Define a Wait state using JSONata in the state machine. |
Next(IChainable) | Continue normal execution with the given state. |
ToStateJson(QueryLanguage?) | Return the Amazon States Language object for this state. |
Constructors
Wait(Construct, string, IWaitProps)
Define a Wait state in the state machine.
public Wait(Construct scope, string id, IWaitProps props)
Parameters
- scope Construct
- id string
Descriptive identifier for this chainable.
- props IWaitProps
Remarks
A Wait state can be used to delay execution of the state machine for a while.
ExampleMetadata: infused
Properties
EndStates
Continuable states of this Chainable.
public override INextable[] EndStates { get; }
Property Value
Overrides
Remarks
A Wait state can be used to delay execution of the state machine for a while.
ExampleMetadata: infused
Methods
JsonPath(Construct, string, IWaitJsonPathProps)
Define a Wait state using JSONPath in the state machine.
public static Wait JsonPath(Construct scope, string id, IWaitJsonPathProps props)
Parameters
- scope Construct
- id string
- props IWaitJsonPathProps
Returns
Remarks
A Wait state can be used to delay execution of the state machine for a while.
Jsonata(Construct, string, IWaitJsonataProps)
Define a Wait state using JSONata in the state machine.
public static Wait Jsonata(Construct scope, string id, IWaitJsonataProps props)
Parameters
- scope Construct
- id string
- props IWaitJsonataProps
Returns
Remarks
A Wait state can be used to delay execution of the state machine for a while.
Next(IChainable)
Continue normal execution with the given state.
public virtual Chain Next(IChainable next)
Parameters
- next IChainable
Returns
Remarks
A Wait state can be used to delay execution of the state machine for a while.
ExampleMetadata: infused
ToStateJson(QueryLanguage?)
Return the Amazon States Language object for this state.
public override JObject ToStateJson(QueryLanguage? topLevelQueryLanguage = null)
Parameters
- topLevelQueryLanguage QueryLanguage?
Returns
JObject
Overrides
Remarks
A Wait state can be used to delay execution of the state machine for a while.
ExampleMetadata: infused