Module: Smith::Workflow::SplitStepPersistence::DispatchClaim

Included in:
Smith::Workflow::SplitStepPersistence
Defined in:
lib/smith/workflow/split_step_persistence/dispatch_claim.rb

Instance Method Summary collapse

Instance Method Details

#claim_prepared_step_dispatch!Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/smith/workflow/split_step_persistence/dispatch_claim.rb', line 7

def claim_prepared_step_dispatch!
  ensure_restart_safe_dispatch_claim!
  ensure_split_step_definition_current!
  transaction_identity = TransactionIdentity.capture(@split_step_adapter)
  claim_dispatch_intent!
  payload, descriptor = build_split_step_dispatch_claim
  dispatch_started = true
  replace_exact_dispatch!(payload)
  accept_split_step_dispatch!(payload, descriptor, transaction_identity)
  descriptor
rescue PersistencePayloadConflict
  reject_split_step_dispatch!
  raise
rescue StandardError
  if dispatch_started
    mark_split_step_dispatch_unknown!(payload, descriptor)
  else
    restore_unclaimed_dispatch!
  end
  raise
end