Class: BPMN::ErrorEventDefinition

Inherits:
EventDefinition show all
Defined in:
lib/bpmn/event_definition.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#extension_elements, #id, #name

Instance Method Summary collapse

Methods inherited from Element

#inspect

Constructor Details

#initialize(attributes = {}) ⇒ ErrorEventDefinition

Returns a new instance of ErrorEventDefinition.



51
52
53
54
55
56
57
# File 'lib/bpmn/event_definition.rb', line 51

def initialize(attributes = {})
  super(attributes.except(:error_ref, :error_code_variable, :error_message_variable))

  @error_ref = attributes[:error_ref]
  @error_code_variable = attributes[:error_code_variable]
  @error_message_variable = attributes[:error_message_variable]
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



48
49
50
# File 'lib/bpmn/event_definition.rb', line 48

def error
  @error
end

#error_code_variableObject

Returns the value of attribute error_code_variable.



49
50
51
# File 'lib/bpmn/event_definition.rb', line 49

def error_code_variable
  @error_code_variable
end

#error_message_variableObject

Returns the value of attribute error_message_variable.



49
50
51
# File 'lib/bpmn/event_definition.rb', line 49

def error_message_variable
  @error_message_variable
end

#error_refObject

Returns the value of attribute error_ref.



48
49
50
# File 'lib/bpmn/event_definition.rb', line 48

def error_ref
  @error_ref
end

Instance Method Details

#error_idObject



67
68
69
# File 'lib/bpmn/event_definition.rb', line 67

def error_id
  error&.id
end

#error_nameObject



71
72
73
# File 'lib/bpmn/event_definition.rb', line 71

def error_name
  error&.name
end

#execute(execution) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/bpmn/event_definition.rb', line 59

def execute(execution)
  if execution.step.is_throwing?
    execution.throw_error(error_name)
  else
    execution.error_names.push error_name
  end
end