class AWS::Flow::ChildWorkflowDecisionStateMachine

@api private

Attributes

attributes[RW]
run_id[RW]

Public Class Methods

new(decision_id, attributes) click to toggle source
# File lib/aws/decider/state_machines.rb, line 312
def initialize(decision_id, attributes)
  @attributes = attributes
  super(decision_id)
end

Public Instance Methods

create_request_cancel_external_workflow_execution_decision() click to toggle source
# File lib/aws/decider/state_machines.rb, line 345
def create_request_cancel_external_workflow_execution_decision
  result = {
    :decision_type => "RequestCancelExternalWorkflowExecution",
    :request_cancel_external_workflow_execution_decision_attributes => {
      :workflow_id => @attributes[:workflow_id].to_s,
      :run_id => @run_id.to_s,
    }
  }
end
create_start_child_workflow_execution_decision() click to toggle source
# File lib/aws/decider/state_machines.rb, line 317
def create_start_child_workflow_execution_decision
  options = @attributes[:options]
  workflow_name = options.workflow_name || options.prefix_name
  attribute_name = :start_child_workflow_execution_decision_attributes
  result = {
    :decision_type => "StartChildWorkflowExecution",
     attribute_name =>
    {
      :workflow_type =>
      {
        :name => "#{workflow_name}.#{options.execution_method}",
        :version => options.version
      },
      :workflow_id => @attributes[:workflow_id].to_s,
      :task_list => {
        :name => options.task_list
      },
      # :control => @attributes[:control]
      :tag_list => @attributes[:tag_list]
    }
  }
  result[:start_child_workflow_execution_decision_attributes].delete(:task_list) if options.task_list.nil?
  #TODO Figure out what control is
  to_add = options.get_options([:execution_start_to_close_timeout, :task_start_to_close_timeout, :task_priority, :child_policy, :tag_list, :input])
  result[attribute_name].merge!(to_add)
  result
end
get_decision() click to toggle source
# File lib/aws/decider/state_machines.rb, line 355
def get_decision
  case @current_state
  when :created
    return create_start_child_workflow_execution_decision
  when :cancelled_after_started
    return create_request_cancel_external_workflow_execution_decision
  end
end