Module: Cadence::Activity::WorkflowConvenienceMethods

Included in:
Cadence::Activity
Defined in:
lib/cadence/activity/workflow_convenience_methods.rb

Instance Method Summary collapse

Instance Method Details

#execute(*input, **args) ⇒ Object



19
20
21
22
23
24
# File 'lib/cadence/activity/workflow_convenience_methods.rb', line 19

def execute(*input, **args)
  context = Cadence::ThreadLocalContext.get
  raise 'Called Activity#execute outside of a Workflow context' unless context

  context.execute_activity(self, *input, **args)
end

#execute!(*input, **args) ⇒ Object



26
27
28
29
30
31
# File 'lib/cadence/activity/workflow_convenience_methods.rb', line 26

def execute!(*input, **args)
  context = Cadence::ThreadLocalContext.get
  raise 'Called Activity#execute! outside of a Workflow context' unless context

  context.execute_activity!(self, *input, **args)
end

#execute_locally(*input, **args) ⇒ Object



33
34
35
36
37
38
# File 'lib/cadence/activity/workflow_convenience_methods.rb', line 33

def execute_locally(*input, **args)
  context = Cadence::ThreadLocalContext.get
  raise 'Called Activity#execute_locally outside of a Workflow context' unless context

  context.execute_local_activity(self, *input, **args)
end