Class: Wf::CaseCommand::StartCase

Inherits:
Object
  • Object
show all
Includes:
SimpleCommand
Defined in:
app/models/wf/case_command/start_case.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wf_case) ⇒ StartCase

Returns a new instance of StartCase.



7
8
9
# File 'app/models/wf/case_command/start_case.rb', line 7

def initialize(wf_case)
  @wf_case = wf_case
end

Instance Attribute Details

#wf_caseObject (readonly)

Returns the value of attribute wf_case.



6
7
8
# File 'app/models/wf/case_command/start_case.rb', line 6

def wf_case
  @wf_case
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
# File 'app/models/wf/case_command/start_case.rb', line 11

def call
  Wf::ApplicationRecord.transaction do
    wf_case.active!
    AddToken.call(wf_case, wf_case.workflow.places.start.first)
    SweepAutomaticTransitions.call(wf_case)
  end
end