1
2
3
4
5 package org.andromda.cartridges.bpm4struts.metafacades;
6
7 import java.util.Collection;
8 import java.util.List;
9 import java.util.Map;
10 import org.andromda.core.common.Introspector;
11 import org.andromda.core.metafacade.MetafacadeBase;
12 import org.andromda.core.metafacade.MetafacadeFactory;
13 import org.andromda.core.metafacade.ModelValidationMessage;
14 import org.andromda.metafacades.uml.ActionFacade;
15 import org.andromda.metafacades.uml.ConstraintFacade;
16 import org.andromda.metafacades.uml.DependencyFacade;
17 import org.andromda.metafacades.uml.EventFacade;
18 import org.andromda.metafacades.uml.FrontEndAction;
19 import org.andromda.metafacades.uml.FrontEndActivityGraph;
20 import org.andromda.metafacades.uml.FrontEndControllerOperation;
21 import org.andromda.metafacades.uml.FrontEndEvent;
22 import org.andromda.metafacades.uml.FrontEndForward;
23 import org.andromda.metafacades.uml.FrontEndParameter;
24 import org.andromda.metafacades.uml.FrontEndUseCase;
25 import org.andromda.metafacades.uml.GuardFacade;
26 import org.andromda.metafacades.uml.ModelElementFacade;
27 import org.andromda.metafacades.uml.ModelFacade;
28 import org.andromda.metafacades.uml.PackageFacade;
29 import org.andromda.metafacades.uml.PseudostateFacade;
30 import org.andromda.metafacades.uml.StateMachineFacade;
31 import org.andromda.metafacades.uml.StateVertexFacade;
32 import org.andromda.metafacades.uml.StereotypeFacade;
33 import org.andromda.metafacades.uml.TaggedValueFacade;
34 import org.andromda.metafacades.uml.TemplateParameterFacade;
35 import org.andromda.metafacades.uml.TypeMappings;
36 import org.andromda.translation.ocl.validation.OCLCollections;
37 import org.andromda.translation.ocl.validation.OCLIntrospector;
38 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
39 import org.apache.log4j.Logger;
40
41
42
43
44
45
46
47
48 public abstract class StrutsForwardLogic
49 extends MetafacadeBase
50 implements StrutsForward
51 {
52
53
54
55
56 protected Object metaObject;
57
58
59
60
61
62 protected StrutsForwardLogic(Object metaObjectIn, String context)
63 {
64 super(metaObjectIn, getContext(context));
65 this.superFrontEndForward =
66 (FrontEndForward)
67 MetafacadeFactory.getInstance().createFacadeImpl(
68 "org.andromda.metafacades.uml.FrontEndForward",
69 metaObjectIn,
70 getContext(context));
71 this.metaObject = metaObjectIn;
72 }
73
74
75
76
77 private static final Logger logger = Logger.getLogger(StrutsForwardLogic.class);
78
79
80
81
82
83
84 private static String getContext(String context)
85 {
86 if (context == null)
87 {
88 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsForward";
89 }
90 return context;
91 }
92
93 private FrontEndForward superFrontEndForward;
94 private boolean superFrontEndForwardInitialized = false;
95
96
97
98
99
100 private FrontEndForward getSuperFrontEndForward()
101 {
102 if (!this.superFrontEndForwardInitialized)
103 {
104 ((MetafacadeBase)this.superFrontEndForward).setMetafacadeContext(this.getMetafacadeContext());
105 this.superFrontEndForwardInitialized = true;
106 }
107 return this.superFrontEndForward;
108 }
109
110
111
112
113
114 @Override
115 public void resetMetafacadeContext(String context)
116 {
117 if (!this.contextRoot)
118 {
119 context = getContext(context);
120 setMetafacadeContext (context);
121 if (this.superFrontEndForwardInitialized)
122 {
123 ((MetafacadeBase)this.superFrontEndForward).resetMetafacadeContext(context);
124 }
125 }
126 }
127
128
129
130
131
132 public boolean isStrutsForwardMetaType()
133 {
134 return true;
135 }
136
137
138
139
140
141
142
143 protected abstract String handleGetForwardName();
144
145 private String __forwardName1a;
146 private boolean __forwardName1aSet = false;
147
148
149
150
151
152
153 public final String getForwardName()
154 {
155 String forwardName1a = this.__forwardName1a;
156 if (!this.__forwardName1aSet)
157 {
158
159 forwardName1a = handleGetForwardName();
160
161 this.__forwardName1a = forwardName1a;
162 if (isMetafacadePropertyCachingEnabled())
163 {
164 this.__forwardName1aSet = true;
165 }
166 }
167 return forwardName1a;
168 }
169
170
171
172
173
174 protected abstract String handleGetForwardPath();
175
176 private String __forwardPath2a;
177 private boolean __forwardPath2aSet = false;
178
179
180
181
182
183 public final String getForwardPath()
184 {
185 String forwardPath2a = this.__forwardPath2a;
186 if (!this.__forwardPath2aSet)
187 {
188
189 forwardPath2a = handleGetForwardPath();
190
191 this.__forwardPath2a = forwardPath2a;
192 if (isMetafacadePropertyCachingEnabled())
193 {
194 this.__forwardPath2aSet = true;
195 }
196 }
197 return forwardPath2a;
198 }
199
200
201
202
203
204 protected abstract String handleGetGuardName();
205
206 private String __guardName3a;
207 private boolean __guardName3aSet = false;
208
209
210
211
212
213
214 public final String getGuardName()
215 {
216 String guardName3a = this.__guardName3a;
217 if (!this.__guardName3aSet)
218 {
219
220 guardName3a = handleGetGuardName();
221
222 this.__guardName3a = guardName3a;
223 if (isMetafacadePropertyCachingEnabled())
224 {
225 this.__guardName3aSet = true;
226 }
227 }
228 return guardName3a;
229 }
230
231
232
233
234
235 protected abstract boolean handleIsEnteringPage();
236
237 private boolean __enteringPage4a;
238 private boolean __enteringPage4aSet = false;
239
240
241
242
243
244 public final boolean isEnteringPage()
245 {
246 boolean enteringPage4a = this.__enteringPage4a;
247 if (!this.__enteringPage4aSet)
248 {
249
250 enteringPage4a = handleIsEnteringPage();
251
252 this.__enteringPage4a = enteringPage4a;
253 if (isMetafacadePropertyCachingEnabled())
254 {
255 this.__enteringPage4aSet = true;
256 }
257 }
258 return enteringPage4a;
259 }
260
261
262
263
264
265 protected abstract String handleGetTargetNameKey();
266
267 private String __targetNameKey5a;
268 private boolean __targetNameKey5aSet = false;
269
270
271
272
273
274
275 public final String getTargetNameKey()
276 {
277 String targetNameKey5a = this.__targetNameKey5a;
278 if (!this.__targetNameKey5aSet)
279 {
280
281 targetNameKey5a = handleGetTargetNameKey();
282
283 this.__targetNameKey5a = targetNameKey5a;
284 if (isMetafacadePropertyCachingEnabled())
285 {
286 this.__targetNameKey5aSet = true;
287 }
288 }
289 return targetNameKey5a;
290 }
291
292
293
294
295
296 protected abstract boolean handleIsExitingPage();
297
298 private boolean __exitingPage6a;
299 private boolean __exitingPage6aSet = false;
300
301
302
303
304
305 public final boolean isExitingPage()
306 {
307 boolean exitingPage6a = this.__exitingPage6a;
308 if (!this.__exitingPage6aSet)
309 {
310
311 exitingPage6a = handleIsExitingPage();
312
313 this.__exitingPage6a = exitingPage6a;
314 if (isMetafacadePropertyCachingEnabled())
315 {
316 this.__exitingPage6aSet = true;
317 }
318 }
319 return exitingPage6a;
320 }
321
322
323
324
325
326 protected abstract Map handleGetSuccessMessages();
327
328 private Map __successMessages7a;
329 private boolean __successMessages7aSet = false;
330
331
332
333
334
335 public final Map getSuccessMessages()
336 {
337 Map successMessages7a = this.__successMessages7a;
338 if (!this.__successMessages7aSet)
339 {
340
341 successMessages7a = handleGetSuccessMessages();
342
343 this.__successMessages7a = successMessages7a;
344 if (isMetafacadePropertyCachingEnabled())
345 {
346 this.__successMessages7aSet = true;
347 }
348 }
349 return successMessages7a;
350 }
351
352
353
354
355
356 protected abstract Map handleGetWarningMessages();
357
358 private Map __warningMessages8a;
359 private boolean __warningMessages8aSet = false;
360
361
362
363
364
365 public final Map getWarningMessages()
366 {
367 Map warningMessages8a = this.__warningMessages8a;
368 if (!this.__warningMessages8aSet)
369 {
370
371 warningMessages8a = handleGetWarningMessages();
372
373 this.__warningMessages8a = warningMessages8a;
374 if (isMetafacadePropertyCachingEnabled())
375 {
376 this.__warningMessages8aSet = true;
377 }
378 }
379 return warningMessages8a;
380 }
381
382
383
384
385
386 protected abstract boolean handleIsWarningMessagesPresent();
387
388 private boolean __warningMessagesPresent9a;
389 private boolean __warningMessagesPresent9aSet = false;
390
391
392
393
394
395
396 public final boolean isWarningMessagesPresent()
397 {
398 boolean warningMessagesPresent9a = this.__warningMessagesPresent9a;
399 if (!this.__warningMessagesPresent9aSet)
400 {
401
402 warningMessagesPresent9a = handleIsWarningMessagesPresent();
403
404 this.__warningMessagesPresent9a = warningMessagesPresent9a;
405 if (isMetafacadePropertyCachingEnabled())
406 {
407 this.__warningMessagesPresent9aSet = true;
408 }
409 }
410 return warningMessagesPresent9a;
411 }
412
413
414
415
416
417 protected abstract boolean handleIsSuccessMessagesPresent();
418
419 private boolean __successMessagesPresent10a;
420 private boolean __successMessagesPresent10aSet = false;
421
422
423
424
425
426
427 public final boolean isSuccessMessagesPresent()
428 {
429 boolean successMessagesPresent10a = this.__successMessagesPresent10a;
430 if (!this.__successMessagesPresent10aSet)
431 {
432
433 successMessagesPresent10a = handleIsSuccessMessagesPresent();
434
435 this.__successMessagesPresent10a = successMessagesPresent10a;
436 if (isMetafacadePropertyCachingEnabled())
437 {
438 this.__successMessagesPresent10aSet = true;
439 }
440 }
441 return successMessagesPresent10a;
442 }
443
444
445
446 private StrutsActivityGraph __getStrutsActivityGraph1r;
447 private boolean __getStrutsActivityGraph1rSet = false;
448
449
450
451
452
453
454
455 public final StrutsActivityGraph getStrutsActivityGraph()
456 {
457 StrutsActivityGraph getStrutsActivityGraph1r = this.__getStrutsActivityGraph1r;
458 if (!this.__getStrutsActivityGraph1rSet)
459 {
460
461 Object result = handleGetStrutsActivityGraph();
462 MetafacadeBase shieldedResult = this.shieldedElement(result);
463 try
464 {
465 getStrutsActivityGraph1r = (StrutsActivityGraph)shieldedResult;
466 }
467 catch (ClassCastException ex)
468 {
469
470 StrutsForwardLogic.logger.warn("incorrect metafacade cast for StrutsForwardLogic.getStrutsActivityGraph StrutsActivityGraph " + result + ": " + shieldedResult);
471 }
472
473 this.__getStrutsActivityGraph1r = getStrutsActivityGraph1r;
474 if (isMetafacadePropertyCachingEnabled())
475 {
476 this.__getStrutsActivityGraph1rSet = true;
477 }
478 }
479 return getStrutsActivityGraph1r;
480 }
481
482
483
484
485
486 protected abstract Object handleGetStrutsActivityGraph();
487
488
489
490
491
492 public boolean isFrontEndForwardMetaType()
493 {
494 return true;
495 }
496
497
498
499
500
501 public boolean isTransitionFacadeMetaType()
502 {
503 return true;
504 }
505
506
507
508
509
510 public boolean isModelElementFacadeMetaType()
511 {
512 return true;
513 }
514
515
516
517
518
519
520 public String getActionMethodName()
521 {
522 return this.getSuperFrontEndForward().getActionMethodName();
523 }
524
525
526
527
528
529 public List<FrontEndAction> getActions()
530 {
531 return this.getSuperFrontEndForward().getActions();
532 }
533
534
535
536
537
538 public FrontEndEvent getDecisionTrigger()
539 {
540 return this.getSuperFrontEndForward().getDecisionTrigger();
541 }
542
543
544
545
546
547 public List<FrontEndParameter> getForwardParameters()
548 {
549 return this.getSuperFrontEndForward().getForwardParameters();
550 }
551
552
553
554
555
556 public FrontEndActivityGraph getFrontEndActivityGraph()
557 {
558 return this.getSuperFrontEndForward().getFrontEndActivityGraph();
559 }
560
561
562
563
564
565 public FrontEndControllerOperation getOperationCall()
566 {
567 return this.getSuperFrontEndForward().getOperationCall();
568 }
569
570
571
572
573
574 public FrontEndUseCase getUseCase()
575 {
576 return this.getSuperFrontEndForward().getUseCase();
577 }
578
579
580
581
582
583 public boolean isContainedInFrontEndUseCase()
584 {
585 return this.getSuperFrontEndForward().isContainedInFrontEndUseCase();
586 }
587
588
589
590
591
592 public boolean isEnteringView()
593 {
594 return this.getSuperFrontEndForward().isEnteringView();
595 }
596
597
598
599
600
601 public boolean isExitingView()
602 {
603 return this.getSuperFrontEndForward().isExitingView();
604 }
605
606
607
608
609
610 public void copyTaggedValues(ModelElementFacade element)
611 {
612 this.getSuperFrontEndForward().copyTaggedValues(element);
613 }
614
615
616
617
618
619
620 public Object findTaggedValue(String tagName)
621 {
622 return this.getSuperFrontEndForward().findTaggedValue(tagName);
623 }
624
625
626
627
628
629
630 public Collection<Object> findTaggedValues(String tagName)
631 {
632 return this.getSuperFrontEndForward().findTaggedValues(tagName);
633 }
634
635
636
637
638
639
640
641 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
642 {
643 return this.getSuperFrontEndForward().getBindedFullyQualifiedName(bindedElement);
644 }
645
646
647
648
649
650 public Collection<ConstraintFacade> getConstraints()
651 {
652 return this.getSuperFrontEndForward().getConstraints();
653 }
654
655
656
657
658
659
660 public Collection<ConstraintFacade> getConstraints(String kind)
661 {
662 return this.getSuperFrontEndForward().getConstraints(kind);
663 }
664
665
666
667
668
669
670
671 public String getDocumentation(String indent)
672 {
673 return this.getSuperFrontEndForward().getDocumentation(indent);
674 }
675
676
677
678
679
680
681
682
683 public String getDocumentation(String indent, int lineLength)
684 {
685 return this.getSuperFrontEndForward().getDocumentation(indent, lineLength);
686 }
687
688
689
690
691
692
693
694 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
695 {
696 return this.getSuperFrontEndForward().getDocumentation(indent, lineLength, htmlStyle);
697 }
698
699
700
701
702
703 public String getFullyQualifiedName()
704 {
705 return this.getSuperFrontEndForward().getFullyQualifiedName();
706 }
707
708
709
710
711
712
713
714
715 public String getFullyQualifiedName(boolean modelName)
716 {
717 return this.getSuperFrontEndForward().getFullyQualifiedName(modelName);
718 }
719
720
721
722
723
724
725 public String getFullyQualifiedNamePath()
726 {
727 return this.getSuperFrontEndForward().getFullyQualifiedNamePath();
728 }
729
730
731
732
733
734 public String getId()
735 {
736 return this.getSuperFrontEndForward().getId();
737 }
738
739
740
741
742
743
744
745
746
747 public Collection<String> getKeywords()
748 {
749 return this.getSuperFrontEndForward().getKeywords();
750 }
751
752
753
754
755
756 public String getLabel()
757 {
758 return this.getSuperFrontEndForward().getLabel();
759 }
760
761
762
763
764
765 public TypeMappings getLanguageMappings()
766 {
767 return this.getSuperFrontEndForward().getLanguageMappings();
768 }
769
770
771
772
773
774
775 public ModelFacade getModel()
776 {
777 return this.getSuperFrontEndForward().getModel();
778 }
779
780
781
782
783
784 public String getName()
785 {
786 return this.getSuperFrontEndForward().getName();
787 }
788
789
790
791
792
793 public ModelElementFacade getPackage()
794 {
795 return this.getSuperFrontEndForward().getPackage();
796 }
797
798
799
800
801
802 public String getPackageName()
803 {
804 return this.getSuperFrontEndForward().getPackageName();
805 }
806
807
808
809
810
811
812 public String getPackageName(boolean modelName)
813 {
814 return this.getSuperFrontEndForward().getPackageName(modelName);
815 }
816
817
818
819
820
821 public String getPackagePath()
822 {
823 return this.getSuperFrontEndForward().getPackagePath();
824 }
825
826
827
828
829
830
831
832
833 public String getQualifiedName()
834 {
835 return this.getSuperFrontEndForward().getQualifiedName();
836 }
837
838
839
840
841
842 public PackageFacade getRootPackage()
843 {
844 return this.getSuperFrontEndForward().getRootPackage();
845 }
846
847
848
849
850
851 public Collection<DependencyFacade> getSourceDependencies()
852 {
853 return this.getSuperFrontEndForward().getSourceDependencies();
854 }
855
856
857
858
859
860
861 public StateMachineFacade getStateMachineContext()
862 {
863 return this.getSuperFrontEndForward().getStateMachineContext();
864 }
865
866
867
868
869
870 public Collection<String> getStereotypeNames()
871 {
872 return this.getSuperFrontEndForward().getStereotypeNames();
873 }
874
875
876
877
878
879 public Collection<StereotypeFacade> getStereotypes()
880 {
881 return this.getSuperFrontEndForward().getStereotypes();
882 }
883
884
885
886
887
888 public Collection<TaggedValueFacade> getTaggedValues()
889 {
890 return this.getSuperFrontEndForward().getTaggedValues();
891 }
892
893
894
895
896
897 public Collection<DependencyFacade> getTargetDependencies()
898 {
899 return this.getSuperFrontEndForward().getTargetDependencies();
900 }
901
902
903
904
905
906 public Object getTemplateParameter(String parameterName)
907 {
908 return this.getSuperFrontEndForward().getTemplateParameter(parameterName);
909 }
910
911
912
913
914
915 public Collection<TemplateParameterFacade> getTemplateParameters()
916 {
917 return this.getSuperFrontEndForward().getTemplateParameters();
918 }
919
920
921
922
923
924
925 public String getVisibility()
926 {
927 return this.getSuperFrontEndForward().getVisibility();
928 }
929
930
931
932
933
934
935 public boolean hasExactStereotype(String stereotypeName)
936 {
937 return this.getSuperFrontEndForward().hasExactStereotype(stereotypeName);
938 }
939
940
941
942
943
944
945 public boolean hasKeyword(String keywordName)
946 {
947 return this.getSuperFrontEndForward().hasKeyword(keywordName);
948 }
949
950
951
952
953
954
955
956
957
958
959
960
961
962 public boolean hasStereotype(String stereotypeName)
963 {
964 return this.getSuperFrontEndForward().hasStereotype(stereotypeName);
965 }
966
967
968
969
970
971
972 public boolean isBindingDependenciesPresent()
973 {
974 return this.getSuperFrontEndForward().isBindingDependenciesPresent();
975 }
976
977
978
979
980
981 public boolean isConstraintsPresent()
982 {
983 return this.getSuperFrontEndForward().isConstraintsPresent();
984 }
985
986
987
988
989
990 public boolean isDocumentationPresent()
991 {
992 return this.getSuperFrontEndForward().isDocumentationPresent();
993 }
994
995
996
997
998
999 public boolean isReservedWord()
1000 {
1001 return this.getSuperFrontEndForward().isReservedWord();
1002 }
1003
1004
1005
1006
1007
1008
1009 public boolean isTemplateParametersPresent()
1010 {
1011 return this.getSuperFrontEndForward().isTemplateParametersPresent();
1012 }
1013
1014
1015
1016
1017
1018
1019
1020 public boolean isValidIdentifierName()
1021 {
1022 return this.getSuperFrontEndForward().isValidIdentifierName();
1023 }
1024
1025
1026
1027
1028
1029
1030
1031 public String translateConstraint(String name, String translation)
1032 {
1033 return this.getSuperFrontEndForward().translateConstraint(name, translation);
1034 }
1035
1036
1037
1038
1039
1040 public String[] translateConstraints(String translation)
1041 {
1042 return this.getSuperFrontEndForward().translateConstraints(translation);
1043 }
1044
1045
1046
1047
1048
1049 public String[] translateConstraints(String kind, String translation)
1050 {
1051 return this.getSuperFrontEndForward().translateConstraints(kind, translation);
1052 }
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064 public ActionFacade getEffect()
1065 {
1066 return this.getSuperFrontEndForward().getEffect();
1067 }
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077 public GuardFacade getGuard()
1078 {
1079 return this.getSuperFrontEndForward().getGuard();
1080 }
1081
1082
1083
1084
1085
1086
1087
1088 public StateVertexFacade getSource()
1089 {
1090 return this.getSuperFrontEndForward().getSource();
1091 }
1092
1093
1094
1095
1096
1097
1098
1099 public StateVertexFacade getTarget()
1100 {
1101 return this.getSuperFrontEndForward().getTarget();
1102 }
1103
1104
1105
1106
1107
1108 public EventFacade getTrigger()
1109 {
1110 return this.getSuperFrontEndForward().getTrigger();
1111 }
1112
1113
1114
1115
1116
1117
1118 public boolean isEnteringActionState()
1119 {
1120 return this.getSuperFrontEndForward().isEnteringActionState();
1121 }
1122
1123
1124
1125
1126
1127
1128 public boolean isEnteringDecisionPoint()
1129 {
1130 return this.getSuperFrontEndForward().isEnteringDecisionPoint();
1131 }
1132
1133
1134
1135
1136
1137
1138 public boolean isEnteringFinalState()
1139 {
1140 return this.getSuperFrontEndForward().isEnteringFinalState();
1141 }
1142
1143
1144
1145
1146
1147
1148 public boolean isExitingActionState()
1149 {
1150 return this.getSuperFrontEndForward().isExitingActionState();
1151 }
1152
1153
1154
1155
1156
1157
1158 public boolean isExitingDecisionPoint()
1159 {
1160 return this.getSuperFrontEndForward().isExitingDecisionPoint();
1161 }
1162
1163
1164
1165
1166
1167
1168 public boolean isExitingInitialState()
1169 {
1170 return this.getSuperFrontEndForward().isExitingInitialState();
1171 }
1172
1173
1174
1175
1176
1177 public boolean isTriggerPresent()
1178 {
1179 return this.getSuperFrontEndForward().isTriggerPresent();
1180 }
1181
1182
1183
1184
1185 @Override
1186 public void initialize()
1187 {
1188 this.getSuperFrontEndForward().initialize();
1189 }
1190
1191
1192
1193
1194
1195 @Override
1196 public Object getValidationOwner()
1197 {
1198 Object owner = this.getSuperFrontEndForward().getValidationOwner();
1199 return owner;
1200 }
1201
1202
1203
1204
1205
1206 @Override
1207 public String getValidationName()
1208 {
1209 String name = this.getSuperFrontEndForward().getValidationName();
1210 return name;
1211 }
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229 @Override
1230 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1231 {
1232 this.getSuperFrontEndForward().validateInvariants(validationMessages);
1233 try
1234 {
1235 final Object contextElement = this.THIS();
1236 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"enteringDecisionPoint"))).booleanValue()?(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"decisionTrigger"))&&OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"operationCall"))&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"operationCall.returnTypePresent"))).booleanValue()):true));
1237 if (!constraintValid)
1238 {
1239 validationMessages.add(
1240 new ModelValidationMessage(
1241 (MetafacadeBase)contextElement ,
1242 "org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::decision forwards need a controller operation with a non-void return type",
1243 "If a transition is going into a decision point you will need to defer to an operation with a non-void return type. You will need to model this on the transition's trigger."));
1244 }
1245 }
1246 catch (Throwable th)
1247 {
1248 Throwable cause = th.getCause();
1249 int depth = 0;
1250 while (cause != null && depth < 7)
1251 {
1252 th = cause;
1253 depth++;
1254 }
1255 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::decision forwards need a controller operation with a non-void return type' ON "
1256 + this.THIS().toString() + ": " + th.getMessage(), th);
1257 }
1258 try
1259 {
1260 final Object contextElement = this.THIS();
1261 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"exitingDecisionPoint"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"guardName")):true));
1262 if (!constraintValid)
1263 {
1264 validationMessages.add(
1265 new ModelValidationMessage(
1266 (MetafacadeBase)contextElement ,
1267 "org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::decision outcome needs a guard",
1268 "When a transition exits a decision point it needs a guard with a non-empty name."));
1269 }
1270 }
1271 catch (Throwable th)
1272 {
1273 Throwable cause = th.getCause();
1274 int depth = 0;
1275 while (cause != null && depth < 7)
1276 {
1277 th = cause;
1278 depth++;
1279 }
1280 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::decision outcome needs a guard' ON "
1281 + this.THIS().toString() + ": " + th.getMessage(), th);
1282 }
1283 try
1284 {
1285 final Object contextElement = this.THIS();
1286 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"operationCall"))&&OCLIntrospector.invoke(contextElement,"target") instanceof PseudostateFacade&&(Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"target.choice"))).booleanValue()||Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"target.junction"))).booleanValue()))).booleanValue()?Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"enteringDecisionPoint"))).booleanValue():true));
1287 if (!constraintValid)
1288 {
1289 validationMessages.add(
1290 new ModelValidationMessage(
1291 (MetafacadeBase)contextElement ,
1292 "org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::validate decision points",
1293 "Transitions carrying a controller call in their triggers need to target a decision point, this is a diamond shaped figure with 2 or more outgoing transitions."));
1294 }
1295 }
1296 catch (Throwable th)
1297 {
1298 Throwable cause = th.getCause();
1299 int depth = 0;
1300 while (cause != null && depth < 7)
1301 {
1302 th = cause;
1303 depth++;
1304 }
1305 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::validate decision points' ON "
1306 + this.THIS().toString() + ": " + th.getMessage(), th);
1307 }
1308 try
1309 {
1310 final Object contextElement = this.THIS();
1311 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"operationCall")))).booleanValue()?(OCLIntrospector.invoke(contextElement,"target") instanceof PseudostateFacade&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"target.decisionPoint"))).booleanValue()):true));
1312 if (!constraintValid)
1313 {
1314 validationMessages.add(
1315 new ModelValidationMessage(
1316 (MetafacadeBase)contextElement ,
1317 "org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::operation calls must target a decision point",
1318 "If you defer to an operation call on a transition, than that transition must target a decision point."));
1319 }
1320 }
1321 catch (Throwable th)
1322 {
1323 Throwable cause = th.getCause();
1324 int depth = 0;
1325 while (cause != null && depth < 7)
1326 {
1327 th = cause;
1328 depth++;
1329 }
1330 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsForward::operation calls must target a decision point' ON "
1331 + this.THIS().toString() + ": " + th.getMessage(), th);
1332 }
1333 }
1334
1335
1336
1337
1338 private static final String NAME_PROPERTY = "name";
1339 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1340
1341
1342
1343
1344 @Override
1345 public String toString()
1346 {
1347 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1348 toString.append("[");
1349 try
1350 {
1351 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1352 }
1353 catch (final Throwable tryAgain)
1354 {
1355 try
1356 {
1357 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1358 }
1359 catch (final Throwable ignore)
1360 {
1361
1362 }
1363 }
1364 toString.append("]");
1365 return toString.toString();
1366 }
1367 }