Class: ProcessEngine::ProcessInstance

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/process_engine/process_instance.rb

Instance Method Summary collapse

Instance Method Details

#last_process_task_by_state_name(state_name) ⇒ Object



25
26
27
# File 'app/models/process_engine/process_instance.rb', line 25

def last_process_task_by_state_name(state_name)
  process_tasks_by_state_name(state_name).first
end

#move_to_next_state(pdn_slug_state, options = {}) ⇒ Object



11
12
13
# File 'app/models/process_engine/process_instance.rb', line 11

def move_to_next_state(pdn_slug_state, options = {})
  move_to_next_cur_state(pdn_slug_state, [], options)
end

#process_tasks_by_state_name(state_name) ⇒ Object



21
22
23
# File 'app/models/process_engine/process_instance.rb', line 21

def process_tasks_by_state_name(state_name)
  process_tasks.by_state(state_name).desc
end

#startObject



15
16
17
18
19
# File 'app/models/process_engine/process_instance.rb', line 15

def start
  update_attributes!(states: [process_definition.starting_node])
  begin_process_instance
  self
end