class TaskStateBase
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.StepFunctions.TaskStateBase |
Java | software.amazon.awscdk.services.stepfunctions.TaskStateBase |
Python | aws_cdk.aws_stepfunctions.TaskStateBase |
TypeScript (source) | @aws-cdk/aws-stepfunctions » TaskStateBase |
Implements
IConstruct, IConstruct, IDependable, IChainable, INextable
Extends
State
Implemented by
Athena, Athena, Athena, Athena, Batch, Call, Call, Call, Code, Dynamo, Dynamo, Dynamo, Dynamo, Ecs, Eks, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Evaluate, Event, Glue, Glue, Lambda, Sage, Sage, Sage, Sage, Sage, Sage, Sns, Sqs, Step, Step
Define a Task state in the state machine.
Reaching a Task state causes some work to be executed, represented by the Task's resource property. Task constructs represent a generic Amazon States Language Task.
For some resource types, more specific subclasses of Task may be available which are more convenient to use.
Initializer
new TaskStateBase(scope: Construct, id: string, props: TaskStateBaseProps)
Parameters
- scope
Construct - id
string - props
TaskState Base Props
Properties
| Name | Type | Description |
|---|---|---|
| end | INextable[] | Continuable states of this Chainable. |
| id | string | Descriptive identifier for this chainable. |
| node | Construct | The construct tree node associated with this construct. |
| start | State | First state of this Chainable. |
| state | string | Tokenized string that evaluates to the state's ID. |
| task | Task | |
| task | Policy[] |
endStates
Type:
INextable[]
Continuable states of this Chainable.
id
Type:
string
Descriptive identifier for this chainable.
node
Type:
Construct
The construct tree node associated with this construct.
startState
Type:
State
First state of this Chainable.
stateId
Type:
string
Tokenized string that evaluates to the state's ID.
taskMetrics?
Type:
Task
(optional)
taskPolicies?
Type:
Policy[]
(optional)
Methods
| Name | Description |
|---|---|
| add | Add a recovery handler for this state. |
| add | Add a prefix to the stateId of this state. |
| add | Add retry configuration for this state. |
| bind | Register this state as part of the given graph. |
| metric(metricName, props?) | Return the given named metric for this Task. |
| metric | Metric for the number of times this activity fails. |
| metric | Metric for the number of times the heartbeat times out for this activity. |
| metric | The interval, in milliseconds, between the time the Task starts and the time it closes. |
| metric | The interval, in milliseconds, for which the activity stays in the schedule state. |
| metric | Metric for the number of times this activity is scheduled. |
| metric | Metric for the number of times this activity is started. |
| metric | Metric for the number of times this activity succeeds. |
| metric | The interval, in milliseconds, between the time the activity is scheduled and the time it closes. |
| metric | Metric for the number of times this activity times out. |
| next(next) | Continue normal execution with the given state. |
| to | Return the Amazon States Language object for this state. |
| to | Returns a string representation of this construct. |
| protected when | Called whenever this state is bound to a graph. |
addCatch(handler, props?)
public addCatch(handler: IChainable, props?: CatchProps): TaskStateBase
Parameters
- handler
IChainable - props
CatchProps
Returns
Add a recovery handler for this state.
When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.
addPrefix(x)
public addPrefix(x: string): void
Parameters
- x
string
Add a prefix to the stateId of this state.
addRetry(props?)
public addRetry(props?: RetryProps): TaskStateBase
Parameters
- props
RetryProps
Returns
Add retry configuration for this state.
This controls if and how the execution will be retried if a particular error occurs.
bindToGraph(graph)
public bindToGraph(graph: StateGraph): void
Parameters
- graph
StateGraph
Register this state as part of the given graph.
Don't call this. It will be called automatically when you work with states normally.
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string - props
MetricOptions
Returns
Return the given named metric for this Task.
metricFailed(props?)
public metricFailed(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times this activity fails.
metricHeartbeatTimedOut(props?)
public metricHeartbeatTimedOut(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times the heartbeat times out for this activity.
metricRunTime(props?)
public metricRunTime(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
The interval, in milliseconds, between the time the Task starts and the time it closes.
metricScheduleTime(props?)
public metricScheduleTime(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
The interval, in milliseconds, for which the activity stays in the schedule state.
metricScheduled(props?)
public metricScheduled(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times this activity is scheduled.
metricStarted(props?)
public metricStarted(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times this activity is started.
metricSucceeded(props?)
public metricSucceeded(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times this activity succeeds.
metricTime(props?)
public metricTime(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
The interval, in milliseconds, between the time the activity is scheduled and the time it closes.
metricTimedOut(props?)
public metricTimedOut(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times this activity times out.
next(next)
public next(next: IChainable): Chain
Parameters
- next
IChainable
Returns
Continue normal execution with the given state.
toStateJson()
public toStateJson(): json
Returns
json
Return the Amazon States Language object for this state.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected whenBoundToGraph(graph)
protected whenBoundToGraph(graph: StateGraph): void
Parameters
- graph
StateGraph
Called whenever this state is bound to a graph.
Can be overridden by subclasses.

.NET
Java
Python
TypeScript (