UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 2.85 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parallel=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),state_type_1=require("./private/state-type"),state_1=require("./state"),chain_1=require("../chain"),state_graph_1=require("../state-graph");class Parallel extends state_1.State{constructor(scope,id,props={}){super(scope,id,props),this._branches=[];try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_ParallelProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Parallel),error}this.endStates=[this]}addRetry(props={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_RetryProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addRetry),error}return super._addRetry(props),this}addCatch(handler,props={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_IChainable(handler),jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_CatchProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addCatch),error}return super._addCatch(handler.startState,props),this}next(next){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}return super.makeNext(next.startState),chain_1.Chain.sequence(this,next)}branch(...branches){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_IChainable(branches)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.branch),error}return this._branches.push(...branches),this}bindToGraph(graph){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_StateGraph(graph)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindToGraph),error}for(const branch of this._branches){const name=`Parallel '${this.stateId}' branch ${this.branches.length+1}`;super.addBranch(new state_graph_1.StateGraph(branch.startState,name))}return this._branches.splice(0,this._branches.length),super.bindToGraph(graph)}toStateJson(){return{Type:state_type_1.StateType.PARALLEL,Comment:this.comment,ResultPath:state_1.renderJsonPath(this.resultPath),...this.renderNextEnd(),...this.renderInputOutput(),...this.renderRetryCatch(),...this.renderBranches(),...this.renderResultSelector()}}validateState(){return this.branches.length===0?["Parallel must have at least one branch"]:[]}}exports.Parallel=Parallel,_a=JSII_RTTI_SYMBOL_1,Parallel[_a]={fqn:"aws-cdk-lib.aws_stepfunctions.Parallel",version:"2.70.0"};