class AWS::Flow::ActivityOptions

Options to use on an activity or decider. The following options are defined:

@!attribute default_task_heartbeat_timeout

The optional default maximum time, specified when registering the
activity type, before which a worker processing a task must report
progress by calling
{http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/ActivityTask.html#record_heartbeat!-instance_method
record_heartbeat} on the `ActivityTask`.

You can override this default when scheduling a task through the
`ScheduleActivityTask` decision. If the activity worker subsequently
attempts to record a heartbeat or returns a result, the activity worker
receives an UnknownResource fault. In this case, Amazon SWF no longer
considers the activity task to be valid; the activity worker should
clean up the activity task.

The valid values are integers greater than or equal to zero. An integer
value can be used to specify the duration in seconds while "NONE" can be
used to specify unlimited duration.

@!attribute default_task_list

The optional default task list specified for this activity type at
registration. This default task list is used if a task list is not
provided when a task is scheduled through the `ScheduleActivityTask`
decision. You can override this default when scheduling a task through
the `ScheduleActivityTask` decision.

@!attribute default_task_priority

The optional default task priority specified for this activity type at
registration. This default task priority is used if a task priority is not
provided when a task is scheduled through the `ScheduleActivityTask`
decision. You can override this default when scheduling a task through
the `ScheduleActivityTask` decision.

@!attribute default_task_schedule_to_close_timeout

The optional default maximum duration, specified when registering the
activity type, for tasks of this activity type. You can override this
default when scheduling a task through the `ScheduleActivityTask`
decision.

The valid values are integers greater than or equal to zero, or the
string "NONE". An integer value can be used to specify the duration in
seconds while "NONE" is be used to specify *unlimited* duration.

@!attribute default_task_schedule_to_start_timeout

The optional default maximum duration, specified when registering the
activity type, that a task of an activity type can wait before being
assigned to a worker. You can override this default when scheduling a
task through the `ScheduleActivityTask` decision.

@!attribute default_task_start_to_close_timeout

The optional default maximum duration for tasks of an activity type
specified when registering the activity type. You can override this
default when scheduling a task through the `ScheduleActivityTask`
decision.

Public Class Methods

new(default_options={}, use_defaults=false) click to toggle source

Creates a new set of ‘ActivityOptions`.

@param [Hash] default_options

A set of `ActivityOptions` to use as the default values.

@option default_options [Integer] :heartbeat_timeout

The optional default maximum time, specified when registering the
activity type, before which a worker processing a task must report
progress by calling `RecordActivityTaskHeartbeat`.

You can override this default when scheduling a task through the
`ScheduleActivityTask` decision. If the activity worker subsequently
attempts to record a heartbeat or returns a result, the activity
worker receives an UnknownResource fault. In this case, Amazon SWF no
longer considers the activity task to be valid; the activity worker
should clean up the activity task.

@option default_options [Integer] :schedule_to_close_timeout

The optional default maximum duration, specified when registering the
activity type, for tasks of this activity type.

You can override this default when scheduling a task through the
`ScheduleActivityTask` decision.

@option default_options [Integer] :schedule_to_start_timeout

The optional default maximum duration, specified when registering the
activity type, that a task of an activity type can wait before being
assigned to a worker.

You can override this default when scheduling a task through the
`ScheduleActivityTask` decision.

@option default_options [Integer] :start_to_close_timeout

The optional default maximum duration for tasks of an activity type
specified when registering the activity type.

You can override this default when scheduling a task through the
`ScheduleActivityTask` decision.

@option default_options [Array] :task_list

The optional default task list specified for this activity type at
registration. This default task list is used if a task list is not
provided when a task is scheduled through the ScheduleActivityTask
decision.

@option default_options [Array] :task_priority

The optional default task priority specified for this activity type at
registration. This default task priority is used if a task priority is not
provided when a task is scheduled through the ScheduleActivityTask
decision.

You can override this default when scheduling a task through the
`ScheduleActivityTask` decision.

@option default_options [String] :version

The version of this activity. If you change any other options on the
activity, you must also change the version.

@param [true, false] use_defaults

Set to `true` to use the pre-defined {ActivityDefaults}.
Calls superclass method AWS::Flow::Options::new
# File lib/aws/decider/options.rb, line 772
def initialize(default_options={}, use_defaults=false)
  if default_options.keys.include? :exponential_retry
    @_exponential_retry = ExponentialRetryOptions.new(default_options[:exponential_retry])
  end
  super(default_options, use_defaults)
end

Public Instance Methods

activity_name() click to toggle source

Gets the activity prefix name.

@return [String]

The activity name.
# File lib/aws/decider/options.rb, line 698
def activity_name
  @prefix_name
end
activity_name=(value) click to toggle source

Sets the activity prefix name.

@param [String] value

The activity name to set.
# File lib/aws/decider/options.rb, line 707
def activity_name=(value)
  @prefix_name = value
end
exponential_retry(&block) click to toggle source

Retries the supplied block with exponential retry logic.

@param [Hash] block

A hash of {ExponentialRetryOptions}.
# File lib/aws/decider/options.rb, line 786
def exponential_retry(&block)
  retry_options = Utilities::interpret_block_for_options(ExponentialRetryOptions, block)
  @_exponential_retry = retry_options
end
get_full_options() click to toggle source

Return the full set of options for the Activity.

# File lib/aws/decider/options.rb, line 792
def get_full_options
  result = {}
  usable_properties = self.class.held_properties
  usable_properties.delete(:from_class)
  usable_properties.each do |option|
    result[option] = self.send(option) if self.send(option) != nil && self.send(option) != ""
  end
  result
end