1
2
3
4
5 package org.andromda.cartridges.jbpm.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.ActivityGraphFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.ModelElementFacade;
16 import org.andromda.metafacades.uml.ModelFacade;
17 import org.andromda.metafacades.uml.PackageFacade;
18 import org.andromda.metafacades.uml.PartitionFacade;
19 import org.andromda.metafacades.uml.StateMachineFacade;
20 import org.andromda.metafacades.uml.StateVertexFacade;
21 import org.andromda.metafacades.uml.StereotypeFacade;
22 import org.andromda.metafacades.uml.TaggedValueFacade;
23 import org.andromda.metafacades.uml.TemplateParameterFacade;
24 import org.andromda.metafacades.uml.TypeMappings;
25
26
27
28
29
30
31
32 public abstract class JBpmSwimlaneLogic
33 extends MetafacadeBase
34 implements JBpmSwimlane
35 {
36
37
38
39
40 protected Object metaObject;
41
42
43
44
45
46 protected JBpmSwimlaneLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superPartitionFacade =
50 (PartitionFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.PartitionFacade",
53 metaObjectIn,
54 getContext(context));
55 this.metaObject = metaObjectIn;
56 }
57
58
59
60
61
62
63 private static String getContext(String context)
64 {
65 if (context == null)
66 {
67 context = "org.andromda.cartridges.jbpm.metafacades.JBpmSwimlane";
68 }
69 return context;
70 }
71
72 private PartitionFacade superPartitionFacade;
73 private boolean superPartitionFacadeInitialized = false;
74
75
76
77
78
79 private PartitionFacade getSuperPartitionFacade()
80 {
81 if (!this.superPartitionFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superPartitionFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superPartitionFacadeInitialized = true;
85 }
86 return this.superPartitionFacade;
87 }
88
89
90
91
92
93 @Override
94 public void resetMetafacadeContext(String context)
95 {
96 if (!this.contextRoot)
97 {
98 context = getContext(context);
99 setMetafacadeContext (context);
100 if (this.superPartitionFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superPartitionFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107
108
109
110
111 public boolean isJBpmSwimlaneMetaType()
112 {
113 return true;
114 }
115
116
117
118
119
120
121
122 protected abstract String handleGetAssignmentExpression();
123
124 private String __assignmentExpression1a;
125 private boolean __assignmentExpression1aSet = false;
126
127
128
129
130
131
132 public final String getAssignmentExpression()
133 {
134 String assignmentExpression1a = this.__assignmentExpression1a;
135 if (!this.__assignmentExpression1aSet)
136 {
137
138 assignmentExpression1a = handleGetAssignmentExpression();
139
140 this.__assignmentExpression1a = assignmentExpression1a;
141 if (isMetafacadePropertyCachingEnabled())
142 {
143 this.__assignmentExpression1aSet = true;
144 }
145 }
146 return assignmentExpression1a;
147 }
148
149
150
151
152
153 protected abstract boolean handleIsContainedInBusinessProcess();
154
155 private boolean __containedInBusinessProcess2a;
156 private boolean __containedInBusinessProcess2aSet = false;
157
158
159
160
161
162 public final boolean isContainedInBusinessProcess()
163 {
164 boolean containedInBusinessProcess2a = this.__containedInBusinessProcess2a;
165 if (!this.__containedInBusinessProcess2aSet)
166 {
167
168 containedInBusinessProcess2a = handleIsContainedInBusinessProcess();
169
170 this.__containedInBusinessProcess2a = containedInBusinessProcess2a;
171 if (isMetafacadePropertyCachingEnabled())
172 {
173 this.__containedInBusinessProcess2aSet = true;
174 }
175 }
176 return containedInBusinessProcess2a;
177 }
178
179
180
181
182
183 protected abstract String handleGetClazz();
184
185 private String __clazz3a;
186 private boolean __clazz3aSet = false;
187
188
189
190
191
192 public final String getClazz()
193 {
194 String clazz3a = this.__clazz3a;
195 if (!this.__clazz3aSet)
196 {
197
198 clazz3a = handleGetClazz();
199
200 this.__clazz3a = clazz3a;
201 if (isMetafacadePropertyCachingEnabled())
202 {
203 this.__clazz3aSet = true;
204 }
205 }
206 return clazz3a;
207 }
208
209
210
211
212
213 protected abstract String handleGetAssignmentHandlerClassName();
214
215 private String __assignmentHandlerClassName4a;
216 private boolean __assignmentHandlerClassName4aSet = false;
217
218
219
220
221
222
223 public final String getAssignmentHandlerClassName()
224 {
225 String assignmentHandlerClassName4a = this.__assignmentHandlerClassName4a;
226 if (!this.__assignmentHandlerClassName4aSet)
227 {
228
229 assignmentHandlerClassName4a = handleGetAssignmentHandlerClassName();
230
231 this.__assignmentHandlerClassName4a = assignmentHandlerClassName4a;
232 if (isMetafacadePropertyCachingEnabled())
233 {
234 this.__assignmentHandlerClassName4aSet = true;
235 }
236 }
237 return assignmentHandlerClassName4a;
238 }
239
240
241
242
243
244 protected abstract String handleGetAssignmentHandlerPackageName();
245
246 private String __assignmentHandlerPackageName5a;
247 private boolean __assignmentHandlerPackageName5aSet = false;
248
249
250
251
252
253
254 public final String getAssignmentHandlerPackageName()
255 {
256 String assignmentHandlerPackageName5a = this.__assignmentHandlerPackageName5a;
257 if (!this.__assignmentHandlerPackageName5aSet)
258 {
259
260 assignmentHandlerPackageName5a = handleGetAssignmentHandlerPackageName();
261
262 this.__assignmentHandlerPackageName5a = assignmentHandlerPackageName5a;
263 if (isMetafacadePropertyCachingEnabled())
264 {
265 this.__assignmentHandlerPackageName5aSet = true;
266 }
267 }
268 return assignmentHandlerPackageName5a;
269 }
270
271
272
273
274
275 protected abstract String handleGetAssignmentHandlerFullPath();
276
277 private String __assignmentHandlerFullPath6a;
278 private boolean __assignmentHandlerFullPath6aSet = false;
279
280
281
282
283
284
285 public final String getAssignmentHandlerFullPath()
286 {
287 String assignmentHandlerFullPath6a = this.__assignmentHandlerFullPath6a;
288 if (!this.__assignmentHandlerFullPath6aSet)
289 {
290
291 assignmentHandlerFullPath6a = handleGetAssignmentHandlerFullPath();
292
293 this.__assignmentHandlerFullPath6a = assignmentHandlerFullPath6a;
294 if (isMetafacadePropertyCachingEnabled())
295 {
296 this.__assignmentHandlerFullPath6aSet = true;
297 }
298 }
299 return assignmentHandlerFullPath6a;
300 }
301
302
303
304
305
306
307
308 public boolean isPartitionFacadeMetaType()
309 {
310 return true;
311 }
312
313
314
315
316
317 public boolean isModelElementFacadeMetaType()
318 {
319 return true;
320 }
321
322
323
324
325
326
327 public void copyTaggedValues(ModelElementFacade element)
328 {
329 this.getSuperPartitionFacade().copyTaggedValues(element);
330 }
331
332
333
334
335
336
337 public Object findTaggedValue(String tagName)
338 {
339 return this.getSuperPartitionFacade().findTaggedValue(tagName);
340 }
341
342
343
344
345
346
347 public Collection<Object> findTaggedValues(String tagName)
348 {
349 return this.getSuperPartitionFacade().findTaggedValues(tagName);
350 }
351
352
353
354
355
356
357
358 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
359 {
360 return this.getSuperPartitionFacade().getBindedFullyQualifiedName(bindedElement);
361 }
362
363
364
365
366
367 public Collection<ConstraintFacade> getConstraints()
368 {
369 return this.getSuperPartitionFacade().getConstraints();
370 }
371
372
373
374
375
376
377 public Collection<ConstraintFacade> getConstraints(String kind)
378 {
379 return this.getSuperPartitionFacade().getConstraints(kind);
380 }
381
382
383
384
385
386
387
388 public String getDocumentation(String indent)
389 {
390 return this.getSuperPartitionFacade().getDocumentation(indent);
391 }
392
393
394
395
396
397
398
399
400 public String getDocumentation(String indent, int lineLength)
401 {
402 return this.getSuperPartitionFacade().getDocumentation(indent, lineLength);
403 }
404
405
406
407
408
409
410
411 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
412 {
413 return this.getSuperPartitionFacade().getDocumentation(indent, lineLength, htmlStyle);
414 }
415
416
417
418
419
420 public String getFullyQualifiedName()
421 {
422 return this.getSuperPartitionFacade().getFullyQualifiedName();
423 }
424
425
426
427
428
429
430
431
432 public String getFullyQualifiedName(boolean modelName)
433 {
434 return this.getSuperPartitionFacade().getFullyQualifiedName(modelName);
435 }
436
437
438
439
440
441
442 public String getFullyQualifiedNamePath()
443 {
444 return this.getSuperPartitionFacade().getFullyQualifiedNamePath();
445 }
446
447
448
449
450
451 public String getId()
452 {
453 return this.getSuperPartitionFacade().getId();
454 }
455
456
457
458
459
460
461
462
463
464 public Collection<String> getKeywords()
465 {
466 return this.getSuperPartitionFacade().getKeywords();
467 }
468
469
470
471
472
473 public String getLabel()
474 {
475 return this.getSuperPartitionFacade().getLabel();
476 }
477
478
479
480
481
482 public TypeMappings getLanguageMappings()
483 {
484 return this.getSuperPartitionFacade().getLanguageMappings();
485 }
486
487
488
489
490
491
492 public ModelFacade getModel()
493 {
494 return this.getSuperPartitionFacade().getModel();
495 }
496
497
498
499
500
501 public String getName()
502 {
503 return this.getSuperPartitionFacade().getName();
504 }
505
506
507
508
509
510 public ModelElementFacade getPackage()
511 {
512 return this.getSuperPartitionFacade().getPackage();
513 }
514
515
516
517
518
519 public String getPackageName()
520 {
521 return this.getSuperPartitionFacade().getPackageName();
522 }
523
524
525
526
527
528
529 public String getPackageName(boolean modelName)
530 {
531 return this.getSuperPartitionFacade().getPackageName(modelName);
532 }
533
534
535
536
537
538 public String getPackagePath()
539 {
540 return this.getSuperPartitionFacade().getPackagePath();
541 }
542
543
544
545
546
547
548
549
550 public String getQualifiedName()
551 {
552 return this.getSuperPartitionFacade().getQualifiedName();
553 }
554
555
556
557
558
559 public PackageFacade getRootPackage()
560 {
561 return this.getSuperPartitionFacade().getRootPackage();
562 }
563
564
565
566
567
568 public Collection<DependencyFacade> getSourceDependencies()
569 {
570 return this.getSuperPartitionFacade().getSourceDependencies();
571 }
572
573
574
575
576
577
578 public StateMachineFacade getStateMachineContext()
579 {
580 return this.getSuperPartitionFacade().getStateMachineContext();
581 }
582
583
584
585
586
587 public Collection<String> getStereotypeNames()
588 {
589 return this.getSuperPartitionFacade().getStereotypeNames();
590 }
591
592
593
594
595
596 public Collection<StereotypeFacade> getStereotypes()
597 {
598 return this.getSuperPartitionFacade().getStereotypes();
599 }
600
601
602
603
604
605 public Collection<TaggedValueFacade> getTaggedValues()
606 {
607 return this.getSuperPartitionFacade().getTaggedValues();
608 }
609
610
611
612
613
614 public Collection<DependencyFacade> getTargetDependencies()
615 {
616 return this.getSuperPartitionFacade().getTargetDependencies();
617 }
618
619
620
621
622
623 public Object getTemplateParameter(String parameterName)
624 {
625 return this.getSuperPartitionFacade().getTemplateParameter(parameterName);
626 }
627
628
629
630
631
632 public Collection<TemplateParameterFacade> getTemplateParameters()
633 {
634 return this.getSuperPartitionFacade().getTemplateParameters();
635 }
636
637
638
639
640
641
642 public String getVisibility()
643 {
644 return this.getSuperPartitionFacade().getVisibility();
645 }
646
647
648
649
650
651
652 public boolean hasExactStereotype(String stereotypeName)
653 {
654 return this.getSuperPartitionFacade().hasExactStereotype(stereotypeName);
655 }
656
657
658
659
660
661
662 public boolean hasKeyword(String keywordName)
663 {
664 return this.getSuperPartitionFacade().hasKeyword(keywordName);
665 }
666
667
668
669
670
671
672
673
674
675
676
677
678
679 public boolean hasStereotype(String stereotypeName)
680 {
681 return this.getSuperPartitionFacade().hasStereotype(stereotypeName);
682 }
683
684
685
686
687
688
689 public boolean isBindingDependenciesPresent()
690 {
691 return this.getSuperPartitionFacade().isBindingDependenciesPresent();
692 }
693
694
695
696
697
698 public boolean isConstraintsPresent()
699 {
700 return this.getSuperPartitionFacade().isConstraintsPresent();
701 }
702
703
704
705
706
707 public boolean isDocumentationPresent()
708 {
709 return this.getSuperPartitionFacade().isDocumentationPresent();
710 }
711
712
713
714
715
716 public boolean isReservedWord()
717 {
718 return this.getSuperPartitionFacade().isReservedWord();
719 }
720
721
722
723
724
725
726 public boolean isTemplateParametersPresent()
727 {
728 return this.getSuperPartitionFacade().isTemplateParametersPresent();
729 }
730
731
732
733
734
735
736
737 public boolean isValidIdentifierName()
738 {
739 return this.getSuperPartitionFacade().isValidIdentifierName();
740 }
741
742
743
744
745
746
747
748 public String translateConstraint(String name, String translation)
749 {
750 return this.getSuperPartitionFacade().translateConstraint(name, translation);
751 }
752
753
754
755
756
757 public String[] translateConstraints(String translation)
758 {
759 return this.getSuperPartitionFacade().translateConstraints(translation);
760 }
761
762
763
764
765
766 public String[] translateConstraints(String kind, String translation)
767 {
768 return this.getSuperPartitionFacade().translateConstraints(kind, translation);
769 }
770
771
772
773
774
775
776
777
778
779
780
781
782 public ActivityGraphFacade getActivityGraph()
783 {
784 return this.getSuperPartitionFacade().getActivityGraph();
785 }
786
787
788
789
790
791 public Collection<StateVertexFacade> getVertices()
792 {
793 return this.getSuperPartitionFacade().getVertices();
794 }
795
796
797
798
799 @Override
800 public void initialize()
801 {
802 this.getSuperPartitionFacade().initialize();
803 }
804
805
806
807
808
809 @Override
810 public Object getValidationOwner()
811 {
812 Object owner = this.getSuperPartitionFacade().getValidationOwner();
813 return owner;
814 }
815
816
817
818
819
820 @Override
821 public String getValidationName()
822 {
823 String name = this.getSuperPartitionFacade().getValidationName();
824 return name;
825 }
826
827
828
829
830
831 @Override
832 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
833 {
834 this.getSuperPartitionFacade().validateInvariants(validationMessages);
835 }
836
837
838
839
840 private static final String NAME_PROPERTY = "name";
841 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
842
843
844
845
846 @Override
847 public String toString()
848 {
849 final StringBuilder toString = new StringBuilder(this.getClass().getName());
850 toString.append("[");
851 try
852 {
853 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
854 }
855 catch (final Throwable tryAgain)
856 {
857 try
858 {
859 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
860 }
861 catch (final Throwable ignore)
862 {
863
864 }
865 }
866 toString.append("]");
867 return toString.toString();
868 }
869 }