Class: Temporal::Workflow::CommandStateMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/temporal/workflow/command_state_machine.rb

Constant Summary collapse

NEW_STATE =
:new
REQUESTED_STATE =
:requested
SCHEDULED_STATE =
:scheduled
STARTED_STATE =
:started
COMPLETED_STATE =
:completed
CANCELED_STATE =
:canceled
FAILED_STATE =
:failed
TIMED_OUT_STATE =
:timed_out

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandStateMachine

Returns a new instance of CommandStateMachine.



15
16
17
# File 'lib/temporal/workflow/command_state_machine.rb', line 15

def initialize
  @state = NEW_STATE
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



13
14
15
# File 'lib/temporal/workflow/command_state_machine.rb', line 13

def state
  @state
end

Instance Method Details

#cancelObject



35
36
37
# File 'lib/temporal/workflow/command_state_machine.rb', line 35

def cancel
  @state = CANCELED_STATE
end

#completeObject



31
32
33
# File 'lib/temporal/workflow/command_state_machine.rb', line 31

def complete
  @state = COMPLETED_STATE
end

#failObject



39
40
41
# File 'lib/temporal/workflow/command_state_machine.rb', line 39

def fail
  @state = FAILED_STATE
end

#requestedObject



19
20
21
# File 'lib/temporal/workflow/command_state_machine.rb', line 19

def requested
  @state = REQUESTED_STATE
end

#scheduleObject



23
24
25
# File 'lib/temporal/workflow/command_state_machine.rb', line 23

def schedule
  @state = SCHEDULED_STATE
end

#startObject



27
28
29
# File 'lib/temporal/workflow/command_state_machine.rb', line 27

def start
  @state = STARTED_STATE
end

#time_outObject



43
44
45
# File 'lib/temporal/workflow/command_state_machine.rb', line 43

def time_out
  @state = TIMED_OUT_STATE
end