Class: AWSCDK::StepFunctions::Chain

Inherits:
Jsii::Object
  • Object
show all
Includes:
IChainable
Defined in:
step_functions/chain.rb

Overview

A collection of states to chain onto.

A Chain has a start and zero or more chainable ends. If there are zero ends, calling next() on the Chain will fail.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Chain

Returns a new instance of Chain.

Raises:

  • (NoMethodError)


12
13
14
# File 'step_functions/chain.rb', line 12

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_stepfunctions.Chain does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.custom(start_state, end_states, last_added) ⇒ AWSCDK::StepFunctions::Chain

Make a Chain with specific start and end states, and a last-added Chainable.

Parameters:

Returns:

  • (AWSCDK::StepFunctions::Chain)


32
33
34
35
36
37
# File 'step_functions/chain.rb', line 32

def self.custom(start_state, end_states, last_added)
  Jsii::Type.check_type(start_state, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5TdGF0ZSJ9")), "startState")
  Jsii::Type.check_type(end_states, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zdGVwZnVuY3Rpb25zLklOZXh0YWJsZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "endStates")
  Jsii::Type.check_type(last_added, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5JQ2hhaW5hYmxlIn0=")), "lastAdded")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.Chain", "custom", [start_state, end_states, last_added])
end

.jsii_overridable_methodsObject



16
17
18
19
20
21
22
23
24
# File 'step_functions/chain.rb', line 16

def self.jsii_overridable_methods
  {
    :end_states => { kind: :property, name: "endStates", is_optional: false },
    :id => { kind: :property, name: "id", is_optional: false },
    :start_state => { kind: :property, name: "startState", is_optional: false },
    :_next => { kind: :method, name: "next", is_optional: false },
    :to_single_state => { kind: :method, name: "toSingleState", is_optional: false },
  }
end

.sequence(start, _next) ⇒ AWSCDK::StepFunctions::Chain

Make a Chain with the start from one chain and the ends from another.

Parameters:

Returns:

  • (AWSCDK::StepFunctions::Chain)


44
45
46
47
48
# File 'step_functions/chain.rb', line 44

def self.sequence(start, _next)
  Jsii::Type.check_type(start, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5JQ2hhaW5hYmxlIn0=")), "start")
  Jsii::Type.check_type(_next, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5JQ2hhaW5hYmxlIn0=")), "next")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.Chain", "sequence", [start, _next])
end

.start(state) ⇒ AWSCDK::StepFunctions::Chain

Begin a new Chain from one chainable.

Parameters:

Returns:

  • (AWSCDK::StepFunctions::Chain)


54
55
56
57
# File 'step_functions/chain.rb', line 54

def self.start(state)
  Jsii::Type.check_type(state, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5JQ2hhaW5hYmxlIn0=")), "state")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.Chain", "start", [state])
end

Instance Method Details

#_next(_next) ⇒ AWSCDK::StepFunctions::Chain

Continue normal execution with the given state.

Parameters:

Returns:

  • (AWSCDK::StepFunctions::Chain)


84
85
86
87
# File 'step_functions/chain.rb', line 84

def _next(_next)
  Jsii::Type.check_type(_next, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5JQ2hhaW5hYmxlIn0=")), "next")
  jsii_call_method("next", [_next])
end

#end_statesArray<AWSCDK::StepFunctions::INextable>

The chainable end state(s) of this chain.



62
63
64
# File 'step_functions/chain.rb', line 62

def end_states()
  jsii_get_property("endStates")
end

#idString

Identify this Chain.

Returns:

  • (String)


69
70
71
# File 'step_functions/chain.rb', line 69

def id()
  jsii_get_property("id")
end

#start_stateAWSCDK::StepFunctions::State

The start state of this chain.



76
77
78
# File 'step_functions/chain.rb', line 76

def start_state()
  jsii_get_property("startState")
end

#to_single_state(id, props = nil) ⇒ AWSCDK::StepFunctions::Parallel

Return a single state that encompasses all states in the chain.

This can be used to add error handling to a sequence of states.

Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.

Parameters:

Returns:



101
102
103
104
105
106
# File 'step_functions/chain.rb', line 101

def to_single_state(id, props = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::StepFunctions::ParallelProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5QYXJhbGxlbFByb3BzIn0=")), "props") unless props.nil?
  jsii_call_method("toSingleState", [id, props])
end