Class WaitTime
Represents the Wait state which delays a state machine from continuing for a specified time.
Inheritance
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class WaitTime : DeputyBase
Syntax (vb)
Public Class WaitTime
Inherits DeputyBase
Remarks
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
WaitTime(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
WaitTime(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Duration(Duration) | Wait a fixed amount of time. |
Seconds(String) | Wait for a number of seconds stored in the state object from string. This method can use JSONata expression. |
SecondsPath(String) | Wait for a number of seconds stored in the state object. |
Timestamp(String) | Wait until the given ISO8601 timestamp. This method can use JSONata expression. |
TimestampPath(String) | Wait until a timestamp found in the state object. |
Constructors
WaitTime(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected WaitTime(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
WaitTime(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected WaitTime(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Duration(Duration)
Wait a fixed amount of time.
public static WaitTime Duration(Duration duration)
Parameters
- duration Duration
Returns
Seconds(String)
Wait for a number of seconds stored in the state object from string. This method can use JSONata expression.
public static WaitTime Seconds(string seconds)
Parameters
- seconds System.String
Returns
Remarks
If you want to use fixed value, we recommend using WaitTime.duration()
Example value: {% $waitSeconds %}
SecondsPath(String)
Wait for a number of seconds stored in the state object.
public static WaitTime SecondsPath(string path)
Parameters
- path System.String
Returns
Remarks
Example value: $.waitSeconds
Timestamp(String)
Wait until the given ISO8601 timestamp. This method can use JSONata expression.
public static WaitTime Timestamp(string timestamp)
Parameters
- timestamp System.String
Returns
Remarks
Example value: 2016-03-14T01:59:00Z
TimestampPath(String)
Wait until a timestamp found in the state object.
public static WaitTime TimestampPath(string path)
Parameters
- path System.String
Returns
Remarks
Example value: $.waitTimestamp