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.ConstraintFacade;
13 import org.andromda.metafacades.uml.DependencyFacade;
14 import org.andromda.metafacades.uml.ModelElementFacade;
15 import org.andromda.metafacades.uml.ModelFacade;
16 import org.andromda.metafacades.uml.PackageFacade;
17 import org.andromda.metafacades.uml.PartitionFacade;
18 import org.andromda.metafacades.uml.PseudostateFacade;
19 import org.andromda.metafacades.uml.StateFacade;
20 import org.andromda.metafacades.uml.StateMachineFacade;
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.TransitionFacade;
25 import org.andromda.metafacades.uml.TypeMappings;
26 import org.andromda.translation.ocl.validation.OCLCollections;
27 import org.andromda.translation.ocl.validation.OCLIntrospector;
28 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
29 import org.apache.commons.collections.Predicate;
30 import org.apache.log4j.Logger;
31
32
33
34
35
36
37
38 public abstract class JBpmPseudostateLogic
39 extends MetafacadeBase
40 implements JBpmPseudostate
41 {
42
43
44
45
46 protected Object metaObject;
47
48
49
50
51
52 protected JBpmPseudostateLogic(Object metaObjectIn, String context)
53 {
54 super(metaObjectIn, getContext(context));
55 this.superJBpmStateVertex =
56 (JBpmStateVertex)
57 MetafacadeFactory.getInstance().createFacadeImpl(
58 "org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex",
59 metaObjectIn,
60 getContext(context));
61 this.superPseudostateFacade =
62 (PseudostateFacade)
63 MetafacadeFactory.getInstance().createFacadeImpl(
64 "org.andromda.metafacades.uml.PseudostateFacade",
65 metaObjectIn,
66 getContext(context));
67 this.metaObject = metaObjectIn;
68 }
69
70
71
72
73 private static final Logger logger = Logger.getLogger(JBpmPseudostateLogic.class);
74
75
76
77
78
79
80 private static String getContext(String context)
81 {
82 if (context == null)
83 {
84 context = "org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate";
85 }
86 return context;
87 }
88
89 private JBpmStateVertex superJBpmStateVertex;
90 private boolean superJBpmStateVertexInitialized = false;
91
92
93
94
95
96 protected JBpmStateVertex getSuperJBpmStateVertex()
97 {
98 if (!this.superJBpmStateVertexInitialized)
99 {
100 ((MetafacadeBase)this.superJBpmStateVertex).setMetafacadeContext(this.getMetafacadeContext());
101 this.superJBpmStateVertexInitialized = true;
102 }
103 return this.superJBpmStateVertex;
104 }
105
106 private PseudostateFacade superPseudostateFacade;
107 private boolean superPseudostateFacadeInitialized = false;
108
109
110
111
112
113 protected PseudostateFacade getSuperPseudostateFacade()
114 {
115 if (!this.superPseudostateFacadeInitialized)
116 {
117 ((MetafacadeBase)this.superPseudostateFacade).setMetafacadeContext(this.getMetafacadeContext());
118 this.superPseudostateFacadeInitialized = true;
119 }
120 return this.superPseudostateFacade;
121 }
122
123
124
125
126
127 @Override
128 public void resetMetafacadeContext(String context)
129 {
130 if (!this.contextRoot)
131 {
132 context = getContext(context);
133 setMetafacadeContext (context);
134 if (this.superJBpmStateVertexInitialized)
135 {
136 ((MetafacadeBase)this.superJBpmStateVertex).resetMetafacadeContext(context);
137 }
138 if (this.superPseudostateFacadeInitialized)
139 {
140 ((MetafacadeBase)this.superPseudostateFacade).resetMetafacadeContext(context);
141 }
142 }
143 }
144
145
146
147
148
149 public boolean isJBpmPseudostateMetaType()
150 {
151 return true;
152 }
153
154
155
156
157
158
159
160 protected abstract String handleGetClazz();
161
162 private String __clazz1a;
163 private boolean __clazz1aSet = false;
164
165
166
167
168
169 public final String getClazz()
170 {
171 String clazz1a = this.__clazz1a;
172 if (!this.__clazz1aSet)
173 {
174
175 clazz1a = handleGetClazz();
176
177 this.__clazz1a = clazz1a;
178 if (isMetafacadePropertyCachingEnabled())
179 {
180 this.__clazz1aSet = true;
181 }
182 }
183 return clazz1a;
184 }
185
186
187
188
189
190 protected abstract String handleGetClassName();
191
192 private String __className2a;
193 private boolean __className2aSet = false;
194
195
196
197
198
199
200 public final String getClassName()
201 {
202 String className2a = this.__className2a;
203 if (!this.__className2aSet)
204 {
205
206 className2a = handleGetClassName();
207
208 this.__className2a = className2a;
209 if (isMetafacadePropertyCachingEnabled())
210 {
211 this.__className2aSet = true;
212 }
213 }
214 return className2a;
215 }
216
217
218
219
220
221 protected abstract String handleGetDecisionHandlerPackageName();
222
223 private String __decisionHandlerPackageName3a;
224 private boolean __decisionHandlerPackageName3aSet = false;
225
226
227
228
229
230
231 public final String getDecisionHandlerPackageName()
232 {
233 String decisionHandlerPackageName3a = this.__decisionHandlerPackageName3a;
234 if (!this.__decisionHandlerPackageName3aSet)
235 {
236
237 decisionHandlerPackageName3a = handleGetDecisionHandlerPackageName();
238
239 this.__decisionHandlerPackageName3a = decisionHandlerPackageName3a;
240 if (isMetafacadePropertyCachingEnabled())
241 {
242 this.__decisionHandlerPackageName3aSet = true;
243 }
244 }
245 return decisionHandlerPackageName3a;
246 }
247
248
249
250
251
252 protected abstract String handleGetDecisionHandlerFullPath();
253
254 private String __decisionHandlerFullPath4a;
255 private boolean __decisionHandlerFullPath4aSet = false;
256
257
258
259
260
261
262 public final String getDecisionHandlerFullPath()
263 {
264 String decisionHandlerFullPath4a = this.__decisionHandlerFullPath4a;
265 if (!this.__decisionHandlerFullPath4aSet)
266 {
267
268 decisionHandlerFullPath4a = handleGetDecisionHandlerFullPath();
269
270 this.__decisionHandlerFullPath4a = decisionHandlerFullPath4a;
271 if (isMetafacadePropertyCachingEnabled())
272 {
273 this.__decisionHandlerFullPath4aSet = true;
274 }
275 }
276 return decisionHandlerFullPath4a;
277 }
278
279
280
281
282
283 protected abstract String handleGetDecisionHandlerClassName();
284
285 private String __decisionHandlerClassName5a;
286 private boolean __decisionHandlerClassName5aSet = false;
287
288
289
290
291
292
293 public final String getDecisionHandlerClassName()
294 {
295 String decisionHandlerClassName5a = this.__decisionHandlerClassName5a;
296 if (!this.__decisionHandlerClassName5aSet)
297 {
298
299 decisionHandlerClassName5a = handleGetDecisionHandlerClassName();
300
301 this.__decisionHandlerClassName5a = decisionHandlerClassName5a;
302 if (isMetafacadePropertyCachingEnabled())
303 {
304 this.__decisionHandlerClassName5aSet = true;
305 }
306 }
307 return decisionHandlerClassName5a;
308 }
309
310
311
312 private JBpmSwimlane __getSwimlane1r;
313 private boolean __getSwimlane1rSet = false;
314
315
316
317
318
319 public final JBpmSwimlane getSwimlane()
320 {
321 JBpmSwimlane getSwimlane1r = this.__getSwimlane1r;
322 if (!this.__getSwimlane1rSet)
323 {
324
325 Object result = handleGetSwimlane();
326 MetafacadeBase shieldedResult = this.shieldedElement(result);
327 try
328 {
329 getSwimlane1r = (JBpmSwimlane)shieldedResult;
330 }
331 catch (ClassCastException ex)
332 {
333
334 JBpmPseudostateLogic.logger.warn("incorrect metafacade cast for JBpmPseudostateLogic.getSwimlane JBpmSwimlane " + result + ": " + shieldedResult);
335 }
336
337 this.__getSwimlane1r = getSwimlane1r;
338 if (isMetafacadePropertyCachingEnabled())
339 {
340 this.__getSwimlane1rSet = true;
341 }
342 }
343 return getSwimlane1r;
344 }
345
346
347
348
349
350 protected abstract Object handleGetSwimlane();
351
352
353
354
355
356 public boolean isJBpmStateVertexMetaType()
357 {
358 return true;
359 }
360
361
362
363
364
365 public boolean isPseudostateFacadeMetaType()
366 {
367 return true;
368 }
369
370
371
372
373
374 public boolean isStateVertexFacadeMetaType()
375 {
376 return true;
377 }
378
379
380
381
382
383 public boolean isModelElementFacadeMetaType()
384 {
385 return true;
386 }
387
388
389
390
391
392
393
394 public String getNodeClassName()
395 {
396 return this.getSuperJBpmStateVertex().getNodeClassName();
397 }
398
399
400
401
402
403
404 public String getNodePackageName()
405 {
406 return this.getSuperJBpmStateVertex().getNodePackageName();
407 }
408
409
410
411
412
413 public JBpmProcessDefinition getProcessDefinition()
414 {
415 return this.getSuperJBpmStateVertex().getProcessDefinition();
416 }
417
418
419
420
421
422 public boolean isContainedInBusinessProcess()
423 {
424 return this.getSuperJBpmStateVertex().isContainedInBusinessProcess();
425 }
426
427
428
429
430
431 public void copyTaggedValues(ModelElementFacade element)
432 {
433 this.getSuperJBpmStateVertex().copyTaggedValues(element);
434 }
435
436
437
438
439
440
441 public Object findTaggedValue(String tagName)
442 {
443 return this.getSuperJBpmStateVertex().findTaggedValue(tagName);
444 }
445
446
447
448
449
450
451 public Collection<Object> findTaggedValues(String tagName)
452 {
453 return this.getSuperJBpmStateVertex().findTaggedValues(tagName);
454 }
455
456
457
458
459
460
461
462 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
463 {
464 return this.getSuperJBpmStateVertex().getBindedFullyQualifiedName(bindedElement);
465 }
466
467
468
469
470
471 public Collection<ConstraintFacade> getConstraints()
472 {
473 return this.getSuperJBpmStateVertex().getConstraints();
474 }
475
476
477
478
479
480
481 public Collection<ConstraintFacade> getConstraints(String kind)
482 {
483 return this.getSuperJBpmStateVertex().getConstraints(kind);
484 }
485
486
487
488
489
490
491
492 public String getDocumentation(String indent)
493 {
494 return this.getSuperJBpmStateVertex().getDocumentation(indent);
495 }
496
497
498
499
500
501
502
503
504 public String getDocumentation(String indent, int lineLength)
505 {
506 return this.getSuperJBpmStateVertex().getDocumentation(indent, lineLength);
507 }
508
509
510
511
512
513
514
515 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
516 {
517 return this.getSuperJBpmStateVertex().getDocumentation(indent, lineLength, htmlStyle);
518 }
519
520
521
522
523
524 public String getFullyQualifiedName()
525 {
526 return this.getSuperJBpmStateVertex().getFullyQualifiedName();
527 }
528
529
530
531
532
533
534
535
536 public String getFullyQualifiedName(boolean modelName)
537 {
538 return this.getSuperJBpmStateVertex().getFullyQualifiedName(modelName);
539 }
540
541
542
543
544
545
546 public String getFullyQualifiedNamePath()
547 {
548 return this.getSuperJBpmStateVertex().getFullyQualifiedNamePath();
549 }
550
551
552
553
554
555 public String getId()
556 {
557 return this.getSuperJBpmStateVertex().getId();
558 }
559
560
561
562
563
564
565
566
567
568 public Collection<String> getKeywords()
569 {
570 return this.getSuperJBpmStateVertex().getKeywords();
571 }
572
573
574
575
576
577 public String getLabel()
578 {
579 return this.getSuperJBpmStateVertex().getLabel();
580 }
581
582
583
584
585
586 public TypeMappings getLanguageMappings()
587 {
588 return this.getSuperJBpmStateVertex().getLanguageMappings();
589 }
590
591
592
593
594
595
596 public ModelFacade getModel()
597 {
598 return this.getSuperJBpmStateVertex().getModel();
599 }
600
601
602
603
604
605 public String getName()
606 {
607 return this.getSuperJBpmStateVertex().getName();
608 }
609
610
611
612
613
614 public ModelElementFacade getPackage()
615 {
616 return this.getSuperJBpmStateVertex().getPackage();
617 }
618
619
620
621
622
623 public String getPackageName()
624 {
625 return this.getSuperJBpmStateVertex().getPackageName();
626 }
627
628
629
630
631
632
633 public String getPackageName(boolean modelName)
634 {
635 return this.getSuperJBpmStateVertex().getPackageName(modelName);
636 }
637
638
639
640
641
642 public String getPackagePath()
643 {
644 return this.getSuperJBpmStateVertex().getPackagePath();
645 }
646
647
648
649
650
651
652
653
654 public String getQualifiedName()
655 {
656 return this.getSuperJBpmStateVertex().getQualifiedName();
657 }
658
659
660
661
662
663 public PackageFacade getRootPackage()
664 {
665 return this.getSuperJBpmStateVertex().getRootPackage();
666 }
667
668
669
670
671
672 public Collection<DependencyFacade> getSourceDependencies()
673 {
674 return this.getSuperJBpmStateVertex().getSourceDependencies();
675 }
676
677
678
679
680
681
682 public StateMachineFacade getStateMachineContext()
683 {
684 return this.getSuperJBpmStateVertex().getStateMachineContext();
685 }
686
687
688
689
690
691 public Collection<String> getStereotypeNames()
692 {
693 return this.getSuperJBpmStateVertex().getStereotypeNames();
694 }
695
696
697
698
699
700 public Collection<StereotypeFacade> getStereotypes()
701 {
702 return this.getSuperJBpmStateVertex().getStereotypes();
703 }
704
705
706
707
708
709 public Collection<TaggedValueFacade> getTaggedValues()
710 {
711 return this.getSuperJBpmStateVertex().getTaggedValues();
712 }
713
714
715
716
717
718 public Collection<DependencyFacade> getTargetDependencies()
719 {
720 return this.getSuperJBpmStateVertex().getTargetDependencies();
721 }
722
723
724
725
726
727 public Object getTemplateParameter(String parameterName)
728 {
729 return this.getSuperJBpmStateVertex().getTemplateParameter(parameterName);
730 }
731
732
733
734
735
736 public Collection<TemplateParameterFacade> getTemplateParameters()
737 {
738 return this.getSuperJBpmStateVertex().getTemplateParameters();
739 }
740
741
742
743
744
745
746 public String getVisibility()
747 {
748 return this.getSuperJBpmStateVertex().getVisibility();
749 }
750
751
752
753
754
755
756 public boolean hasExactStereotype(String stereotypeName)
757 {
758 return this.getSuperJBpmStateVertex().hasExactStereotype(stereotypeName);
759 }
760
761
762
763
764
765
766 public boolean hasKeyword(String keywordName)
767 {
768 return this.getSuperJBpmStateVertex().hasKeyword(keywordName);
769 }
770
771
772
773
774
775
776
777
778
779
780
781
782
783 public boolean hasStereotype(String stereotypeName)
784 {
785 return this.getSuperJBpmStateVertex().hasStereotype(stereotypeName);
786 }
787
788
789
790
791
792
793 public boolean isBindingDependenciesPresent()
794 {
795 return this.getSuperJBpmStateVertex().isBindingDependenciesPresent();
796 }
797
798
799
800
801
802 public boolean isConstraintsPresent()
803 {
804 return this.getSuperJBpmStateVertex().isConstraintsPresent();
805 }
806
807
808
809
810
811 public boolean isDocumentationPresent()
812 {
813 return this.getSuperJBpmStateVertex().isDocumentationPresent();
814 }
815
816
817
818
819
820 public boolean isReservedWord()
821 {
822 return this.getSuperJBpmStateVertex().isReservedWord();
823 }
824
825
826
827
828
829
830 public boolean isTemplateParametersPresent()
831 {
832 return this.getSuperJBpmStateVertex().isTemplateParametersPresent();
833 }
834
835
836
837
838
839
840
841 public boolean isValidIdentifierName()
842 {
843 return this.getSuperJBpmStateVertex().isValidIdentifierName();
844 }
845
846
847
848
849
850
851
852 public String translateConstraint(String name, String translation)
853 {
854 return this.getSuperJBpmStateVertex().translateConstraint(name, translation);
855 }
856
857
858
859
860
861 public String[] translateConstraints(String translation)
862 {
863 return this.getSuperJBpmStateVertex().translateConstraints(translation);
864 }
865
866
867
868
869
870 public String[] translateConstraints(String kind, String translation)
871 {
872 return this.getSuperJBpmStateVertex().translateConstraints(kind, translation);
873 }
874
875
876
877
878
879
880
881
882
883
884
885
886 public StateFacade getContainer()
887 {
888 return this.getSuperJBpmStateVertex().getContainer();
889 }
890
891
892
893
894
895
896
897
898
899 public Collection<TransitionFacade> getIncomings()
900 {
901 return this.getSuperJBpmStateVertex().getIncomings();
902 }
903
904
905
906
907
908
909
910
911
912 public Collection<TransitionFacade> getOutgoings()
913 {
914 return this.getSuperJBpmStateVertex().getOutgoings();
915 }
916
917
918
919
920
921 public PartitionFacade getPartition()
922 {
923 return this.getSuperJBpmStateVertex().getPartition();
924 }
925
926
927
928
929
930
931
932
933
934
935
936
937 public StateMachineFacade getStateMachine()
938 {
939 return this.getSuperJBpmStateVertex().getStateMachine();
940 }
941
942
943
944
945
946
947 public boolean isChoice()
948 {
949 return this.getSuperPseudostateFacade().isChoice();
950 }
951
952
953
954
955
956
957 public boolean isCollect()
958 {
959 return this.getSuperPseudostateFacade().isCollect();
960 }
961
962
963
964
965
966 public boolean isDecisionPoint()
967 {
968 return this.getSuperPseudostateFacade().isDecisionPoint();
969 }
970
971
972
973
974
975 public boolean isDeepHistory()
976 {
977 return this.getSuperPseudostateFacade().isDeepHistory();
978 }
979
980
981
982
983
984 public boolean isFork()
985 {
986 return this.getSuperPseudostateFacade().isFork();
987 }
988
989
990
991
992
993 public boolean isInitialState()
994 {
995 return this.getSuperPseudostateFacade().isInitialState();
996 }
997
998
999
1000
1001
1002 public boolean isJoin()
1003 {
1004 return this.getSuperPseudostateFacade().isJoin();
1005 }
1006
1007
1008
1009
1010
1011 public boolean isJunction()
1012 {
1013 return this.getSuperPseudostateFacade().isJunction();
1014 }
1015
1016
1017
1018
1019
1020 public boolean isMergePoint()
1021 {
1022 return this.getSuperPseudostateFacade().isMergePoint();
1023 }
1024
1025
1026
1027
1028
1029 public boolean isShallowHistory()
1030 {
1031 return this.getSuperPseudostateFacade().isShallowHistory();
1032 }
1033
1034
1035
1036
1037
1038
1039 public boolean isSplit()
1040 {
1041 return this.getSuperPseudostateFacade().isSplit();
1042 }
1043
1044
1045
1046
1047 @Override
1048 public void initialize()
1049 {
1050 this.getSuperJBpmStateVertex().initialize();
1051 this.getSuperPseudostateFacade().initialize();
1052 }
1053
1054
1055
1056
1057
1058 @Override
1059 public Object getValidationOwner()
1060 {
1061 Object owner = this.getSuperJBpmStateVertex().getValidationOwner();
1062 if (owner == null)
1063 {
1064 owner = this.getSuperPseudostateFacade().getValidationOwner();
1065 }
1066 return owner;
1067 }
1068
1069
1070
1071
1072
1073 @Override
1074 public String getValidationName()
1075 {
1076 String name = this.getSuperJBpmStateVertex().getValidationName();
1077 if (name == null)
1078 {
1079 name = this.getSuperPseudostateFacade().getValidationName();
1080 }
1081 return name;
1082 }
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103 @Override
1104 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1105 {
1106 this.getSuperJBpmStateVertex().validateInvariants(validationMessages);
1107 this.getSuperPseudostateFacade().validateInvariants(validationMessages);
1108 try
1109 {
1110 final Object contextElement = this.THIS();
1111 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"split"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
1112 if (!constraintValid)
1113 {
1114 validationMessages.add(
1115 new ModelValidationMessage(
1116 (MetafacadeBase)contextElement ,
1117 "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::fork needs a name",
1118 "When you model a fork you must give it a (non-empty) name."));
1119 }
1120 }
1121 catch (Throwable th)
1122 {
1123 Throwable cause = th.getCause();
1124 int depth = 0;
1125 while (cause != null && depth < 7)
1126 {
1127 th = cause;
1128 depth++;
1129 }
1130 logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::fork needs a name' ON "
1131 + this.THIS().toString() + ": " + th.getMessage(), th);
1132 }
1133 try
1134 {
1135 final Object contextElement = this.THIS();
1136 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"decisionPoint"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
1137 if (!constraintValid)
1138 {
1139 validationMessages.add(
1140 new ModelValidationMessage(
1141 (MetafacadeBase)contextElement ,
1142 "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::decision needs a name",
1143 "When you model a decision point you must give it a (non-empty) name."));
1144 }
1145 }
1146 catch (Throwable th)
1147 {
1148 Throwable cause = th.getCause();
1149 int depth = 0;
1150 while (cause != null && depth < 7)
1151 {
1152 th = cause;
1153 depth++;
1154 }
1155 logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::decision needs a name' ON "
1156 + this.THIS().toString() + ": " + th.getMessage(), th);
1157 }
1158 try
1159 {
1160 final Object contextElement = this.THIS();
1161 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"collect"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
1162 if (!constraintValid)
1163 {
1164 validationMessages.add(
1165 new ModelValidationMessage(
1166 (MetafacadeBase)contextElement ,
1167 "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::join needs a name",
1168 "When you model a join you must give it a (non-empty) name."));
1169 }
1170 }
1171 catch (Throwable th)
1172 {
1173 Throwable cause = th.getCause();
1174 int depth = 0;
1175 while (cause != null && depth < 7)
1176 {
1177 th = cause;
1178 depth++;
1179 }
1180 logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::join needs a name' ON "
1181 + this.THIS().toString() + ": " + th.getMessage(), th);
1182 }
1183 try
1184 {
1185 final Object contextElement = this.THIS();
1186 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"decisionPoint"))).booleanValue()?OCLCollections.forAll(OCLIntrospector.invoke(contextElement,"outgoings"),new Predicate(){public boolean evaluate(Object object){return Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(object,"guard")))).booleanValue();}}):true));
1187 if (!constraintValid)
1188 {
1189 validationMessages.add(
1190 new ModelValidationMessage(
1191 (MetafacadeBase)contextElement ,
1192 "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::outgoing transitions need guards when exiting a pseudostate",
1193 "Transitions exiting a decision point each need a guard."));
1194 }
1195 }
1196 catch (Throwable th)
1197 {
1198 Throwable cause = th.getCause();
1199 int depth = 0;
1200 while (cause != null && depth < 7)
1201 {
1202 th = cause;
1203 depth++;
1204 }
1205 logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::outgoing transitions need guards when exiting a pseudostate' ON "
1206 + this.THIS().toString() + ": " + th.getMessage(), th);
1207 }
1208 try
1209 {
1210 final Object contextElement = this.THIS();
1211 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"split"))).booleanValue()?OCLCollections.forAll(OCLIntrospector.invoke(contextElement,"outgoings"),new Predicate(){public boolean evaluate(Object object){return Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(object,"name")))).booleanValue();}}):true));
1212 if (!constraintValid)
1213 {
1214 validationMessages.add(
1215 new ModelValidationMessage(
1216 (MetafacadeBase)contextElement ,
1217 "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::split needs names on all outgoing transitions",
1218 "All fork-nodes require their outgoing transitions to have a non-empty name, otherwise jBpm will not be able to distinguish between them when creating child tokens."));
1219 }
1220 }
1221 catch (Throwable th)
1222 {
1223 Throwable cause = th.getCause();
1224 int depth = 0;
1225 while (cause != null && depth < 7)
1226 {
1227 th = cause;
1228 depth++;
1229 }
1230 logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::split needs names on all outgoing transitions' ON "
1231 + this.THIS().toString() + ": " + th.getMessage(), th);
1232 }
1233 }
1234
1235
1236
1237
1238 private static final String NAME_PROPERTY = "name";
1239 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1240
1241
1242
1243
1244 @Override
1245 public String toString()
1246 {
1247 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1248 toString.append("[");
1249 try
1250 {
1251 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1252 }
1253 catch (final Throwable tryAgain)
1254 {
1255 try
1256 {
1257 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1258 }
1259 catch (final Throwable ignore)
1260 {
1261
1262 }
1263 }
1264 toString.append("]");
1265 return toString.toString();
1266 }
1267 }