Class Parallel
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.stepfunctions.State
software.amazon.awscdk.services.stepfunctions.Parallel
- All Implemented Interfaces:
- IConstruct,- IDependable,- IChainable,- INextable,- software.amazon.jsii.JsiiSerializable,- software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
           date="2023-06-19T16:30:39.922Z")
@Stability(Stable)
public class Parallel
extends State
implements INextable
Define a Parallel state in the state machine.
 
A Parallel state can be used to run one or more state machines at the same time.
The Result of a Parallel state is an array of the results of its substatemachines.
Example:
 import software.amazon.awscdk.core.Stack;
 import software.constructs.Construct;
 import software.amazon.awscdk.services.stepfunctions.*;
 public class MyJobProps {
     private String jobFlavor;
     public String getJobFlavor() {
         return this.jobFlavor;
     }
     public MyJobProps jobFlavor(String jobFlavor) {
         this.jobFlavor = jobFlavor;
         return this;
     }
 }
 public class MyJob extends StateMachineFragment {
     public final State startState;
     public final INextable[] endStates;
     public MyJob(Construct parent, String id, MyJobProps props) {
         super(parent, id);
         Choice choice = new Choice(this, "Choice").when(Condition.stringEquals("$.branch", "left"), new Pass(this, "Left Branch")).when(Condition.stringEquals("$.branch", "right"), new Pass(this, "Right Branch"));
         // ...
         this.startState = choice;
         this.endStates = choice.afterwards().getEndStates();
     }
 }
 public class MyStack extends Stack {
     public MyStack(Construct scope, String id) {
         super(scope, id);
         // Do 3 different variants of MyJob in parallel
         Parallel parallel = new Parallel(this, "All jobs").branch(new MyJob(this, "Quick", new MyJobProps().jobFlavor("quick")).prefixStates()).branch(new MyJob(this, "Medium", new MyJobProps().jobFlavor("medium")).prefixStates()).branch(new MyJob(this, "Slow", new MyJobProps().jobFlavor("slow")).prefixStates());
         StateMachine.Builder.create(this, "MyStateMachine")
                 .definition(parallel)
                 .build();
     }
 }
 - 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.IChainableIChainable.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstructIConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.INextableINextable.Jsii$Default, INextable.Jsii$Proxy
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedParallel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedParallel(software.amazon.jsii.JsiiObjectRef objRef) Parallel(software.constructs.Construct scope, String id, ParallelProps props) 
- 
Method SummaryModifier and TypeMethodDescriptionaddCatch(IChainable handler) Add a recovery handler for this state.addCatch(IChainable handler, CatchProps props) Add a recovery handler for this state.addRetry()Add retry configuration for this state.addRetry(RetryProps props) Add retry configuration for this state.voidbindToGraph(StateGraph graph) Overwrites State.bindToGraph.branch(@NotNull IChainable... branches) Define one or more branches to run in parallel.Continuable states of this Chainable.next(IChainable next) Continue normal execution with the given state.com.fasterxml.jackson.databind.node.ObjectNodeReturn the Amazon States Language object for this state.validate()Validate this state.Methods inherited from class software.amazon.awscdk.services.stepfunctions.StateaddBranch, addChoice, addIterator, addPrefix, filterNextables, findReachableEndStates, findReachableEndStates, findReachableStates, findReachableStates, getBranches, getComment, getDefaultChoice, getId, getInputPath, getIteration, getOutputPath, getParameters, getResultPath, getResultSelector, getStartState, getStateId, makeDefault, makeNext, prefixStates, renderBranches, renderChoices, renderInputOutput, renderIterator, renderNextEnd, renderResultSelector, renderRetryCatch, setDefaultChoice, setIteration, whenBoundToGraphMethods inherited from class software.amazon.awscdk.core.ConstructgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesizeMethods inherited from class software.constructs.ConstructtoStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Constructor Details- 
Parallelprotected Parallel(software.amazon.jsii.JsiiObjectRef objRef) 
- 
Parallelprotected Parallel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
Parallel@Stability(Stable) public Parallel(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ParallelProps props) - Parameters:
- scope- This parameter is required.
- id- This parameter is required.
- props-
 
- 
Parallel@Stability(Stable) public Parallel(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
- scope- This parameter is required.
- id- This parameter is required.
 
 
- 
- 
Method Details- 
addCatch@Stability(Stable) @NotNull public Parallel 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-
 
- 
addCatchAdd 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.
 
- 
addRetryAdd retry configuration for this state.This controls if and how the execution will be retried if a particular error occurs. - Parameters:
- props-
 
- 
addRetryAdd retry configuration for this state.This controls if and how the execution will be retried if a particular error occurs. 
- 
bindToGraphOverwrites State.bindToGraph. Adds branches to the Parallel state here so that any necessary prefixes are appended first.- Overrides:
- bindToGraphin class- State
- Parameters:
- graph- This parameter is required.
 
- 
branchDefine one or more branches to run in parallel.- Parameters:
- branches- This parameter is required.
 
- 
nextContinue normal execution with the given state.
- 
toStateJson@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()Return the Amazon States Language object for this state.- Specified by:
- toStateJsonin class- State
 
- 
validateValidate this state.
- 
getEndStatesContinuable states of this Chainable.- Specified by:
- getEndStatesin interface- IChainable
- Specified by:
- getEndStatesin class- State
 
 
-