Class TaskStateBase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.stepfunctions.State
software.amazon.awscdk.services.stepfunctions.TaskStateBase
All Implemented Interfaces:
IChainable, INextable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
AthenaGetQueryExecution, AthenaGetQueryResults, AthenaStartQueryExecution, AthenaStopQueryExecution, BatchSubmitJob, BedrockInvokeModel, CallApiGatewayHttpApiEndpoint, CallApiGatewayRestApiEndpoint, CallAwsService, CallAwsServiceCrossRegion, CodeBuildStartBuild, CodeBuildStartBuildBatch, DynamoDeleteItem, DynamoGetItem, DynamoPutItem, DynamoUpdateItem, EcsRunTask, EksCall, EmrAddStep, EmrCancelStep, EmrContainersCreateVirtualCluster, EmrContainersDeleteVirtualCluster, EmrContainersStartJobRun, EmrCreateCluster, EmrModifyInstanceFleetByName, EmrModifyInstanceGroupByName, EmrSetClusterTerminationProtection, EmrTerminateCluster, EvaluateExpression, EventBridgePutEvents, GlueDataBrewStartJobRun, GlueStartCrawlerRun, GlueStartJobRun, HttpInvoke, LambdaInvoke, MediaConvertCreateJob, SageMakerCreateEndpoint, SageMakerCreateEndpointConfig, SageMakerCreateModel, SageMakerCreateTrainingJob, SageMakerCreateTransformJob, SageMakerUpdateEndpoint, SnsPublish, SqsSendMessage, StepFunctionsInvokeActivity, StepFunctionsStartExecution

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:24.364Z") @Stability(Stable) public abstract class TaskStateBase extends State implements INextable
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.

  • Constructor Details

    • TaskStateBase

      protected TaskStateBase(software.amazon.jsii.JsiiObjectRef objRef)
    • TaskStateBase

      protected TaskStateBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • TaskStateBase

      @Stability(Stable) protected TaskStateBase(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TaskStateBaseProps props)
      Parameters:
      scope - This parameter is required.
      id - Descriptive identifier for this chainable. This parameter is required.
      props - This parameter is required.
  • Method Details

    • addCatch

      @Stability(Stable) @NotNull public TaskStateBase addCatch(@NotNull IChainable handler, @Nullable CatchProps props)
      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.

      Parameters:
      handler - This parameter is required.
      props -
    • addCatch

      @Stability(Stable) @NotNull public TaskStateBase addCatch(@NotNull IChainable handler)
      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.

      Parameters:
      handler - This parameter is required.
    • addRetry

      @Stability(Stable) @NotNull public TaskStateBase addRetry(@Nullable RetryProps props)
      Add retry configuration for this state.

      This controls if and how the execution will be retried if a particular error occurs.

      Parameters:
      props -
    • addRetry

      @Stability(Stable) @NotNull public TaskStateBase addRetry()
      Add retry configuration for this state.

      This controls if and how the execution will be retried if a particular error occurs.

    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this Task.

      Default: - sum over 5 minutes

      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this Task.

      Default: - sum over 5 minutes

      Parameters:
      metricName - This parameter is required.
    • metricFailed

      @Stability(Stable) @NotNull public Metric metricFailed(@Nullable MetricOptions props)
      Metric for the number of times this activity fails.

      Default: - sum over 5 minutes

      Parameters:
      props -
    • metricFailed

      @Stability(Stable) @NotNull public Metric metricFailed()
      Metric for the number of times this activity fails.

      Default: - sum over 5 minutes

    • metricHeartbeatTimedOut

      @Stability(Stable) @NotNull public Metric metricHeartbeatTimedOut(@Nullable MetricOptions props)
      Metric for the number of times the heartbeat times out for this activity.

      Default: - sum over 5 minutes

      Parameters:
      props -
    • metricHeartbeatTimedOut

      @Stability(Stable) @NotNull public Metric metricHeartbeatTimedOut()
      Metric for the number of times the heartbeat times out for this activity.

      Default: - sum over 5 minutes

    • metricRunTime

      @Stability(Stable) @NotNull public Metric metricRunTime(@Nullable MetricOptions props)
      The interval, in milliseconds, between the time the Task starts and the time it closes.

      Default: - average over 5 minutes

      Parameters:
      props -
    • metricRunTime

      @Stability(Stable) @NotNull public Metric metricRunTime()
      The interval, in milliseconds, between the time the Task starts and the time it closes.

      Default: - average over 5 minutes

    • metricScheduled

      @Stability(Stable) @NotNull public Metric metricScheduled(@Nullable MetricOptions props)
      Metric for the number of times this activity is scheduled.

      Default: - sum over 5 minutes

      Parameters:
      props -
    • metricScheduled

      @Stability(Stable) @NotNull public Metric metricScheduled()
      Metric for the number of times this activity is scheduled.

      Default: - sum over 5 minutes

    • metricScheduleTime

      @Stability(Stable) @NotNull public Metric metricScheduleTime(@Nullable MetricOptions props)
      The interval, in milliseconds, for which the activity stays in the schedule state.

      Default: - average over 5 minutes

      Parameters:
      props -
    • metricScheduleTime

      @Stability(Stable) @NotNull public Metric metricScheduleTime()
      The interval, in milliseconds, for which the activity stays in the schedule state.

      Default: - average over 5 minutes

    • metricStarted

      @Stability(Stable) @NotNull public Metric metricStarted(@Nullable MetricOptions props)
      Metric for the number of times this activity is started.

      Default: - sum over 5 minutes

      Parameters:
      props -
    • metricStarted

      @Stability(Stable) @NotNull public Metric metricStarted()
      Metric for the number of times this activity is started.

      Default: - sum over 5 minutes

    • metricSucceeded

      @Stability(Stable) @NotNull public Metric metricSucceeded(@Nullable MetricOptions props)
      Metric for the number of times this activity succeeds.

      Default: - sum over 5 minutes

      Parameters:
      props -
    • metricSucceeded

      @Stability(Stable) @NotNull public Metric metricSucceeded()
      Metric for the number of times this activity succeeds.

      Default: - sum over 5 minutes

    • metricTime

      @Stability(Stable) @NotNull public Metric metricTime(@Nullable MetricOptions props)
      The interval, in milliseconds, between the time the activity is scheduled and the time it closes.

      Default: - average over 5 minutes

      Parameters:
      props -
    • metricTime

      @Stability(Stable) @NotNull public Metric metricTime()
      The interval, in milliseconds, between the time the activity is scheduled and the time it closes.

      Default: - average over 5 minutes

    • metricTimedOut

      @Stability(Stable) @NotNull public Metric metricTimedOut(@Nullable MetricOptions props)
      Metric for the number of times this activity times out.

      Default: - sum over 5 minutes

      Parameters:
      props -
    • metricTimedOut

      @Stability(Stable) @NotNull public Metric metricTimedOut()
      Metric for the number of times this activity times out.

      Default: - sum over 5 minutes

    • next

      @Stability(Stable) @NotNull public Chain next(@NotNull IChainable next)
      Continue normal execution with the given state.

      Specified by:
      next in interface INextable
      Parameters:
      next - This parameter is required.
      Returns:
      The chain of states built up
    • toStateJson

      @Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()
      Return the Amazon States Language object for this state.
      Specified by:
      toStateJson in class State
    • whenBoundToGraph

      @Stability(Stable) protected void whenBoundToGraph(@NotNull StateGraph graph)
      Called whenever this state is bound to a graph.

      Can be overridden by subclasses.

      Overrides:
      whenBoundToGraph in class State
      Parameters:
      graph - This parameter is required.
    • getEndStates

      @Stability(Stable) @NotNull public List<INextable> getEndStates()
      Continuable states of this Chainable.
      Specified by:
      getEndStates in interface IChainable
      Specified by:
      getEndStates in class State
    • getTaskMetrics

      @Stability(Stable) @Nullable protected abstract TaskMetricsConfig getTaskMetrics()
    • getTaskPolicies

      @Stability(Stable) @Nullable protected abstract List<PolicyStatement> getTaskPolicies()