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