Method: SpotFlow::Bpmn::Process#initialize

Defined in:
lib/spot_flow/bpmn/process.rb

#initialize(attributes = {}) ⇒ Process

Returns a new instance of Process.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/spot_flow/bpmn/process.rb', line 17

def initialize(attributes = {})
  super(attributes.slice(:id, :name, :extension_elements, :incoming, :outgoing, :default))

  @is_executable = attributes[:is_executable] == ("true" || true)

  @start_events = Array.wrap(attributes[:start_event]).map { |se| StartEvent.new(se) }
  @end_events = Array.wrap(attributes[:end_event]).map { |ee| EndEvent.new(ee) }
  @intermediate_catch_events = Array.wrap(attributes[:intermediate_catch_event]).map { |ice| IntermediateCatchEvent.new(ice) }
  @intermediate_throw_events = Array.wrap(attributes[:intermediate_throw_event]).map { |ite| IntermediateThrowEvent.new(ite) }
  @boundary_events = Array.wrap(attributes[:boundary_event]).map { |be| BoundaryEvent.new(be) }
  @tasks = Array.wrap(attributes[:task]).map { |t| Task.new(t) }
  @user_tasks = Array.wrap(attributes[:user_task]).map { |ut| UserTask.new(ut) }
  @service_tasks = Array.wrap(attributes[:service_task]).map { |st| ServiceTask.new(st) }
  @script_tasks = Array.wrap(attributes[:script_task]).map { |st| ScriptTask.new(st) }
  @business_rule_tasks = Array.wrap(attributes[:business_rule_task]).map { |brt| BusinessRuleTask.new(brt) }
  @call_activities = Array.wrap(attributes[:call_activity]).map { |ca| CallActivity.new(ca) }
  @sub_processes = Array.wrap(attributes[:sub_process]).map { |sp| SubProcess.new(sp) }
  @ad_hoc_sub_processes = Array.wrap(attributes[:ad_hoc_sub_processe]).map { |ahsp| AdHocSubProcess.new(ahsp) }
  @exclusive_gateways = Array.wrap(attributes[:exclusive_gateway]).map { |eg| ExclusiveGateway.new(eg) }
  @parallel_gateways = Array.wrap(attributes[:parallel_gateway]).map { |pg| ParallelGateway.new(pg) }
  @inclusive_gateways = Array.wrap(attributes[:inclusive_gateway]).map { |ig| InclusiveGateway.new(ig) }
  @event_based_gateways = Array.wrap(attributes[:event_based_gateway]).map { |ebg| EventBasedGateway.new(ebg) }
  @sequence_flows = Array.wrap(attributes[:sequence_flow]).map { |sf| SequenceFlow.new(sf) }
end