Class: AWS::Flow::TimerDecisionStateMachine Private

Inherits:
DecisionStateMachineBase show all
Defined in:
lib/aws/decider/state_machines.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Attributes inherited from DecisionStateMachineBase

#id

Attributes included from DecisionStateMachineDFA

#start_state, #states, #symbols, #transitions

Instance Method Summary collapse

Methods inherited from DecisionStateMachineBase

#handle_started_event

Methods included from DecisionStateMachineDFA

#add_transition, #add_transitions, #get_start_state, #get_transitions, #init, #self_transitions, #uncovered_transitions

Constructor Details

#initialize(decision_id, attributes) ⇒ TimerDecisionStateMachine

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of TimerDecisionStateMachine.



214
215
216
217
# File 'lib/aws/decider/state_machines.rb', line 214

def initialize(decision_id, attributes)
  @attributes = attributes
  super(decision_id)
end

Instance Attribute Details

#cancelledObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



213
214
215
# File 'lib/aws/decider/state_machines.rb', line 213

def cancelled
  @cancelled
end

Instance Method Details

#create_cancel_timer_decisionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



231
232
233
234
235
236
237
238
# File 'lib/aws/decider/state_machines.rb', line 231

def create_cancel_timer_decision
  {
    :decision_type => "CancelTimer",
    :cancel_timer_decision_attributes => {
      :timer_id => @attributes[:timer_id].to_s,
    }
  }
end

#create_start_timer_decisionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



219
220
221
222
223
224
225
226
227
228
229
# File 'lib/aws/decider/state_machines.rb', line 219

def create_start_timer_decision
  {
    :decision_type => "StartTimer",
    :start_timer_decision_attributes =>
    {
      :timer_id => @attributes[:timer_id].to_s,
      # TODO find out what the "control" field is, and what it is for
      :start_to_fire_timeout => @attributes[:start_to_fire_timeout]
    }
  }
end

#done?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


249
250
251
# File 'lib/aws/decider/state_machines.rb', line 249

def done?
  @current_state == :completed || @cancelled
end

#get_decisionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



240
241
242
243
244
245
246
247
# File 'lib/aws/decider/state_machines.rb', line 240

def get_decision
  case @current_state
  when :created
    return create_start_timer_decision
  when :cancelled_after_initiated
    return create_cancel_timer_decision
  end
end