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