Class: BPMN::ServiceTask

Inherits:
Task show all
Defined in:
lib/bpmn/task.rb

Direct Known Subclasses

BusinessRuleTask, ScriptTask

Instance Attribute Summary collapse

Attributes inherited from Activity

#attachments

Attributes inherited from Step

#default, #default_ref, #incoming, #outgoing

Attributes inherited from Element

#extension_elements, #id, #name

Instance Method Summary collapse

Methods inherited from Task

#result_to_variables, #signal

Methods inherited from Activity

#initialize

Methods inherited from Step

#converging?, #diverging?, #initialize, #input_mappings, #leave, #outgoing_flows, #output_mappings

Methods inherited from Element

#initialize, #inspect

Constructor Details

This class inherits a constructor from BPMN::Activity

Instance Attribute Details

#serviceObject

Returns the value of attribute service.



63
64
65
# File 'lib/bpmn/task.rb', line 63

def service
  @service
end

Instance Method Details

#execute(execution) ⇒ Object



73
74
75
# File 'lib/bpmn/task.rb', line 73

def execute(execution)
  execution.wait
end

#headersObject



85
86
87
# File 'lib/bpmn/task.rb', line 85

def headers
  extension_elements&.task_headers&.headers
end

#is_automated?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/bpmn/task.rb', line 65

def is_automated?
  true
end

#is_manual?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/bpmn/task.rb', line 69

def is_manual?
  false
end

#run(execution) ⇒ Object



89
90
91
92
93
94
# File 'lib/bpmn/task.rb', line 89

def run(execution)
  if defined?(task_type)
    klass = task_type.constantize
    klass.new.call(execution.parent.variables, headers || {})
  end
end

#task_retriesObject



81
82
83
# File 'lib/bpmn/task.rb', line 81

def task_retries
  extension_elements&.task_definition&.retries
end

#task_typeObject



77
78
79
# File 'lib/bpmn/task.rb', line 77

def task_type
  extension_elements&.task_definition&.type
end