Class: SpotFlow::Bpmn::BoundaryEvent

Inherits:
Event show all
Defined in:
lib/spot_flow/bpmn/event.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#event_definitions

Attributes inherited from Step

#default, #default_ref, #incoming, #outgoing

Attributes inherited from Element

#extension_elements, #id, #name

Instance Method Summary collapse

Methods inherited from Event

#conditional_event_definition, #error_event_definition, #error_event_definitions, #escalation_event_definition, #event_definition_ids, #is_conditional?, #is_error?, #is_escalation?, #is_message?, #is_none?, #is_signal?, #is_terminate?, #is_throwing?, #is_timer?, #message_event_definitions, #signal_event_definitions, #terminate_event_definition, #timer_event_definition

Methods inherited from Step

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

Methods inherited from Element

#inspect

Constructor Details

#initialize(attributes = {}) ⇒ BoundaryEvent

Returns a new instance of BoundaryEvent.



158
159
160
161
162
163
164
165
166
# File 'lib/spot_flow/bpmn/event.rb', line 158

def initialize(attributes = {})
  super(attributes.except(:attached_to_ref, :cancel_activity))

  @attached_to_ref = attributes[:attached_to_ref]
  @cancel_activity = true
  if attributes[:cancel_activity].present?
    @cancel_activity = attributes[:cancel_activity] == "false" ? false : true
  end
end

Instance Attribute Details

#attached_toObject

Returns the value of attribute attached_to.



156
157
158
# File 'lib/spot_flow/bpmn/event.rb', line 156

def attached_to
  @attached_to
end

#attached_to_refObject

Returns the value of attribute attached_to_ref.



156
157
158
# File 'lib/spot_flow/bpmn/event.rb', line 156

def attached_to_ref
  @attached_to_ref
end

#cancel_activityObject

Returns the value of attribute cancel_activity.



156
157
158
# File 'lib/spot_flow/bpmn/event.rb', line 156

def cancel_activity
  @cancel_activity
end

Instance Method Details

#execute(execution) ⇒ Object



172
173
174
175
# File 'lib/spot_flow/bpmn/event.rb', line 172

def execute(execution)
  super
  execution.wait
end

#is_catching?Boolean

Returns:

  • (Boolean)


168
169
170
# File 'lib/spot_flow/bpmn/event.rb', line 168

def is_catching?
  true
end

#signal(execution) ⇒ Object



177
178
179
180
# File 'lib/spot_flow/bpmn/event.rb', line 177

def signal(execution)
  execution.attached_to.terminate if cancel_activity
  leave(execution)
end