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.



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

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.



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

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.



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

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.



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

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)


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

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.



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

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