archimate 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/archimate.gemspec +2 -1
  3. data/lib/archimate/color.rb +2 -2
  4. data/lib/archimate/data_model/any_attribute.rb +4 -10
  5. data/lib/archimate/data_model/any_element.rb +9 -17
  6. data/lib/archimate/data_model/bounds.rb +6 -6
  7. data/lib/archimate/data_model/color.rb +6 -6
  8. data/lib/archimate/data_model/comparison.rb +101 -5
  9. data/lib/archimate/data_model/concern.rb +5 -13
  10. data/lib/archimate/data_model/connection.rb +39 -48
  11. data/lib/archimate/data_model/connector_type.rb +1 -0
  12. data/lib/archimate/data_model/diagram.rb +27 -42
  13. data/lib/archimate/data_model/diagram_type.rb +1 -0
  14. data/lib/archimate/data_model/element.rb +14 -35
  15. data/lib/archimate/data_model/elements.rb +681 -0
  16. data/lib/archimate/data_model/font.rb +8 -8
  17. data/lib/archimate/data_model/lang_string.rb +10 -36
  18. data/lib/archimate/data_model/layer.rb +4 -5
  19. data/lib/archimate/data_model/layers.rb +45 -49
  20. data/lib/archimate/data_model/location.rb +6 -6
  21. data/lib/archimate/data_model/metadata.rb +2 -6
  22. data/lib/archimate/data_model/model.rb +50 -62
  23. data/lib/archimate/data_model/modeling_note.rb +3 -8
  24. data/lib/archimate/data_model/organization.rb +18 -27
  25. data/lib/archimate/data_model/property.rb +9 -8
  26. data/lib/archimate/data_model/property_definition.rb +15 -21
  27. data/lib/archimate/data_model/referenceable.rb +14 -9
  28. data/lib/archimate/data_model/referenceable_list.rb +82 -0
  29. data/lib/archimate/data_model/relationship.rb +41 -152
  30. data/lib/archimate/data_model/relationship_references.rb +29 -0
  31. data/lib/archimate/data_model/relationships.rb +214 -0
  32. data/lib/archimate/data_model/schema_info.rb +6 -12
  33. data/lib/archimate/data_model/style.rb +14 -25
  34. data/lib/archimate/data_model/view_node.rb +38 -66
  35. data/lib/archimate/data_model/viewpoint.rb +23 -38
  36. data/lib/archimate/data_model/viewpoint_type.rb +347 -387
  37. data/lib/archimate/data_model.rb +7 -6
  38. data/lib/archimate/derived_relations.rb +106 -31
  39. data/lib/archimate/export/cypher.rb +0 -18
  40. data/lib/archimate/export/jsonl.rb +16 -45
  41. data/lib/archimate/export/n_quads.rb +1 -24
  42. data/lib/archimate/file_formats/archi_file_reader.rb +2 -1
  43. data/lib/archimate/file_formats/model_exchange_file_writer_21.rb +9 -1
  44. data/lib/archimate/file_formats/sax/archi/archi_handler_factory.rb +2 -2
  45. data/lib/archimate/file_formats/sax/archi/connection.rb +2 -1
  46. data/lib/archimate/file_formats/sax/archi/element.rb +7 -5
  47. data/lib/archimate/file_formats/sax/archi/relationship.rb +1 -1
  48. data/lib/archimate/file_formats/sax/model_exchange_file/connection.rb +2 -1
  49. data/lib/archimate/file_formats/sax/model_exchange_file/element.rb +1 -1
  50. data/lib/archimate/file_formats/sax/model_exchange_file/relationship.rb +1 -1
  51. data/lib/archimate/file_formats/sax/model_exchange_file/view_node.rb +0 -1
  52. data/lib/archimate/file_formats/serializer/archi/relationship.rb +1 -1
  53. data/lib/archimate/lint/duplicate_entities.rb +46 -42
  54. data/lib/archimate/svg/archimate.css +12 -2
  55. data/lib/archimate/svg/entity/base_entity.rb +6 -29
  56. data/lib/archimate/svg/entity/location.rb +1 -0
  57. data/lib/archimate/svg/entity_factory.rb +3 -3
  58. data/lib/archimate/svg/point.rb +3 -3
  59. data/lib/archimate/svg/svg_template.svg.erb +5 -5
  60. data/lib/archimate/version.rb +2 -1
  61. metadata +20 -6
  62. data/TODOs.org +0 -505
  63. data/lib/archimate/data_model/differentiable.rb +0 -142
  64. data/lib/archimate/data_model/element_type.rb +0 -89
  65. data/lib/archimate/data_model/relationship_type.rb +0 -45
@@ -0,0 +1,681 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Archimate
4
+ module DataModel
5
+ module Elements
6
+ #############################################################
7
+ # Business Layer
8
+ #############################################################
9
+
10
+ class BusinessActor < Element
11
+ CLASSIFICATION = :active_structure
12
+ LAYER = Layers::Business
13
+
14
+ def initialize(args)
15
+ super
16
+ end
17
+ end
18
+
19
+ class BusinessCollaboration < Element
20
+ CLASSIFICATION = :active_structure
21
+ LAYER = Layers::Business
22
+
23
+ def initialize(args)
24
+ super
25
+ end
26
+ end
27
+
28
+ class BusinessEvent < Element
29
+ CLASSIFICATION = :behavioral
30
+ LAYER = Layers::Business
31
+
32
+ def initialize(args)
33
+ super
34
+ end
35
+ end
36
+
37
+ class BusinessFunction < Element
38
+ CLASSIFICATION = :behavioral
39
+ LAYER = Layers::Business
40
+
41
+ def initialize(args)
42
+ super
43
+ end
44
+ end
45
+
46
+ class BusinessInteraction < Element
47
+ CLASSIFICATION = :behavioral
48
+ LAYER = Layers::Business
49
+
50
+ def initialize(args)
51
+ super
52
+ end
53
+ end
54
+
55
+ class BusinessInterface < Element
56
+ CLASSIFICATION = :active_structure
57
+ LAYER = Layers::Business
58
+
59
+ def initialize(args)
60
+ super
61
+ end
62
+ end
63
+
64
+ class BusinessObject < Element
65
+ CLASSIFICATION = :passive_structure
66
+ LAYER = Layers::Business
67
+
68
+ def initialize(args)
69
+ super
70
+ end
71
+ end
72
+
73
+ class BusinessProcess < Element
74
+ CLASSIFICATION = :behavioral
75
+ LAYER = Layers::Business
76
+
77
+ def initialize(args)
78
+ super
79
+ end
80
+ end
81
+
82
+ class BusinessRole < Element
83
+ CLASSIFICATION = :active_structure
84
+ LAYER = Layers::Business
85
+
86
+ def initialize(args)
87
+ super
88
+ end
89
+ end
90
+
91
+ class BusinessService < Element
92
+ CLASSIFICATION = :behavioral
93
+ LAYER = Layers::Business
94
+
95
+ def initialize(args)
96
+ super
97
+ end
98
+ end
99
+
100
+ class Contract < Element
101
+ CLASSIFICATION = :passive_structure
102
+ LAYER = Layers::Business
103
+
104
+ def initialize(args)
105
+ super
106
+ end
107
+ end
108
+
109
+ class Location < Element
110
+ CLASSIFICATION = :active_structure
111
+ LAYER = Layers::Business
112
+
113
+ def initialize(args)
114
+ super
115
+ end
116
+ end
117
+
118
+ class Meaning < Element
119
+ CLASSIFICATION = :passive_structure
120
+ LAYER = Layers::Business
121
+
122
+ def initialize(args)
123
+ super
124
+ end
125
+ end
126
+
127
+ class Product < Element
128
+ CLASSIFICATION = :passive_structure
129
+ LAYER = Layers::Business
130
+
131
+ def initialize(args)
132
+ super
133
+ end
134
+ end
135
+
136
+ class Representation < Element
137
+ CLASSIFICATION = :passive_structure
138
+ LAYER = Layers::Business
139
+
140
+ def initialize(args)
141
+ super
142
+ end
143
+ end
144
+
145
+ class Value < Element
146
+ CLASSIFICATION = :passive_structure
147
+ LAYER = Layers::Business
148
+
149
+ def initialize(args)
150
+ super
151
+ end
152
+ end
153
+
154
+ #############################################################
155
+ # Application Layer
156
+ #############################################################
157
+
158
+ class ApplicationCollaboration < Element
159
+ CLASSIFICATION = :active_structure
160
+ LAYER = Layers::Application
161
+
162
+ def initialize(args)
163
+ super
164
+ end
165
+ end
166
+
167
+ class ApplicationComponent < Element
168
+ CLASSIFICATION = :active_structure
169
+ LAYER = Layers::Application
170
+
171
+ def initialize(args)
172
+ super
173
+ end
174
+ end
175
+
176
+ class ApplicationEvent < Element
177
+ CLASSIFICATION = :behavioral
178
+ LAYER = Layers::Application
179
+
180
+ def initialize(args)
181
+ super
182
+ end
183
+ end
184
+
185
+ class ApplicationFunction < Element
186
+ CLASSIFICATION = :behavioral
187
+ LAYER = Layers::Application
188
+
189
+ def initialize(args)
190
+ super
191
+ end
192
+ end
193
+
194
+ class ApplicationInteraction < Element
195
+ CLASSIFICATION = :behavioral
196
+ LAYER = Layers::Application
197
+
198
+ def initialize(args)
199
+ super
200
+ end
201
+ end
202
+
203
+ class ApplicationInterface < Element
204
+ CLASSIFICATION = :active_structure
205
+ LAYER = Layers::Application
206
+
207
+ def initialize(args)
208
+ super
209
+ end
210
+ end
211
+
212
+ class ApplicationProcess < Element
213
+ CLASSIFICATION = :behavioral
214
+ LAYER = Layers::Application
215
+
216
+ def initialize(args)
217
+ super
218
+ end
219
+ end
220
+
221
+ class ApplicationService < Element
222
+ CLASSIFICATION = :behavioral
223
+ LAYER = Layers::Application
224
+
225
+ def initialize(args)
226
+ super
227
+ end
228
+ end
229
+
230
+ class DataObject < Element
231
+ CLASSIFICATION = :passive_structure
232
+ LAYER = Layers::Application
233
+
234
+ def initialize(args)
235
+ super
236
+ end
237
+ end
238
+
239
+ #############################################################
240
+ # Technology Layer
241
+ #############################################################
242
+
243
+ class Artifact < Element
244
+ CLASSIFICATION = :passive_structure
245
+ LAYER = Layers::Technology
246
+
247
+ def initialize(args)
248
+ super
249
+ end
250
+ end
251
+
252
+ class CommunicationNetwork < Element
253
+ CLASSIFICATION = :active_structure
254
+ LAYER = Layers::Technology
255
+
256
+ def initialize(args)
257
+ super
258
+ end
259
+ end
260
+
261
+ class CommunicationPath < Element
262
+ CLASSIFICATION = :active_structure
263
+ LAYER = Layers::Technology
264
+
265
+ def initialize(args)
266
+ super
267
+ end
268
+ end
269
+
270
+ class Device < Element
271
+ CLASSIFICATION = :active_structure
272
+ LAYER = Layers::Technology
273
+
274
+ def initialize(args)
275
+ super
276
+ end
277
+ end
278
+
279
+ class InfrastructureFunction < Element
280
+ CLASSIFICATION = :active_structure
281
+ LAYER = Layers::Technology
282
+
283
+ def initialize(args)
284
+ super
285
+ end
286
+ end
287
+
288
+ class InfrastructureInterface < Element
289
+ CLASSIFICATION = :active_structure
290
+ LAYER = Layers::Technology
291
+
292
+ def initialize(args)
293
+ super
294
+ end
295
+ end
296
+
297
+ class InfrastructureService < Element
298
+ CLASSIFICATION = :active_structure
299
+ LAYER = Layers::Technology
300
+
301
+ def initialize(args)
302
+ super
303
+ end
304
+ end
305
+
306
+ class Network < Element
307
+ CLASSIFICATION = :active_structure
308
+ LAYER = Layers::Technology
309
+
310
+ def initialize(args)
311
+ super
312
+ end
313
+ end
314
+
315
+ class Node < Element
316
+ CLASSIFICATION = :active_structure
317
+ LAYER = Layers::Technology
318
+
319
+ def initialize(args)
320
+ super
321
+ end
322
+ end
323
+
324
+ class Path < Element
325
+ CLASSIFICATION = :active_structure
326
+ LAYER = Layers::Technology
327
+
328
+ def initialize(args)
329
+ super
330
+ end
331
+ end
332
+
333
+ class SystemSoftware < Element
334
+ CLASSIFICATION = :active_structure
335
+ LAYER = Layers::Technology
336
+
337
+ def initialize(args)
338
+ super
339
+ end
340
+ end
341
+
342
+ class TechnologyCollaboration < Element
343
+ CLASSIFICATION = :active_structure
344
+ LAYER = Layers::Technology
345
+
346
+ def initialize(args)
347
+ super
348
+ end
349
+ end
350
+
351
+ class TechnologyEvent < Element
352
+ CLASSIFICATION = :behavioral
353
+ LAYER = Layers::Technology
354
+
355
+ def initialize(args)
356
+ super
357
+ end
358
+ end
359
+
360
+ class TechnologyFunction < Element
361
+ CLASSIFICATION = :behavioral
362
+ LAYER = Layers::Technology
363
+
364
+ def initialize(args)
365
+ super
366
+ end
367
+ end
368
+
369
+ class TechnologyInteraction < Element
370
+ CLASSIFICATION = :behavioral
371
+ LAYER = Layers::Technology
372
+
373
+ def initialize(args)
374
+ super
375
+ end
376
+ end
377
+
378
+ class TechnologyInterface < Element
379
+ CLASSIFICATION = :active_structure
380
+ LAYER = Layers::Technology
381
+
382
+ def initialize(args)
383
+ super
384
+ end
385
+ end
386
+
387
+ class TechnologyObject < Element
388
+ CLASSIFICATION = :passive_structure
389
+ LAYER = Layers::Technology
390
+
391
+ def initialize(args)
392
+ super
393
+ end
394
+ end
395
+
396
+ class TechnologyProcess < Element
397
+ CLASSIFICATION = :behavioral
398
+ LAYER = Layers::Technology
399
+
400
+ def initialize(args)
401
+ super
402
+ end
403
+ end
404
+
405
+ class TechnologyService < Element
406
+ CLASSIFICATION = :behavioral
407
+ LAYER = Layers::Technology
408
+
409
+ def initialize(args)
410
+ super
411
+ end
412
+ end
413
+
414
+ #############################################################
415
+ # Physical Layer
416
+ #############################################################
417
+
418
+ class DistributionNetwork < Element
419
+ CLASSIFICATION = :active_structure
420
+ LAYER = Layers::Physical
421
+
422
+ def initialize(args)
423
+ super
424
+ end
425
+ end
426
+
427
+ class Equipment < Element
428
+ CLASSIFICATION = :active_structure
429
+ LAYER = Layers::Physical
430
+
431
+ def initialize(args)
432
+ super
433
+ end
434
+ end
435
+
436
+ class Facility < Element
437
+ CLASSIFICATION = :active_structure
438
+ LAYER = Layers::Physical
439
+
440
+ def initialize(args)
441
+ super
442
+ end
443
+ end
444
+
445
+ class Material < Element
446
+ CLASSIFICATION = :passive_structure
447
+ LAYER = Layers::Physical
448
+
449
+ def initialize(args)
450
+ super
451
+ end
452
+ end
453
+
454
+ #############################################################
455
+ # Motivation Layer
456
+ #############################################################
457
+
458
+ class Assessment < Element
459
+ CLASSIFICATION = :active_structure
460
+ LAYER = Layers::Motivation
461
+
462
+ def initialize(args)
463
+ super
464
+ end
465
+ end
466
+
467
+ class Constraint < Element
468
+ CLASSIFICATION = :active_structure
469
+ LAYER = Layers::Motivation
470
+
471
+ def initialize(args)
472
+ super
473
+ end
474
+ end
475
+
476
+ class Driver < Element
477
+ CLASSIFICATION = :active_structure
478
+ LAYER = Layers::Motivation
479
+
480
+ def initialize(args)
481
+ super
482
+ end
483
+ end
484
+
485
+ class Goal < Element
486
+ CLASSIFICATION = :active_structure
487
+ LAYER = Layers::Motivation
488
+
489
+ def initialize(args)
490
+ super
491
+ end
492
+ end
493
+
494
+ class Outcome < Element
495
+ CLASSIFICATION = :active_structure
496
+ LAYER = Layers::Motivation
497
+
498
+ def initialize(args)
499
+ super
500
+ end
501
+ end
502
+
503
+ class Principle < Element
504
+ CLASSIFICATION = :active_structure
505
+ LAYER = Layers::Motivation
506
+
507
+ def initialize(args)
508
+ super
509
+ end
510
+ end
511
+
512
+ class Requirement < Element
513
+ CLASSIFICATION = :active_structure
514
+ LAYER = Layers::Motivation
515
+
516
+ def initialize(args)
517
+ super
518
+ end
519
+ end
520
+
521
+ class Stakeholder < Element
522
+ CLASSIFICATION = :active_structure
523
+ LAYER = Layers::Motivation
524
+
525
+ def initialize(args)
526
+ super
527
+ end
528
+ end
529
+
530
+ #############################################################
531
+ # Implementation and Migration Layer
532
+ #############################################################
533
+
534
+ class Deliverable < Element
535
+ CLASSIFICATION = :passive_structure
536
+ LAYER = Layers::Implementation_and_migration
537
+
538
+ def initialize(args)
539
+ super
540
+ end
541
+ end
542
+
543
+ class Gap < Element
544
+ CLASSIFICATION = :passive_structure
545
+ LAYER = Layers::Implementation_and_migration
546
+
547
+ def initialize(args)
548
+ super
549
+ end
550
+ end
551
+
552
+ class ImplementationEvent < Element
553
+ CLASSIFICATION = :active_structure
554
+ LAYER = Layers::Implementation_and_migration
555
+
556
+ def initialize(args)
557
+ super
558
+ end
559
+ end
560
+
561
+ class Plateau < Element
562
+ CLASSIFICATION = :active_structure
563
+ LAYER = Layers::Implementation_and_migration
564
+
565
+ def initialize(args)
566
+ super
567
+ end
568
+ end
569
+
570
+ class WorkPackage < Element
571
+ CLASSIFICATION = :behavioral
572
+ LAYER = Layers::Implementation_and_migration
573
+
574
+ def initialize(args)
575
+ super
576
+ end
577
+ end
578
+
579
+ #############################################################
580
+ # Connectors Pseudo Layer
581
+ #############################################################
582
+
583
+ class AndJunction < Element
584
+ CLASSIFICATION = :active_structure
585
+ LAYER = Layers::Connectors
586
+
587
+ def initialize(args)
588
+ super
589
+ end
590
+ end
591
+
592
+ class Junction < Element
593
+ CLASSIFICATION = :active_structure
594
+ LAYER = Layers::Connectors
595
+
596
+ def initialize(args)
597
+ super
598
+ end
599
+ end
600
+
601
+ class OrJunction < Element
602
+ CLASSIFICATION = :active_structure
603
+ LAYER = Layers::Connectors
604
+
605
+ def initialize(args)
606
+ super
607
+ end
608
+ end
609
+
610
+ #############################################################
611
+ # Strategy Layer
612
+ #############################################################
613
+
614
+ class Capability < Element
615
+ CLASSIFICATION = :active_structure
616
+ LAYER = Layers::Strategy
617
+
618
+ def initialize(args)
619
+ super
620
+ end
621
+ end
622
+
623
+ class CourseOfAction < Element
624
+ CLASSIFICATION = :active_structure
625
+ LAYER = Layers::Strategy
626
+
627
+ def initialize(args)
628
+ super
629
+ end
630
+ end
631
+
632
+ class Resource < Element
633
+ CLASSIFICATION = :active_structure
634
+ LAYER = Layers::Strategy
635
+
636
+ def initialize(args)
637
+ super
638
+ end
639
+ end
640
+
641
+ #############################################################
642
+ # Other Layer
643
+ #############################################################
644
+
645
+ class Grouping < Element
646
+ CLASSIFICATION = :other
647
+ LAYER = Layers::Other
648
+
649
+ def initialize(args)
650
+ super
651
+ end
652
+ end
653
+
654
+ #############################################################
655
+ # Module Methods
656
+ #############################################################
657
+
658
+ def self.create(*args)
659
+ cls_name = str_filter(args[0].delete(:type))
660
+ const_get(cls_name).new(*args)
661
+ rescue NameError => err
662
+ Archimate::Logging.error "An invalid element type '#{cls_name}' was used to create an Element"
663
+ raise err
664
+ end
665
+
666
+ def self.===(other)
667
+ constants.map(&:to_s).include?(str_filter(other))
668
+ end
669
+
670
+ def self.str_filter(str)
671
+ element_substitutions = {}.freeze
672
+ cls_name = str.strip
673
+ element_substitutions.fetch(cls_name, cls_name)
674
+ end
675
+
676
+ def self.classes
677
+ constants.map { |cls_name| const_get(cls_name) }
678
+ end
679
+ end
680
+ end
681
+ end
@@ -6,18 +6,18 @@ module Archimate
6
6
  include Comparison
7
7
 
8
8
  # @!attribute [r] name
9
- # @return [String, NilClass]
10
- model_attr :name
9
+ # @return [String, NilClass]
10
+ model_attr :name, default: nil
11
11
  # @!attribute [r] size
12
- # @return [Float, NilClass]
13
- model_attr :size
12
+ # @return [Float, NilClass]
13
+ model_attr :size, default: nil
14
14
  # @todo make this an enum
15
15
  # @!attribute [r] style
16
- # @return [Int, NilClass]
17
- model_attr :style
16
+ # @return [Int, NilClass]
17
+ model_attr :style, default: nil
18
18
  # @!attribute [r] font_data
19
- # @return [String, NilClass]
20
- model_attr :font_data
19
+ # @return [String, NilClass]
20
+ model_attr :font_data, default: nil
21
21
 
22
22
  # Archi font strings look like this:
23
23
  # "1|Arial |14.0|0|WINDOWS|1|0 |0|0|0|0 |0 |0|0|1|0|0|0|0 |Arial"