Class: Camunda::BpmnXML
- Inherits:
-
Object
- Object
- Camunda::BpmnXML
- Defined in:
- lib/camunda/bpmn_xml.rb
Defined Under Namespace
Classes: Task
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
- #class_names_with_same_bpmn_id_as_topic ⇒ Object
- #external_tasks ⇒ Object
-
#initialize(io_or_string) ⇒ BpmnXML
constructor
A new instance of BpmnXML.
- #modularized_class_names ⇒ Object
- #module_name ⇒ Object
- #to_s ⇒ Object
- #topics ⇒ Object
Constructor Details
#initialize(io_or_string) ⇒ BpmnXML
Returns a new instance of BpmnXML.
3 4 5 |
# File 'lib/camunda/bpmn_xml.rb', line 3 def initialize(io_or_string) @doc = Nokogiri::XML(io_or_string) end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
2 3 4 |
# File 'lib/camunda/bpmn_xml.rb', line 2 def doc @doc end |
Instance Method Details
#class_names_with_same_bpmn_id_as_topic ⇒ Object
21 22 23 |
# File 'lib/camunda/bpmn_xml.rb', line 21 def class_names_with_same_bpmn_id_as_topic tasks_with_same_bpmn_id_as_topic.map(&:class_name) end |
#external_tasks ⇒ Object
15 16 17 18 19 |
# File 'lib/camunda/bpmn_xml.rb', line 15 def external_tasks @doc.xpath('//*[@camunda:type="external"]').map do |task| Task.new(task) end end |
#modularized_class_names ⇒ Object
25 26 27 |
# File 'lib/camunda/bpmn_xml.rb', line 25 def modularized_class_names class_names_with_same_bpmn_id_as_topic.map { |name| "#{module_name}::#{name}" } end |
#module_name ⇒ Object
11 12 13 |
# File 'lib/camunda/bpmn_xml.rb', line 11 def module_name @doc.xpath('/bpmn:definitions/bpmn:process').first['id'] end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/camunda/bpmn_xml.rb', line 7 def to_s module_name end |
#topics ⇒ Object
29 30 31 |
# File 'lib/camunda/bpmn_xml.rb', line 29 def topics @doc.xpath('//*[@camunda:topic]').map { |node| node.attribute('topic').value }.uniq end |