Class: Lutaml::Sysml::XmiFile
- Inherits:
-
Object
- Object
- Lutaml::Sysml::XmiFile
- Defined in:
- lib/lutaml/sysml/xmi_file.rb
Instance Attribute Summary collapse
-
#abstraction_list ⇒ Object
Returns the value of attribute abstraction_list.
-
#activity_list ⇒ Object
Returns the value of attribute activity_list.
-
#allocate_requirement_list ⇒ Object
Returns the value of attribute allocate_requirement_list.
-
#association_list ⇒ Object
Returns the value of attribute association_list.
-
#binding_connector_list ⇒ Object
Returns the value of attribute binding_connector_list.
-
#block_list ⇒ Object
Returns the value of attribute block_list.
-
#class_list ⇒ Object
Returns the value of attribute class_list.
-
#connector_list ⇒ Object
Returns the value of attribute connector_list.
-
#connectorend_list ⇒ Object
Returns the value of attribute connectorend_list.
-
#constraint_list ⇒ Object
Returns the value of attribute constraint_list.
-
#constraintblock_list ⇒ Object
Returns the value of attribute constraintblock_list.
-
#copy_requirement_list ⇒ Object
Returns the value of attribute copy_requirement_list.
-
#datatype_list ⇒ Object
Returns the value of attribute datatype_list.
-
#derive_requirement_list ⇒ Object
Returns the value of attribute derive_requirement_list.
-
#element_hash ⇒ Object
Returns the value of attribute element_hash.
-
#instance_list ⇒ Object
Returns the value of attribute instance_list.
-
#model_list ⇒ Object
Returns the value of attribute model_list.
-
#nested_connectorend_list ⇒ Object
Returns the value of attribute nested_connectorend_list.
-
#package_list ⇒ Object
Returns the value of attribute package_list.
-
#port_list ⇒ Object
Returns the value of attribute port_list.
-
#property_list ⇒ Object
Returns the value of attribute property_list.
-
#realization_list ⇒ Object
Returns the value of attribute realization_list.
-
#refine_requirement_list ⇒ Object
Returns the value of attribute refine_requirement_list.
-
#requirement_list ⇒ Object
Returns the value of attribute requirement_list.
-
#satisfy_requirement_list ⇒ Object
Returns the value of attribute satisfy_requirement_list.
-
#testcase_list ⇒ Object
Returns the value of attribute testcase_list.
-
#trace_requirement_list ⇒ Object
Returns the value of attribute trace_requirement_list.
-
#verify_requirement_list ⇒ Object
Returns the value of attribute verify_requirement_list.
Instance Method Summary collapse
-
#initialize ⇒ XmiFile
constructor
rubocop:disable Metrics/AbcSize,Metrics/MethodLength.
-
#parse(filename) ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity.
Constructor Details
#initialize ⇒ XmiFile
rubocop:disable Metrics/AbcSize,Metrics/MethodLength
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 20 def initialize # rubocop:disable Metrics/AbcSize,Metrics/MethodLength @package_list = [] @model_list = [] @class_list = [] @activity_list = [] @property_list = [] @port_list = [] @datatype_list = [] @instance_list = [] @realization_list = [] @abstraction_list = [] @association_list = [] @connector_list = [] @connectorend_list = [] @constraint_list = [] @block_list = [] @constraintblock_list = [] @requirement_list = [] @testcase_list = [] @binding_connector_list = [] @nested_connectorend_list = [] @derive_requirement_list = [] @refine_requirement_list = [] @trace_requirement_list = [] @copy_requirement_list = [] @verify_requirement_list = [] @satisfy_requirement_list = [] @allocate_requirement_list = [] @element_hash = Hash.new end |
Instance Attribute Details
#abstraction_list ⇒ Object
Returns the value of attribute abstraction_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def abstraction_list @abstraction_list end |
#activity_list ⇒ Object
Returns the value of attribute activity_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def activity_list @activity_list end |
#allocate_requirement_list ⇒ Object
Returns the value of attribute allocate_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def allocate_requirement_list @allocate_requirement_list end |
#association_list ⇒ Object
Returns the value of attribute association_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def association_list @association_list end |
#binding_connector_list ⇒ Object
Returns the value of attribute binding_connector_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def binding_connector_list @binding_connector_list end |
#block_list ⇒ Object
Returns the value of attribute block_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def block_list @block_list end |
#class_list ⇒ Object
Returns the value of attribute class_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def class_list @class_list end |
#connector_list ⇒ Object
Returns the value of attribute connector_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def connector_list @connector_list end |
#connectorend_list ⇒ Object
Returns the value of attribute connectorend_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def connectorend_list @connectorend_list end |
#constraint_list ⇒ Object
Returns the value of attribute constraint_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def constraint_list @constraint_list end |
#constraintblock_list ⇒ Object
Returns the value of attribute constraintblock_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def constraintblock_list @constraintblock_list end |
#copy_requirement_list ⇒ Object
Returns the value of attribute copy_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def copy_requirement_list @copy_requirement_list end |
#datatype_list ⇒ Object
Returns the value of attribute datatype_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def datatype_list @datatype_list end |
#derive_requirement_list ⇒ Object
Returns the value of attribute derive_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def derive_requirement_list @derive_requirement_list end |
#element_hash ⇒ Object
Returns the value of attribute element_hash.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def element_hash @element_hash end |
#instance_list ⇒ Object
Returns the value of attribute instance_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def instance_list @instance_list end |
#model_list ⇒ Object
Returns the value of attribute model_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def model_list @model_list end |
#nested_connectorend_list ⇒ Object
Returns the value of attribute nested_connectorend_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def nested_connectorend_list @nested_connectorend_list end |
#package_list ⇒ Object
Returns the value of attribute package_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def package_list @package_list end |
#port_list ⇒ Object
Returns the value of attribute port_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def port_list @port_list end |
#property_list ⇒ Object
Returns the value of attribute property_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def property_list @property_list end |
#realization_list ⇒ Object
Returns the value of attribute realization_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def realization_list @realization_list end |
#refine_requirement_list ⇒ Object
Returns the value of attribute refine_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def refine_requirement_list @refine_requirement_list end |
#requirement_list ⇒ Object
Returns the value of attribute requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def requirement_list @requirement_list end |
#satisfy_requirement_list ⇒ Object
Returns the value of attribute satisfy_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def satisfy_requirement_list @satisfy_requirement_list end |
#testcase_list ⇒ Object
Returns the value of attribute testcase_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def testcase_list @testcase_list end |
#trace_requirement_list ⇒ Object
Returns the value of attribute trace_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def trace_requirement_list @trace_requirement_list end |
#verify_requirement_list ⇒ Object
Returns the value of attribute verify_requirement_list.
6 7 8 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 6 def verify_requirement_list @verify_requirement_list end |
Instance Method Details
#parse(filename) ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/lutaml/sysml/xmi_file.rb', line 52 def parse(filename) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity xmifile = File.new(filename, "r") inxml = Nokogiri::XML(xmifile) xmi_elements = inxml.xpath("//xmi:XMI") if xmi_elements.empty? puts "ERROR : File contains no 'xmi:XMI' XML elements : " \ "#{filename}, may not be XMI file." xmifile.close exit end # setup xmi namespace xmi_ns = inxml.root.namespace_definitions.find do |ns| ns.prefix == "xmi" end ## Step 1: Find UML and SysML Core Objects in XMI file and create as # instance of metamodel inxml.xpath("//*").each do |xml_node| # rubocop:disable Metrics/BlockLength element_new = nil if xml_node.name.to_s == "packagedElement" && xml_node.attribute_with_ns("type", xmi_ns.href) .to_s == "uml:Package" element_new = Lutaml::Uml::Package.new package_list.push element_new end if xml_node.name.to_s == "Model" element_new = Lutaml::Uml::Model.new model_list.push element_new element_new.viewpoint = xml_node["viewpoint"] element_new.href = xml_node["href"] end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Class" element_new = Lutaml::Uml::Class.new if !xml_node["isAbstract"].nil? element_new.is_abstract = xml_node["isAbstract"] == "true" end class_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Activity" element_new = Lutaml::Uml::Activity.new activity_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Property" element_new = Lutaml::Uml::Property.new property_list.push element_new end if xml_node .attribute_with_ns("type", xmi_ns.href) .to_s == "uml:InstanceSpecification" element_new = Lutaml::Uml::Instance.new instance_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:DataType" element_new = Lutaml::Uml::DataType.new datatype_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Port" element_new = Lutaml::Uml::Port.new port_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Connector" element_new = Lutaml::Uml::Connector.new connector_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:ConnectorEnd" element_new = Lutaml::Uml::ConnectorEnd.new connectorend_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Constraint" element_new = Lutaml::Uml::Constraint.new constraint_list.push element_new end if xml_node.name.to_s == "Block" element_new = SYSML::Block.new block_list.push element_new end if xml_node.name.to_s == "Template" element_new = SYSML::Block.new block_list.push element_new end if xml_node.name.to_s == "ConstraintBlock" element_new = SYSML::ConstraintBlock.new constraintblock_list.push element_new end if ( xml_node.name.to_s.index("Requirement") || xml_node.name.to_s == "designConstraint" ) && xml_node.name.to_s != "RequirementRelated" element_new = SYSML::Requirement.new requirement_list.push element_new element_new.id = xml_node.attribute_with_ns("id", xmi_ns.href).to_s.strip element_new.text = xml_node["Text"] if xml_node.name != "Requirement" element_new.stereotype.push xml_node.name end end if xml_node.name.to_s == "TestCase" element_new = SYSML::TestCase.new testcase_list.push element_new end if xml_node.name.to_s == "BindingConnector" element_new = SYSML::BindingConnector.new binding_connector_list.push element_new end if xml_node.name.to_s == "NestedConnectorEnd" element_new = SYSML::NestedConnectorEnd.new nested_connectorend_list.push element_new end if xml_node.name.to_s == "DeriveReqt" element_new = SYSML::DeriveRequirement.new derive_requirement_list.push element_new end if xml_node.name.to_s == "refine" element_new = SYSML::Refine.new refine_requirement_list.push element_new end if xml_node.name.to_s == "trace" element_new = SYSML::Trace.new trace_requirement_list.push element_new end if xml_node.name.to_s == "Copy" element_new = SYSML::Copy.new copy_requirement_list.push element_new end if xml_node.name.to_s == "Verify" element_new = SYSML::Verify.new verify_requirement_list.push element_new end if xml_node.name.to_s == "Allocate" element_new = SYSML::Allocate.new allocate_requirement_list.push element_new end if xml_node.name.to_s == "Satisfy" element_new = SYSML::Satisfy.new satisfy_requirement_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Abstraction" element_new = Lutaml::Uml::Abstraction.new abstraction_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Realization" element_new = Lutaml::Uml::Realization.new realization_list.push element_new end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Association" element_new = Lutaml::Uml::Association.new association_list.push element_new end if !element_new.nil? new_xmi_id_node = xml_node.attribute_with_ns("id", xmi_ns.href) new_xmi_uuid_node = xml_node.attribute_with_ns("uuid", xmi_ns.href) new_name_node = xml_node["name"] new_href_node = xml_node["href"] if !new_xmi_id_node.nil? element_new.xmi_id = new_xmi_id_node.to_s element_hash[element_new.xmi_id] = element_new end if !new_xmi_uuid_node.nil? element_new.xmi_uuid = new_xmi_uuid_node.to_s end if !new_name_node.nil? element_new.name = xml_node["name"].strip end if !new_href_node.nil? element_new.href = new_href_node.to_s if new_xmi_id_node == nil element_hash[element_new.href] = element_new end if !xml_node.at("xmi:Extension/referenceExtension").nil? element_new.name = xml_node .at("xmi:Extension/referenceExtension")["referentPath"] end end if !xml_node.parent.nil? && !xml_node.parent.attribute_with_ns("id", xmi_ns.href).nil? && !element_hash[xml_node .parent.attribute_with_ns("id", xmi_ns.href).to_s].nil? parent = element_hash[xml_node .parent.attribute_with_ns("id", xmi_ns.href).to_s] element_new.namespace = parent if parent.is_a? Lutaml::Uml::Package parent.contents.push element_new end end end end inxml.xpath("//*").each do |xml_node| # rubocop:disable Metrics/BlockLength,Style/CombinableLoops if !xml_node.attribute_with_ns("id", xmi_ns.href).nil? && !element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s].nil? this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] end if xml_node.name.to_s == "nestedClassifier" && xml_node.attribute_with_ns( "type", xmi_ns.href ).to_s == "uml:Class" owning_class_xmi_id = xml_node .parent.attribute_with_ns("id", xmi_ns.href).to_s owned_class_xmi_id = xml_node .attribute_with_ns("id", xmi_ns.href).to_s owning_class = element_hash[owning_class_xmi_id] owned_class = element_hash[owned_class_xmi_id] owning_class.nested_classifier.push owned_class end if xml_node.attribute_with_ns("type", xmi_ns.href) .to_s == "uml:Realization" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] supplier_xmi_id = xml_node.at("supplier")["idref"] client_xmi_id = xml_node.at("client")["idref"] this_thing.supplier.push element_hash[supplier_xmi_id] this_thing.client.push element_hash[client_xmi_id] end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Abstraction" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] supplier_xmi_id = xml_node.at("supplier")["idref"] client_xmi_id = xml_node.at("client")["idref"] this_thing.supplier.push element_hash[supplier_xmi_id] this_thing.client.push element_hash[client_xmi_id] end if xml_node.name.to_s == "Block" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_class_xmi_id = xml_node["base_Class"] this_thing.base_class = element_hash[base_class_xmi_id] end if xml_node.name.to_s == "Template" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_class_xmi_id = xml_node["base_Class"] this_thing.base_class = element_hash[base_class_xmi_id] this_thing.base_class.stereotype.push "Template" end if xml_node.name.to_s == "ConstraintBlock" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_class_xmi_id = xml_node["base_Class"] this_thing.base_class = element_hash[base_class_xmi_id] end if ( xml_node.name.to_s.index("Requirement") || (xml_node.name.to_s == "designConstraint") ) && xml_node.name.to_s != "RequirementRelated" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_class_xmi_id = xml_node["base_Class"] this_thing.base_class = element_hash[base_class_xmi_id] this_thing.refined_by = element_hash[xml_node["RefinedBy"]] this_thing.derived_from = element_hash[xml_node["DerivedFrom"]] this_thing.traced_to = element_hash[xml_node["TracedTo"]] end if xml_node.name.to_s == "TestCase" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] this_thing.base_behavior = element_hash[xml_node["base_Behavior"]] this_thing.verifies = element_hash[xml_node["Verifies"]] end if xml_node.name.to_s == "BindingConnector" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_connector_xmi_id = xml_node["base_Connector"] this_thing.base_connector = element_hash[base_connector_xmi_id] end if xml_node.name.to_s == "NestedConnectorEnd" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_connectorend_xmi_id = xml_node["base_ConnectorEnd"] this_thing.base_connectorend = element_hash[base_connectorend_xmi_id] if xml_node["propertyPath"] == nil xml_node.xpath("./propertyPath").each do |prop_path| # to deal with href = '#xmi:id' i.e. local references href_parts = prop_path["href"].split("#") prop = if href_parts[0].empty? element_hash[href_parts[1]] else element_hash[prop_path["href"]] end this_thing.property_path.push prop end else this_thing.property_path .push element_hash[xml_node["propertyPath"]] end end if xml_node.name.to_s == "Satisfy" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_realization_xmi_id = xml_node["base_Realization"] this_thing.base_realization = element_hash[base_realization_xmi_id] end if ["DeriveReqt", "refine", "trace", "Copy", "Verify", "Allocate", # rubocop:disable Performance/CollectionLiteralInLoop ""].include? xml_node.name.to_s this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] base_abstraction_xmi_id = xml_node["base_Abstraction"] this_thing.base_abstraction = element_hash[base_abstraction_xmi_id] end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Association" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] member_end_list = xml_node.xpath("./memberEnd") member_end_list.each do |item| this_thing.member_end.push element_hash[item["idref"]] end owned_end_list = xml_node.xpath("./ownedEnd") owned_end_list.each do |item| this_thing.owned_end.push element_hash[item.attribute_with_ns( "id", xmi_ns.href ).to_s] end end if ["uml:Property", "uml:Port"].include?( # rubocop:disable Performance/CollectionLiteralInLoop xml_node.attribute_with_ns("type", xmi_ns.href).to_s, ) && !["definingFeature", "partWithPort", "propertyPath", "role"] # rubocop:disable Performance/CollectionLiteralInLoop .include?(xml_node.name.to_s) this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] if !xml_node["association"].nil? this_thing.association = element_hash[xml_node["association"]] end if !xml_node["aggregation"].nil? this_thing.aggregation = xml_node["aggregation"] end if !xml_node["visibility"].nil? this_thing.visibility = xml_node["visibility"] end if !xml_node.at("lowerValue").nil? this_thing.lowerValue = if xml_node.at("lowerValue")["value"].nil? "0" else xml_node.at("lowerValue")["value"] end end if !xml_node.at("upperValue").nil? this_thing.upperValue = xml_node.at("upperValue")["value"] end end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:Connector" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] connector_end_list = xml_node.xpath("./end") connector_end_list.each do |end_xml_node| this_thing.connector_end .push element_hash[end_xml_node.attribute_with_ns( "id", xmi_ns.href ).to_s] end end if xml_node.attribute_with_ns("type", xmi_ns.href).to_s == "uml:ConnectorEnd" this_thing = element_hash[xml_node .attribute_with_ns("id", xmi_ns.href).to_s] this_thing.connector = element_hash[xml_node.parent .attribute_with_ns("id", xmi_ns.href).to_s] this_thing.role = element_hash[xml_node["role"]] if this_thing.role == nil this_thing.role = element_hash[xml_node.at("role")["href"]] end this_thing.part_with_port = element_hash[xml_node["part_with_port"]] end end end |