Class: AWS::Flow::WorkflowFactory

Inherits:
Object
  • Object
show all
Defined in:
aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb

Overview

Represents a workflow factory. Instances of WorkflowFactory are generated by #workflow_factory.

Instance Method Summary (collapse)

Constructor Details

- (WorkflowFactory) initialize(service, domain, block)

Creates a new WorkflowFactory with the provided parameters. The construction parameters will be used for any workflow clients generated by this workflow factory.

Parameters:

  • service

    The service to use for workflow clients generated by this workflow factory

  • domain

    The Amazon SWF Domain to use for workflow clients generated by this workflow factory.

  • block

    A block of StartWorkflowOptions to use for clients generated by this workflow factory.



422
423
424
425
426
427
428
429
430
431
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 422

def initialize(service, domain, block)
  @service = service
  @domain = domain
  @options = Utilities::interpret_block_for_options(StartWorkflowOptions, block)
  @workflow_class = get_const(@options.workflow_name) rescue nil
  if @workflow_class
    workflow_type = @workflow_class.workflows.delete_if {|wf_type| wf_type.version.nil? }.first
    @options.version = workflow_type.version
  end
end

Instance Method Details

- (WorkflowClient) get_client

Get a AWS::Flow::WorkflowClient with the parameters used in the construction of this AWS::Flow::WorkflowFactory.

Returns:



439
440
441
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 439

def get_client
  WorkflowClient.new(@service, @domain, @workflow_class, @options)
end