Class: BPMN::MessageEventDefinition

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 = {}) ⇒ MessageEventDefinition

Returns a new instance of MessageEventDefinition.



56
57
58
59
60
# File 'lib/bpmn/event_definition.rb', line 56

def initialize(attributes = {})
  super(attributes.except(:message_ref))

  @message_ref = attributes[:message_ref]
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



54
55
56
# File 'lib/bpmn/event_definition.rb', line 54

def message
  @message
end

#message_refObject

Returns the value of attribute message_ref.



54
55
56
# File 'lib/bpmn/event_definition.rb', line 54

def message_ref
  @message_ref
end

Instance Method Details

#execute(execution) ⇒ Object



62
63
64
65
66
67
68
# File 'lib/bpmn/event_definition.rb', line 62

def execute(execution)
  if execution.step.is_throwing?
    execution.throw_message(message_name)
  else
    execution.message_names.push message_name
  end
end

#message_idObject



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

def message_id
  message&.id
end

#message_nameObject



74
75
76
# File 'lib/bpmn/event_definition.rb', line 74

def message_name
  message&.name
end