Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracuccuru2013-04-15 05:41:42 -0400
committeracuccuru2013-04-15 05:41:42 -0400
commit4d119c3a2e4c6667369a6a6d22f7cd3a17225c90 (patch)
tree0f82d52161ce6d4e6f143687e61b4de7759c8ada /sandbox
parent2d3b3760063be2fd7a8ec2b5f95f215169af4029 (diff)
downloadorg.eclipse.papyrus-4d119c3a2e4c6667369a6a6d22f7cd3a17225c90.tar.gz
org.eclipse.papyrus-4d119c3a2e4c6667369a6a6d22f7cd3a17225c90.tar.xz
org.eclipse.papyrus-4d119c3a2e4c6667369a6a6d22f7cd3a17225c90.zip
405391: [Moka] Moka shall provide an implementation of the fUML Execution Model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405391
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.classpath7
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.project28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/META-INF/MANIFEST.MF17
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/OSGI-INF/l10n/bundle.properties3
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/about.html28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/build.properties8
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.pdoc4
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.xml33
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/resources/fUML_Library.uml914
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/Activator.java64
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardLibraryRegistry.java131
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardServicesRegistry.java64
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/And.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Implies.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Not.java46
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Or.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToBoolean.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToString.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Xor.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Abs.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Add.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Div.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Greater.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/GreaterOrEqual.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Lower.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/LowerOrEqual.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Max.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Min.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Minus.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Mod.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Neg.java46
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Times.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToInteger.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToString.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToUnlimitedNatural.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardInputChannelImpl.java93
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardOutputChannelImpl.java121
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListConcat.java44
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListGet.java46
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListSize.java46
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Concat.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Size.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Substring.java54
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Greater.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/GreaterOrEqual.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Lower.java49
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/LowerOrEqual.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Max.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Min.java55
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToInteger.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToString.java50
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToUnlimitedNatural.java59
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/.classpath8
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/.project28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/META-INF/MANIFEST.MF36
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/about.html28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/build.properties12
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/ActionActivation.java376
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallActionActivation.java107
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallBehaviorActionActivation.java43
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallOperationActionActivation.java36
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InputPinActivation.java39
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InvocationActionActivation.java17
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/OutputPinActivation.java91
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/PinActivation.java78
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/SendSignalActionActivation.java50
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionActivation.java150
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionEventAccepter.java38
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadExtentActionActivation.java45
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadIsClassifiedObjectActionActivation.java72
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReclassifyObjectActionActivation.java95
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReduceActionActivation.java97
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartClassifierBehaviorActionActivation.java41
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartObjectBehaviorActionActivation.java75
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/AddStructuralFeatureValueActionActivation.java123
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearAssociationActionActivation.java41
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearStructuralFeatureActionActivation.java57
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateLinkActionActivation.java85
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateObjectActionActivation.java32
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyLinkActionActivation.java97
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyObjectActionActivation.java101
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/LinkActionActivation.java70
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadLinkActionActivation.java81
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadSelfActionActivation.java35
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadStructuralFeatureActionActivation.java56
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/RemoveStructuralFeatureValueActionActivation.java119
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/StructuralFeatureActionActivation.java78
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/TestIdentityActionActivation.java34
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ValueSpecificationActionActivation.java29
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteLinkActionActivation.java17
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteStructuralFeatureActionActivation.java37
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ClauseActivation.java129
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ConditionalNodeActivation.java176
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/LoopNodeActivation.java256
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/StructuredActivityNodeActivation.java211
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/Values.java24
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionActivationGroup.java122
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionNodeActivation.java60
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionRegionActivation.java326
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/TokenSet.java27
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityEdgeInstance.java202
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityExecution.java89
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityFinalNodeActivation.java44
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivation.java353
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivationGroup.java313
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityParameterNodeActivation.java74
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlNodeActivation.java36
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlToken.java40
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/DecisionNodeActivation.java313
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/FlowFinalNodeActivation.java37
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkNodeActivation.java60
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkedToken.java72
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/InitialNodeActivation.java36
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/JoinNodeActivation.java28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/MergeNodeActivation.java17
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectNodeActivation.java130
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectToken.java48
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Offer.java84
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Token.java58
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/BooleanValue.java65
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/CompoundValue.java150
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DataValue.java49
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DispatchStrategy.java36
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/EnumerationValue.java80
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Evaluation.java33
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/ExtensionalValue.java43
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/FeatureValue.java105
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/InstanceValueEvaluation.java110
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/IntegerValue.java98
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Link.java141
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralBooleanEvaluation.java28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralEvaluation.java29
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralIntegerEvaluation.java28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralNullEvaluation.java23
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralRealEvaluation.java28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralStringEvaluation.java28
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralUnlimitedNaturalEvaluation.java29
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Object_.java130
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/PrimitiveValue.java39
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RealValue.java93
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RedefinitionBasedDispatchStrategy.java66
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Reference.java99
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StringValue.java58
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StructuredValue.java95
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/UnlimitedNaturalValue.java69
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Value.java92
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/Execution.java114
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/OpaqueBehaviorExecution.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/ParameterValue.java44
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ArrivalSignal.java17
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ClassifierBehaviorExecution.java86
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/EventAccepter.java21
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/FIFOGetNextEventStrategy.java25
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/GetNextEventStrategy.java26
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ObjectActivation.java187
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/SignalInstance.java47
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/ChoiceStrategy.java24
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/ExecutionFactory.java179
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/ExecutionFactoryL1.java55
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/Executor.java74
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/FirstChoiceStrategy.java22
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/Locus.java153
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/SemanticStrategy.java19
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL1/SemanticVisitor.java27
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL2/ExecutionFactoryL2.java139
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Loci/LociL3/ExecutionFactoryL3.java85
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/model/fUML_Semantics.uml12543
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/model/fUML_Syntax.uml2916
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/plugin.pdoc4
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/plugin.xml13
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/schema/org.eclipse.papyrus.moka.fuml.library.exsd102
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/schema/org.eclipse.papyrus.moka.fuml.services.exsd102
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/Activator.java68
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/FUMLExecutionEngine.java420
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/ControlDelegate.java105
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/Debug.java23
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/FumlThread.java45
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/debug/StackFrameManager.java69
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/FUMLPresentationUtils.java53
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaStackFrame_from_ActivityEdgeInstance.java38
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaStackFrame_from_ActivityNodeActivation.java35
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaStackFrame_from_UMLModelElement.java80
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaValue_for_fUML.java46
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaValue_from_FeatureValue.java90
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaValue_from_Value.java64
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaVariable_for_fUML.java26
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaVariable_from_ContextObject.java37
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaVariable_from_FeatureValue.java42
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/presentation/MokaVariable_from_Value.java36
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/AbstractOpaqueBehaviorExecutionRegistry.java74
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/AbstractSystemServicesRegistry.java117
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/DefaultSemanticStrategyRegistry.java33
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/IOpaqueBehaviorExecutionRegistry.java23
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/ISemanticStrategyRegistry.java23
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/ISystemServicesRegistry.java46
-rw-r--r--sandbox/Moka/org.eclipse.papyrus.moka.fuml/src/org/eclipse/papyrus/moka/fuml/registry/SystemServicesRegistryUtils.java47
198 files changed, 29926 insertions, 0 deletions
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.classpath b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.project b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.project
new file mode 100644
index 00000000000..edb97634bb9
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.moka.fuml.standardlibrary</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.settings/org.eclipse.jdt.core.prefs b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/META-INF/MANIFEST.MF b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..5dd94f03808
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.moka.fuml.standardlibrary;singleton:=true
+Bundle-Version: 0.10.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.moka.fuml.standardlibrary.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.moka.fuml;bundle-version="0.10.0",
+ org.eclipse.emf.common;bundle-version="2.9.0",
+ org.eclipse.uml2.uml;bundle-version="4.1.0",
+ org.eclipse.papyrus.uml.extensionpoints;bundle-version="0.10.0",
+ org.eclipse.emf;bundle-version="2.6.0",
+ org.eclipse.papyrus.moka;bundle-version="0.10.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/OSGI-INF/l10n/bundle.properties b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..e1eecea3d8a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.moka.fuml.standardlibrary
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Opaque Behavior Executions for fUML Library (Incubation) \ No newline at end of file
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/about.html b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/build.properties b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/build.properties
new file mode 100644
index 00000000000..76fb515e7d5
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ OSGI-INF/l10n/bundle.properties,\
+ OSGI-INF/,\
+ resources/
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.pdoc b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.pdoc
new file mode 100644
index 00000000000..93ce4eeb1f4
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="OpaqueBehaviorExecutions for the standard fUML library">
+ <referent firstName="Arnaud" lastName="Cuccuru" eMail="arnaud.cuccuru@cea.fr" currentCompany="CEA LIST"/>
+</doc:Documentation>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.xml b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.xml
new file mode 100644
index 00000000000..2e87f7a08a9
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/plugin.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.moka.fuml.library">
+ <library
+ class="org.eclipse.papyrus.moka.fuml.standardlibrary.StandardLibraryRegistry">
+ </library>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.uml.extensionpoints.UMLLibrary">
+ <library
+ description="Standard fUML Library"
+ name="FoundationalModelLibrary"
+ path="pathmap://PAPYRUS_fUML_LIBRARY/fUML_Library.uml"
+ provider="CEA LIST">
+ </library>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecore.uri_mapping">
+ <mapping
+ source="pathmap://PAPYRUS_fUML_LIBRARY/"
+ target="platform:/plugin/org.eclipse.papyrus.moka.fuml.standardlibrary/resources/">
+ </mapping>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.moka.fuml.services">
+ <services
+ class="org.eclipse.papyrus.moka.fuml.standardlibrary.StandardServicesRegistry">
+ </services>
+ </extension>
+
+</plugin>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/resources/fUML_Library.uml b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/resources/fUML_Library.uml
new file mode 100644
index 00000000000..752947c97b8
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/resources/fUML_Library.uml
@@ -0,0 +1,914 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_0" name="FoundationalModelLibrary">
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors" name="PrimitiveBehaviors">
+ <packageImport xmi:id="PrimitiveBehaviors-_packageImport.0">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors-IntegerFunctions" name="IntegerFunctions">
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-ToInteger" name="ToInteger" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ToInteger-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ToInteger-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-IntegerFunctions-ToInteger-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-lt" name="&lt;" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-lt-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-lt-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-lt-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-plus" name="+" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-plus-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-plus-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-plus-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-minus" name="-" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-minus-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-minus-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-minus-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-times" name="*" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-times-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-times-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-times-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-Div" name="Div" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Div-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Div-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Div-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-IntegerFunctions-Div-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-Neg" name="Neg" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Neg-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Neg-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-Mod" name="Mod" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Mod-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Mod-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Mod-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-Max" name="Max" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Max-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Max-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Max-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-Min" name="Min" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Min-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Min-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Min-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-Abs" name="Abs" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Abs-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-Abs-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-gt" name=">" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-gt-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-gt-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-gt-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-le" name="&lt;=" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-le-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-le-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-le-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-ge" name=">=" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ge-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ge-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ge-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-ToString" name="ToString" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ToString-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ToString-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-ToUnlimitedNatural" name="ToUnlimitedNatural" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ToUnlimitedNatural-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-IntegerFunctions-ToUnlimitedNatural-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-IntegerFunctions-ToUnlimitedNatural-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-IntegerFunctions-divide" name="/" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="rimitiveBehaviors-IntegerFunctions-divide-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="rimitiveBehaviors-IntegerFunctions-divide-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="rimitiveBehaviors-IntegerFunctions-divide-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-IntegerFunctions-divide-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors-RealFunctions" name="RealFunctions">
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-ToInteger" name="ToInteger" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ToInteger-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ToInteger-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-lt" name="&lt;" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-lt-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-lt-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-lt-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-plus" name="+" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-plus-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-plus-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-plus-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-minus" name="-" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-minus-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-minus-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-minus-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-times" name="*" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-times-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-times-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-times-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-divide" name="/" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-divide-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-divide-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-divide-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-RealFunctions-divide-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Neg" name="Neg" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Neg-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Neg-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Max" name="Max" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Max-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Max-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Max-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Min" name="Min" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Min-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Min-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Min-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Abs" name="Abs" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Abs-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Abs-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-gt" name=">" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-gt-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-gt-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-gt-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-le" name="&lt;=" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-le-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-le-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-le-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-ge" name=">=" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ge-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ge-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ge-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-ToString" name="ToString" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ToString-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ToString-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Floor" name="Floor" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Floor-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="_PrimitiveBehaviors-RealFunctions-Floor-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Floor-Round" name="Round" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Round-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Round-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-Inv" name="Inv" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Inv-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-Inv-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-RealFunctions-ToReal" name="ToReal" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ToReal-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-RealFunctions-ToReal-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-RealFunctions-ToReal-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions" name="UnlimitedNaturalFunctions">
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToUnlimitedNatural" name="ToUnlimitedNatural" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToUnlimitedNatural-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToUnlimitedNatural-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToUnlimitedNatural-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-lt" name="&lt;" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-lt-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-lt-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-lt-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Max" name="Max" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Max-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Max-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Max-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Min" name="Min" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Min-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Min-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-Min-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-gt" name=">" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-gt-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-gt-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-gt-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-le" name="&lt;=" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-le-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-le-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-le-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ge" name=">=" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ge-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ge-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ge-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToString" name="ToString" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToString-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToString-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToInteger" name="ToInteger" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToInteger-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToInteger-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-UnlimitedNaturalFunctions-ToInteger-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors-BooleanFunctions" name="BooleanFunctions">
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-ToBoolean" name="ToBoolean" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-ToBoolean-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-ToBoolean-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-BooleanFunctions-ToBoolean-result-_lowerValue"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-ToString" name="ToString" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-ToString-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-ToString-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-Or" name="Or" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Or-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Or-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Or-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-Xor" name="Xor" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Xor-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Xor-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Xor-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-And" name="And" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-And-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-And-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-And-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-Implies" name="Implies" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Implies-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Implies-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Implies-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-BooleanFunctions-Not" name="Not" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Not-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-BooleanFunctions-Not-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors-StringFunctions" name="StringFunctions">
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-StringFunctions-Size" name="Size" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Size-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Size-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-StringFunctions-Concat" name="Concat" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Concat-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Concat-y" name="y">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Concat-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-StringFunctions-Substring" name="Substring" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Substring-x" name="x">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Substring-lower" name="lower">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Substring-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-StringFunctions-Substring-result-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-StringFunctions-Substring-upper" name="upper">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="PrimitiveBehaviors-ListFunctions" name="ListFunctions">
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-ListFunctions-ListSize" name="ListSize" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListSize-list" name="list">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-ListFunctions-ListSize-list-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="PrimitiveBehaviors-ListFunctions-ListSize-list-_upperValue" value="*"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListSize-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-ListFunctions-ListGet" name="ListGet" isAbstract="true" isReentrant="false">
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListGet-list" name="list">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-ListFunctions-ListGet-list-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="PrimitiveBehaviors-ListFunctions-ListGet-list-_upperValue" value="*"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListGet-result" name="result" direction="return">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-ListFunctions-ListGet-result-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListGet-index" name="index">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ </packagedElement>
+ <packagedElement xmi:type="uml:FunctionBehavior" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat" name="ListConcat" isAbstract="true">
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-list1" name="list1">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-list1-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-list1-_upperValue" value="*"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-list2" name="list2">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-list2-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-list2-_upperValue" value="*"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-result" name="result" direction="return">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-result-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="PrimitiveBehaviors-ListFunctions-ListConcat-result-_upperValue" value="*"/>
+ </ownedParameter>
+ </packagedElement>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="BasicInputOutput" name="BasicInputOutput">
+ <packageImport xmi:id="BasicInputOutput-_packageImport.0" importedPackage="Common"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-Channel" name="Channel" isAbstract="true">
+ <ownedOperation xmi:id="BasicInputOutput-Channel-getName" name="getName" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-Channel-getName-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-Channel-open" name="open" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-Channel-open-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-Channel-open-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-Channel-close" name="close" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-Channel-close-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-Channel-close-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-Channel-isOpen" name="isOpen" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-Channel-isOpen-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-Channel-getStatus" name="getStatus" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-Channel-getStatus-ReturnResult" name="ReturnResult" type="Common-Status" direction="return"/>
+ </ownedOperation>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-InputChannel" name="InputChannel" isAbstract="true">
+ <generalization xmi:id="BasicInputOutput-InputChannel-_generalization.0" general="BasicInputOutput-Channel"/>
+ <ownedOperation xmi:id="BasicInputOutput-InputChannel-hasMore" name="hasMore" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-InputChannel-hasMore-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-InputChannel-read" name="read" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-InputChannel-read-value" name="value" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-InputChannel-read-value-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-InputChannel-read-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-InputChannel-read-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-InputChannel-peek" name="peek" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-InputChannel-peek-value" name="value" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-InputChannel-peek-value-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-InputChannel-peek-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-InputChannel-peek-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-OutputChannel" name="OutputChannel" isAbstract="true">
+ <generalization xmi:id="BasicInputOutput-OutputChannel-_generalization.0" general="BasicInputOutput-Channel"/>
+ <ownedOperation xmi:id="BasicInputOutput-OutputChannel-write" name="write" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-OutputChannel-write-value" name="value"/>
+ <ownedParameter xmi:id="BasicInputOutput-OutputChannel-write-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-OutputChannel-write-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-OutputChannel-isFull" name="isFull" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-OutputChannel-isFull-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ </ownedOperation>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-TextInputChannel" name="TextInputChannel" isAbstract="true">
+ <generalization xmi:id="BasicInputOutput-TextInputChannel-_generalization.0" general="BasicInputOutput-InputChannel"/>
+ <ownedOperation xmi:id="BasicInputOutput-TextInputChannel-readCharacter" name="readCharacter">
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readCharacter-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readCharacter-ReturnResult-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readCharacter-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readCharacter-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextInputChannel-peekCharacter" name="peekCharacter">
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-peekCharacter-OwnedParameter" name="OwnedParameter" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-peekCharacter-OwnedParameter-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-peekCharacter-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-peekCharacter-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextInputChannel-readLine" name="readLine">
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readLine-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readLine-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readLine-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextInputChannel-readInteger" name="readInteger">
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readInteger-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readInteger-ReturnResult-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readInteger-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readInteger-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextInputChannel-readBoolean" name="readBoolean">
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readBoolean-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readBoolean-ReturnResult-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readBoolean-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readBoolean-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextInputChannel-readUnlimitedNatural" name="readUnlimitedNatural">
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readUnlimitedNatural-ReturnResult" name="ReturnResult" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readUnlimitedNatural-ReturnResult-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextInputChannel-readUnlimitedNatural-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextInputChannel-readUnlimitedNatural-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-TextOutputChannel" name="TextOutputChannel" isAbstract="true">
+ <generalization xmi:id="BasicInputOutput-TextOutputChannel-_generalization.0" general="BasicInputOutput-OutputChannel"/>
+ <ownedOperation xmi:id="BasicInputOutput-TextOutputChannel-writeString" name="writeString">
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeString-value" name="value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeString-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextOutputChannel-writeString-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextOutputChannel-writeNewLine" name="writeNewLine" isAbstract="true">
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeNewLine-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextOutputChannel-writeNewLine-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextOutputChannel-writeLine" name="writeLine">
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeLine-value" name="value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeLine-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextOutputChannel-writeLine-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextOutputChannel-writeInteger" name="writeInteger">
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeInteger-value" name="value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeInteger-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextOutputChannel-writeInteger-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextOutputChannel-writeBoolean" name="writeBoolean">
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeBoolean-value" name="value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeBoolean-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextOutputChannel-writeBoolean-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-TextOutputChannel-writeUnlimitedNatural" name="writeUnlimitedNatural">
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeUnlimitedNatural-value" name="value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-TextOutputChannel-writeUnlimitedNatural-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-TextOutputChannel-writeUnlimitedNatural-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ </ownedOperation>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-StandardInputChannel" name="StandardInputChannel" isAbstract="true">
+ <generalization xmi:id="BasicInputOutput-StandardInputChannel-_generalization.0" general="BasicInputOutput-TextInputChannel"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-StandardOutputChannel" name="StandardOutputChannel" isAbstract="true">
+ <generalization xmi:id="BasicInputOutput-StandardOutputChannel-_generalization.0" general="BasicInputOutput-TextOutputChannel"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Activity" xmi:id="BasicInputOutput-WriteLine" name="WriteLine" isReentrant="false" node="BasicInputOutput-WriteLine-StandardOutputChannel BasicInputOutput-WriteLine-writeLine BasicInputOutput-WriteLine-value.1 BasicInputOutput-WriteLine-errorStatus.1">
+ <ownedParameter xmi:id="BasicInputOutput-WriteLine-value" name="value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-WriteLine-errorStatus" name="errorStatus" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ <edge xmi:type="uml:ObjectFlow" xmi:id="BasicInputOutput-WriteLine-_edge.0" source="BasicInputOutput-WriteLine-StandardOutputChannel-_result" target="BasicInputOutput-WriteLine-writeLine-_target">
+ <guard xmi:type="uml:OpaqueExpression" xmi:id="BasicInputOutput-WriteLine-_edge.0-_guard">
+ <body></body>
+ </guard>
+ <weight xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-_edge.0-_weight" value="1"/>
+ </edge>
+ <edge xmi:type="uml:ObjectFlow" xmi:id="BasicInputOutput-WriteLine-_edge.1" source="BasicInputOutput-WriteLine-value.1" target="BasicInputOutput-WriteLine-writeLine-value">
+ <guard xmi:type="uml:OpaqueExpression" xmi:id="BasicInputOutput-WriteLine-_edge.1-_guard">
+ <body></body>
+ </guard>
+ <weight xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-_edge.1-_weight" value="1"/>
+ </edge>
+ <edge xmi:type="uml:ObjectFlow" xmi:id="BasicInputOutput-WriteLine-_edge.2" source="BasicInputOutput-WriteLine-writeLine-errorStatus" target="BasicInputOutput-WriteLine-errorStatus.1">
+ <guard xmi:type="uml:OpaqueExpression" xmi:id="BasicInputOutput-WriteLine-_edge.2-_guard">
+ <body></body>
+ </guard>
+ <weight xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-_edge.2-_weight" value="1"/>
+ </edge>
+ <node xmi:type="uml:ReadExtentAction" xmi:id="BasicInputOutput-WriteLine-StandardOutputChannel" name="StandardOutputChannel" classifier="BasicInputOutput-StandardOutputChannel">
+ <result xmi:id="BasicInputOutput-WriteLine-StandardOutputChannel-_result" outgoing="BasicInputOutput-WriteLine-_edge.0" type="BasicInputOutput-StandardOutputChannel">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-StandardOutputChannel-_result-_upperBound" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-StandardOutputChannel-_result-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="BasicInputOutput-WriteLine-StandardOutputChannel-_result-_upperValue" value="*"/>
+ </result>
+ </node>
+ <node xmi:type="uml:CallOperationAction" xmi:id="BasicInputOutput-WriteLine-writeLine" name="writeLine" operation="BasicInputOutput-TextOutputChannel-writeLine">
+ <argument xmi:id="BasicInputOutput-WriteLine-writeLine-value" name="value" incoming="BasicInputOutput-WriteLine-_edge.1">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-writeLine-value-_upperBound" value="1"/>
+ </argument>
+ <result xmi:id="BasicInputOutput-WriteLine-writeLine-errorStatus" name="errorStatus" outgoing="BasicInputOutput-WriteLine-_edge.2" type="Common-Status">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-writeLine-errorStatus-_upperBound" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-writeLine-errorStatus-_lowerValue"/>
+ </result>
+ <target xmi:id="BasicInputOutput-WriteLine-writeLine-_target" incoming="BasicInputOutput-WriteLine-_edge.0" type="BasicInputOutput-TextOutputChannel">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-writeLine-_target-_upperBound" value="1"/>
+ </target>
+ </node>
+ <node xmi:type="uml:ActivityParameterNode" xmi:id="BasicInputOutput-WriteLine-value.1" name="value" outgoing="BasicInputOutput-WriteLine-_edge.1" parameter="BasicInputOutput-WriteLine-value">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-value.1-_upperBound" value="1"/>
+ </node>
+ <node xmi:type="uml:ActivityParameterNode" xmi:id="BasicInputOutput-WriteLine-errorStatus.1" name="errorStatus" incoming="BasicInputOutput-WriteLine-_edge.2" type="Common-Status" parameter="BasicInputOutput-WriteLine-errorStatus">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-WriteLine-errorStatus.1-_upperBound" value="1"/>
+ </node>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="BasicInputOutput-ActiveChannel" name="ActiveChannel" isAbstract="true" isActive="true">
+ <generalization xmi:id="BasicInputOutput-ActiveChannel-_generalization.0" general="BasicInputOutput-Channel"/>
+ <ownedOperation xmi:id="BasicInputOutput-ActiveChannel-register" name="register">
+ <ownedParameter xmi:id="BasicInputOutput-ActiveChannel-register-listener" name="listener" type="Common-Listener"/>
+ </ownedOperation>
+ <ownedOperation xmi:id="BasicInputOutput-ActiveChannel-unregister" name="unregister">
+ <ownedParameter xmi:id="BasicInputOutput-ActiveChannel-unregister-listener" name="listener" type="Common-Listener"/>
+ </ownedOperation>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Activity" xmi:id="BasicInputOutput-ReadLine" name="ReadLine" isReentrant="false" node="BasicInputOutput-ReadLine-StandardInputChannel BasicInputOutput-ReadLine-readLine BasicInputOutput-ReadLine-errorStatus.1 BasicInputOutput-ReadLine-result.1">
+ <ownedParameter xmi:id="BasicInputOutput-ReadLine-errorStatus" name="errorStatus" type="Common-Status" direction="out">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-errorStatus-_lowerValue"/>
+ </ownedParameter>
+ <ownedParameter xmi:id="BasicInputOutput-ReadLine-result" name="result" direction="return">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedParameter>
+ <edge xmi:type="uml:ObjectFlow" xmi:id="BasicInputOutput-ReadLine-_edge.0" source="BasicInputOutput-ReadLine-StandardInputChannel-_result" target="BasicInputOutput-ReadLine-readLine-_target">
+ <guard xmi:type="uml:OpaqueExpression" xmi:id="BasicInputOutput-ReadLine-_edge.0-_guard">
+ <body></body>
+ </guard>
+ <weight xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-_edge.0-_weight" value="1"/>
+ </edge>
+ <edge xmi:type="uml:ObjectFlow" xmi:id="BasicInputOutput-ReadLine-_edge.1" source="BasicInputOutput-ReadLine-readLine-errorStatus" target="BasicInputOutput-ReadLine-errorStatus.1">
+ <guard xmi:type="uml:OpaqueExpression" xmi:id="BasicInputOutput-ReadLine-_edge.1-_guard">
+ <body></body>
+ </guard>
+ <weight xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-_edge.1-_weight" value="1"/>
+ </edge>
+ <edge xmi:type="uml:ObjectFlow" xmi:id="BasicInputOutput-ReadLine-_edge.2" source="BasicInputOutput-ReadLine-readLine-_result.0" target="BasicInputOutput-ReadLine-result.1">
+ <guard xmi:type="uml:OpaqueExpression" xmi:id="BasicInputOutput-ReadLine-_edge.2-_guard">
+ <body></body>
+ </guard>
+ <weight xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-_edge.2-_weight" value="1"/>
+ </edge>
+ <node xmi:type="uml:ReadExtentAction" xmi:id="BasicInputOutput-ReadLine-StandardInputChannel" name="StandardInputChannel" classifier="BasicInputOutput-StandardInputChannel">
+ <result xmi:id="BasicInputOutput-ReadLine-StandardInputChannel-_result" outgoing="BasicInputOutput-ReadLine-_edge.0" type="BasicInputOutput-StandardInputChannel">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-StandardInputChannel-_result-_upperBound" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-StandardInputChannel-_result-_lowerValue"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="BasicInputOutput-ReadLine-StandardInputChannel-_result-_upperValue" value="*"/>
+ </result>
+ </node>
+ <node xmi:type="uml:CallOperationAction" xmi:id="BasicInputOutput-ReadLine-readLine" name="readLine" operation="BasicInputOutput-TextInputChannel-readLine">
+ <result xmi:id="BasicInputOutput-ReadLine-readLine-_result.0" outgoing="BasicInputOutput-ReadLine-_edge.2">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-readLine-_result.0-_upperBound" value="1"/>
+ </result>
+ <result xmi:id="BasicInputOutput-ReadLine-readLine-errorStatus" name="errorStatus" outgoing="BasicInputOutput-ReadLine-_edge.1" type="Common-Status">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-readLine-errorStatus-_upperBound" value="1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-readLine-errorStatus-_lowerValue"/>
+ </result>
+ <target xmi:id="BasicInputOutput-ReadLine-readLine-_target" incoming="BasicInputOutput-ReadLine-_edge.0" type="BasicInputOutput-TextInputChannel">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-readLine-_target-_upperBound" value="1"/>
+ </target>
+ </node>
+ <node xmi:type="uml:ActivityParameterNode" xmi:id="BasicInputOutput-ReadLine-errorStatus.1" name="errorStatus" incoming="BasicInputOutput-ReadLine-_edge.1" type="Common-Status" parameter="BasicInputOutput-ReadLine-errorStatus">
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-errorStatus.1-_upperBound" value="1"/>
+ </node>
+ <node xmi:type="uml:ActivityParameterNode" xmi:id="BasicInputOutput-ReadLine-result.1" name="result" incoming="BasicInputOutput-ReadLine-_edge.2" parameter="BasicInputOutput-ReadLine-result">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <upperBound xmi:type="uml:LiteralInteger" xmi:id="BasicInputOutput-ReadLine-result.1-_upperBound" value="1"/>
+ </node>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="Common" name="Common">
+ <packagedElement xmi:type="uml:Signal" xmi:id="Common-Notification" name="Notification">
+ <ownedAttribute xmi:id="Common-Notification-content" name="content" visibility="public">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="Common-Notification-content-_lowerValue"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="Common-Listener" name="Listener" isAbstract="true" isActive="true">
+ <ownedReception xmi:id="Common-Listener-_ownedReception.0" name="Notification" signal="Common-Notification"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:DataType" xmi:id="Common-Status" name="Status">
+ <ownedAttribute xmi:id="Common-Status-context" name="context" visibility="public">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="Common-Status-code" name="code">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="Common-Status-description" name="description">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedAttribute>
+ </packagedElement>
+ </packagedElement>
+</uml:Model>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/Activator.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/Activator.java
new file mode 100644
index 00000000000..a325c8dbd69
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/Activator.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.moka.fuml.standardlibrary"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardLibraryRegistry.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardLibraryRegistry.java
new file mode 100644
index 00000000000..1e33e2d378f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardLibraryRegistry.java
@@ -0,0 +1,131 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.registry.AbstractOpaqueBehaviorExecutionRegistry;
+
+
+public class StandardLibraryRegistry extends AbstractOpaqueBehaviorExecutionRegistry {
+
+ protected final static String FUML_LIBRARY_NAME = "FoundationalModelLibrary";
+
+ @Override
+ public void registerOpaqueBehaviorExecutions(Locus locus) {
+ this.locus = locus;
+ this.buildOpaqueBehaviorsMap(FUML_LIBRARY_NAME);
+ // TODO PrimitiveBehaviors package is implemented.
+ // BasicInputOutput is partially implemented
+ // Common needs to be implemented.
+ try {
+ // ////////////////////
+ // Integer functions
+ // Neg
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Neg(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::Neg");
+ // +
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Add(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::+");
+ // -
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Minus(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::-");
+ // *
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Times(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::*");
+ // Abs
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Abs(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::Abs");
+ // Div
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Div(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::Div");
+ // Mod
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Mod(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::Mod");
+ // Max
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Max(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::Max");
+ // Min
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Min(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::Min");
+ // <
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Lower(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::<");
+ // >
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.Greater(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::>");
+ // <=
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.LowerOrEqual(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::<=");
+ // >=
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.GreaterOrEqual(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::>=");
+ // ToString
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.ToString(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::ToString");
+ // ToUnlimitedNatural
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.ToUnlimitedNatural(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::ToUnlimitedNatural");
+ // ToInteger
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer.ToInteger(), "FoundationalModelLibrary::PrimitiveBehaviors::IntegerFunctions::ToInteger");
+ // '/' is missing TODO
+
+ // ////////////////////
+ // Unlimited natural functions
+ // >
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.Greater(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::>");
+ // >=
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.GreaterOrEqual(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::>=");
+ // <
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.Lower(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::<");
+ // <=
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.LowerOrEqual(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::<=");
+ // Max
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.Max(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::Max");
+ // Min
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.Min(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::Min");
+ // ToInteger
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.ToInteger(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::ToInteger");
+ // ToString
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.ToString(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::ToString");
+ // ToUnlimitedNatural
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural.ToUnlimitedNatural(), "FoundationalModelLibrary::PrimitiveBehaviors::UnlimitedNaturalFunctions::ToUnlimitedNatural");
+
+ // ////////////////////
+ // Boolean functions
+ // Or
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.Or(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::Or");
+ // Xor
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.Xor(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::Xor");
+ // And
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.And(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::And");
+ // Not
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.Not(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::Not");
+ // Implies
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.Implies(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::Implies");
+ // ToString
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.ToString(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::ToString");
+ // ToBoolean
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_.ToBoolean(), "FoundationalModelLibrary::PrimitiveBehaviors::BooleanFunctions::ToBoolean");
+ // ////////////////////
+ // String functions
+ // Concat
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.string.Concat(), "FoundationalModelLibrary::PrimitiveBehaviors::StringFunctions::Concat");
+ // Size
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.string.Size(), "FoundationalModelLibrary::PrimitiveBehaviors::StringFunctions::Size");
+ // Substring
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.string.Substring(), "FoundationalModelLibrary::PrimitiveBehaviors::StringFunctions::Substring");
+ // ////////////////////
+ // List functions
+ // ListSize
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.list.ListSize(), "FoundationalModelLibrary::PrimitiveBehaviors::ListFunctions::ListSize");
+ // ListGet
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.list.ListGet(), "FoundationalModelLibrary::PrimitiveBehaviors::ListFunctions::ListGet");
+ // ListConcat
+ this.registerOpaqueBehaviorExecution(new org.eclipse.papyrus.moka.fuml.standardlibrary.library.list.ListConcat(), "FoundationalModelLibrary::PrimitiveBehaviors::ListFunctions::ListConcat");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected void registerOpaqueBehaviorExecution(OpaqueBehaviorExecution behaviorExecution, String behaviorQualifiedName) {
+ behaviorExecution.types.add(this.opaqueBehaviorsMap.get(behaviorQualifiedName));
+ locus.factory.primitiveBehaviorPrototypes.add(behaviorExecution);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardServicesRegistry.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardServicesRegistry.java
new file mode 100644
index 00000000000..107652bc43d
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/StandardServicesRegistry.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.moka.fuml.standardlibrary;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.registry.AbstractSystemServicesRegistry;
+import org.eclipse.papyrus.moka.fuml.standardlibrary.library.io.StandardInputChannelImpl;
+import org.eclipse.papyrus.moka.fuml.standardlibrary.library.io.StandardOutputChannelImpl;
+import org.eclipse.uml2.uml.Class;
+
+/**
+ * Registers system services related to the foundational model library.
+ * This includes standard input/ouput channel services
+ *
+ */
+public class StandardServicesRegistry extends AbstractSystemServicesRegistry {
+
+ protected final static String FUML_LIBRARY_NAME = "FoundationalModelLibrary";
+ protected final static String STANDARD_INPUT_CHANNEL_SERVICE_NAME = "FoundationalModelLibrary::BasicInputOutput::StandardInputChannel" ;
+ protected final static String STANDARD_OUTPUT_CHANNEL_SERVICE_NAME = "FoundationalModelLibrary::BasicInputOutput::StandardOutputChannel" ;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.moka.fuml.registry.AbstractSystemServicesRegistry#instantiateServices()
+ */
+ @Override
+ public List<Object_> instantiateServices() {
+ List<String> serviceQualifiedNames = new ArrayList<String>() ;
+ serviceQualifiedNames.add(STANDARD_INPUT_CHANNEL_SERVICE_NAME) ;
+ serviceQualifiedNames.add(STANDARD_OUTPUT_CHANNEL_SERVICE_NAME) ;
+ return this.instantiateServices(FUML_LIBRARY_NAME, serviceQualifiedNames);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.moka.fuml.registry.AbstractSystemServicesRegistry#instantiateService(org.eclipse.uml2.uml.Class)
+ */
+ @Override
+ protected Object_ instantiateService(Class service) {
+ if (service.getQualifiedName().equals(STANDARD_INPUT_CHANNEL_SERVICE_NAME)) {
+ return new StandardInputChannelImpl(service) ;
+ }
+ else if (service.getQualifiedName().equals(STANDARD_OUTPUT_CHANNEL_SERVICE_NAME)) {
+ return new StandardOutputChannelImpl(service) ;
+ }
+ return null;
+ }
+
+
+
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/And.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/And.java
new file mode 100644
index 00000000000..02eaf8e7868
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/And.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class And extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Boolean x = ((BooleanValue)inputParameters.get(0).values.get(0)).value;
+ Boolean y = ((BooleanValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x && y;
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of And " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new And();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Implies.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Implies.java
new file mode 100644
index 00000000000..29508697cae
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Implies.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Implies extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Boolean x = ((BooleanValue)inputParameters.get(0).values.get(0)).value;
+ Boolean y = ((BooleanValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = (x && !y) ? false : true;
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Implies " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Implies();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Not.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Not.java
new file mode 100644
index 00000000000..74afc711eb0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Not.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Not extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Boolean x = ((BooleanValue)inputParameters.get(0).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = !x;
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Not " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Not();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Or.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Or.java
new file mode 100644
index 00000000000..ab5fc5623ea
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Or.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Or extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Boolean x = ((BooleanValue)inputParameters.get(0).values.get(0)).value;
+ Boolean y = ((BooleanValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x || y;
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Or " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Or();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToBoolean.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToBoolean.java
new file mode 100644
index 00000000000..d1757e0c10e
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToBoolean.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToBoolean extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ String x = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = new Boolean(x);
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToBoolean " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ToBoolean();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToString.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToString.java
new file mode 100644
index 00000000000..e136b70411c
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/ToString.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToString extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Boolean x = ((BooleanValue)inputParameters.get(0).values.get(0)).value;
+ StringValue result = new StringValue();
+ result.value = x.toString();
+ result.type = this.locus.factory.getBuiltInType("String"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToString " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ToString();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Xor.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Xor.java
new file mode 100644
index 00000000000..31492354ed0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/boolean_/Xor.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.boolean_;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Xor extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Boolean x = ((BooleanValue)inputParameters.get(0).values.get(0)).value;
+ Boolean y = ((BooleanValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x ^ y;
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Xor " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Xor();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Abs.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Abs.java
new file mode 100644
index 00000000000..d1c572e7b08
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Abs.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Abs extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = Math.abs(x);
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Abs " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ // ADDED:
+ return new Abs();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Add.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Add.java
new file mode 100644
index 00000000000..aa31380fcf5
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Add.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Add extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = x + y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of + " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Add();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Div.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Div.java
new file mode 100644
index 00000000000..54f53fb1107
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Div.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Div extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = x / y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Div " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Div();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Greater.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Greater.java
new file mode 100644
index 00000000000..8d03920de62
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Greater.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Greater extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x > y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of > " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Greater();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/GreaterOrEqual.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/GreaterOrEqual.java
new file mode 100644
index 00000000000..1192f6bdfed
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/GreaterOrEqual.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class GreaterOrEqual extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x >= y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of >= " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new GreaterOrEqual();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Lower.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Lower.java
new file mode 100644
index 00000000000..2be275a2c88
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Lower.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Lower extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x < y;
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of < " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Lower();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/LowerOrEqual.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/LowerOrEqual.java
new file mode 100644
index 00000000000..19f07bcf178
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/LowerOrEqual.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class LowerOrEqual extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x <= y;
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of <= " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new LowerOrEqual();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Max.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Max.java
new file mode 100644
index 00000000000..90ff6290be7
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Max.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Max extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = Math.max(x, y);
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Max " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Max();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Min.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Min.java
new file mode 100644
index 00000000000..8fdab6998af
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Min.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Min extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = Math.min(x, y);
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Min " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Min();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Minus.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Minus.java
new file mode 100644
index 00000000000..4c3d3fd54d8
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Minus.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Minus extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = x - y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of - " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ // ADDED:
+ return new Minus();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Mod.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Mod.java
new file mode 100644
index 00000000000..2b76ea081d3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Mod.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Mod extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = x % y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Mod " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ // ADDED
+ return new Mod();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Neg.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Neg.java
new file mode 100644
index 00000000000..524b04186e5
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Neg.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Neg extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = -x;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Neg " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Neg();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Times.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Times.java
new file mode 100644
index 00000000000..ac8108769c7
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/Times.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Times extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = x * y;
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of * " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Times();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToInteger.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToInteger.java
new file mode 100644
index 00000000000..97c505c9238
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToInteger.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToInteger extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ String x = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = new Integer(x);
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToInteger " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ // ADDED
+ return new ToInteger();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToString.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToString.java
new file mode 100644
index 00000000000..9a0b997bede
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToString.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToString extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ StringValue result = new StringValue();
+ result.value = x.toString();
+ result.type = this.locus.factory.getBuiltInType("String"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToString " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ // ADDED
+ return new ToString();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToUnlimitedNatural.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToUnlimitedNatural.java
new file mode 100644
index 00000000000..4d06c732a27
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/integer/ToUnlimitedNatural.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.integer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToUnlimitedNatural extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((IntegerValue)inputParameters.get(0).values.get(0)).value;
+ UnlimitedNaturalValue result = new UnlimitedNaturalValue();
+ result.value = x;
+ result.type = this.locus.factory.getBuiltInType("UnlimitedNatural"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToUnlimitedNatural " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ToUnlimitedNatural();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardInputChannelImpl.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardInputChannelImpl.java
new file mode 100644
index 00000000000..9d1fb711b12
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardInputChannelImpl.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.io;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.registry.SystemServicesRegistryUtils;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.OpaqueBehavior;
+import org.eclipse.uml2.uml.Operation;
+
+public class StandardInputChannelImpl extends Object_ {
+
+ protected static OpaqueBehavior readLineMethod ;
+ protected static BufferedReader bufferedReader ;
+
+ public StandardInputChannelImpl(Class service) {
+ super() ;
+ this.types.add(service) ;
+ }
+
+ @Override
+ public Execution dispatch(Operation operation) {
+ if (operation.getName().equals("readLine"))
+ return new ReadLineExecution(operation) ;
+ // TODO complete with other operations
+ return null ;
+ }
+
+ protected class ReadLineExecution extends OpaqueBehaviorExecution {
+
+ protected Operation operation ;
+
+ public ReadLineExecution(Operation operation) {
+ this.operation = operation ;
+ }
+
+ @Override
+ public Value new_() {
+ return new ReadLineExecution(operation) ;
+ }
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ // This implementation does not produce errorStatus information.
+ try {
+ if (bufferedReader == null)
+ bufferedReader = new BufferedReader(new InputStreamReader(System.in)) ;
+ String line = bufferedReader.readLine() ;
+ StringValue result = new StringValue() ;
+ result.value = "" + line ;
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of readLine " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Behavior getBehavior() {
+ if (readLineMethod == null) {
+ readLineMethod = SystemServicesRegistryUtils.getInstance().generateOpaqueBehaviorSignature(operation) ;
+ }
+ return readLineMethod ;
+ }
+
+ }
+
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardOutputChannelImpl.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardOutputChannelImpl.java
new file mode 100644
index 00000000000..709dd08c603
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/io/StandardOutputChannelImpl.java
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.io;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.registry.SystemServicesRegistryUtils;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.OpaqueBehavior;
+import org.eclipse.uml2.uml.Operation;
+
+public class StandardOutputChannelImpl extends Object_ {
+
+ protected static OpaqueBehavior writeLineMethod ;
+ protected static OpaqueBehavior writeMethod;
+
+ public StandardOutputChannelImpl(Class service) {
+ super() ;
+ this.types.add(service) ;
+ }
+
+ @Override
+ public Execution dispatch(Operation operation) {
+ if (operation.getName().equals("writeLine"))
+ return new WriteLineExecution(operation) ;
+ else if (operation.getName().equals("write"))
+ return new Write(operation) ;
+ // TODO complete with other operations
+ return null ;
+ }
+
+ protected class WriteLineExecution extends OpaqueBehaviorExecution {
+
+ protected Operation operation ;
+
+ public WriteLineExecution(Operation operation) {
+ this.operation = operation ;
+ }
+
+ @Override
+ public Value new_() {
+ return new WriteLineExecution(operation) ;
+ }
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ // Supposed to have only one input argument, corresponding to parameter 'value'
+ try {
+ String message = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ System.out.println(message);
+ // This implementation does not produce errorStatus information.
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of writeLine " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Behavior getBehavior() {
+ if (writeLineMethod == null) {
+ writeLineMethod = SystemServicesRegistryUtils.getInstance().generateOpaqueBehaviorSignature(operation) ;
+ }
+ return writeLineMethod ;
+ }
+
+ }
+
+ protected class Write extends OpaqueBehaviorExecution {
+
+ protected Operation operation ;
+
+ public Write(Operation operation) {
+ this.operation = operation ;
+ }
+
+ @Override
+ public Value new_() {
+ return new Write(operation) ;
+ }
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ // Supposed to have only one input argument, corresponding to parameter 'value'
+ try {
+ String message = inputParameters.get(0).values.get(0).toString();
+ System.out.print(message);
+ // This implementation does not produce errorStatus information.
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of write " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Behavior getBehavior() {
+ if (writeMethod == null) {
+ writeMethod = SystemServicesRegistryUtils.getInstance().generateOpaqueBehaviorSignature(operation) ;
+ }
+ return writeMethod ;
+ }
+
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListConcat.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListConcat.java
new file mode 100644
index 00000000000..1319e36888d
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListConcat.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.list;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ListConcat extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ List<Value> list1 = inputParameters.get(0).values;
+ List<Value> list2 = inputParameters.get(1).values;
+ List<Value> result = new ArrayList<Value>();
+ result.addAll(list1) ;
+ result.addAll(list2) ;
+ outputParameters.get(0).values = result;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ListConcat " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ListConcat();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListGet.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListGet.java
new file mode 100644
index 00000000000..bc9f72a1bfc
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListGet.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.list;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ListGet extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer index = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ List<Value> list = inputParameters.get(0).values; // CORRECTED "get(1)" to "get(0)"
+ List<Value> outputs = new ArrayList<Value>();
+ if (index > 0 && index <= list.size()) { // ADDED if statement
+ outputs.add(list.get(index - 1));
+ }
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ListGet " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ListGet();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListSize.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListSize.java
new file mode 100644
index 00000000000..30738745c9f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/list/ListSize.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.list;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ListSize extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ List<Value> list = inputParameters.get(0).values;
+ IntegerValue result = new IntegerValue();
+ result.value = list.size();
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ListSize " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ListSize();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Concat.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Concat.java
new file mode 100644
index 00000000000..16e655293a7
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Concat.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.string;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Concat extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ String x = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ String y = ((StringValue)inputParameters.get(1).values.get(0)).value;
+ StringValue result = new StringValue();
+ result.value = "" + x + y;
+ result.type = this.locus.factory.getBuiltInType("String"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Concat " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Concat();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Size.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Size.java
new file mode 100644
index 00000000000..e8aceb65221
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Size.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.string;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Size extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ String x = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ result.value = x.length();
+ result.type = this.locus.factory.getBuiltInType("Integer"); // ADDED
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Size " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Size();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Substring.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Substring.java
new file mode 100644
index 00000000000..24ee155d79a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/string/Substring.java
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.string;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Substring extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ String x = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ Integer lower = ((IntegerValue)inputParameters.get(1).values.get(0)).value;
+ Integer upper = ((IntegerValue)inputParameters.get(2).values.get(0)).value;
+
+ // ADDED if statement
+ List<Value> outputs = new ArrayList<Value>();
+ if (lower >= 1 && lower <= x.length() && upper >= 1 && upper <= x.length() && lower <= upper) {
+ StringValue result = new StringValue();
+ result.value = x.substring(lower-1, upper); // CHANGED "lower" to "lower-1"
+ result.type = this.locus.factory.getBuiltInType("String"); // ADDED
+ outputs.add(result);
+ }
+
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Substring " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Substring();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Greater.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Greater.java
new file mode 100644
index 00000000000..6c651efe6f3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Greater.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Greater extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((UnlimitedNaturalValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = y >= 0 && (x == -1 || x > y) ;
+ result.type = this.locus.factory.getBuiltInType("Boolean");
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of > " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Greater();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/GreaterOrEqual.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/GreaterOrEqual.java
new file mode 100644
index 00000000000..ae7b4d5f6df
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/GreaterOrEqual.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class GreaterOrEqual extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((UnlimitedNaturalValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x == y || x < 0 || y >=0 && x > y ;
+ result.type = this.locus.factory.getBuiltInType("Boolean");
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of >= " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new GreaterOrEqual();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Lower.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Lower.java
new file mode 100644
index 00000000000..0441efc2bb4
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Lower.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Lower extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((UnlimitedNaturalValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x >= 0 && (y < 0 || x < y);
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = this.locus.factory.getBuiltInType("Boolean"); // ADDED
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of < " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Lower();
+ }
+
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/LowerOrEqual.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/LowerOrEqual.java
new file mode 100644
index 00000000000..823042ef446
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/LowerOrEqual.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class LowerOrEqual extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((UnlimitedNaturalValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x == y || y < 0 || x >= 0 && x < y ;
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = this.locus.factory.getBuiltInType("Boolean");
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of <= " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new LowerOrEqual();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Max.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Max.java
new file mode 100644
index 00000000000..1759911fd2c
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Max.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Max extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((UnlimitedNaturalValue)inputParameters.get(1).values.get(0)).value;
+ UnlimitedNaturalValue result = new UnlimitedNaturalValue();
+ result.value = (x < 0 || y < 0) ? -1 : Math.max(x, y) ;
+ result.type = this.locus.factory.getBuiltInType("UnlimitedNatural") ;
+ List<Value> outputs = new ArrayList<Value>() ;
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Max " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Max();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Min.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Min.java
new file mode 100644
index 00000000000..590f15b2e04
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/Min.java
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class Min extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ Integer y = ((UnlimitedNaturalValue)inputParameters.get(1).values.get(0)).value;
+ UnlimitedNaturalValue result = new UnlimitedNaturalValue();
+ if (x < 0) {
+ result.value = y ;
+ }
+ else if (y < 0) {
+ result.value = x ;
+ }
+ else {
+ result.value = Math.min(x, y) ;
+ }
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = this.locus.factory.getBuiltInType("UnlimitedNatural");
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of Min " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new Min();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToInteger.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToInteger.java
new file mode 100644
index 00000000000..79ab93d916b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToInteger.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.IntegerValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToInteger extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ IntegerValue result = new IntegerValue();
+ if (x != 1)
+ result.value = new Integer(x);
+ result.type = this.locus.factory.getBuiltInType("Integer");
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToInteger " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ToInteger();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToString.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToString.java
new file mode 100644
index 00000000000..3b42aaa5309
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToString.java
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToString extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Integer x = ((UnlimitedNaturalValue)inputParameters.get(0).values.get(0)).value;
+ StringValue result = new StringValue();
+ if (x == -1)
+ result.value = "*" ;
+ else
+ result.value = x.toString();
+ result.type = this.locus.factory.getBuiltInType("String");
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToString " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ToString();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToUnlimitedNatural.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToUnlimitedNatural.java
new file mode 100644
index 00000000000..f2ceee0e414
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/unlimitednatural/ToUnlimitedNatural.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.unlimitednatural;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StringValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ToUnlimitedNatural extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ String x = ((StringValue)inputParameters.get(0).values.get(0)).value;
+ UnlimitedNaturalValue result = new UnlimitedNaturalValue();
+ Integer value = null ;
+ if (x.equals("*")) {
+ result.value = -1 ;
+ }
+ else {
+ try {
+ value = new Integer(x);
+ }
+ catch (NumberFormatException badFormat) {}
+ if (value != null && value >= 0) {
+ result.value = value ;
+ }
+ }
+ result.type = this.locus.factory.getBuiltInType("UnlimitedNatural");
+ List<Value> outputs = new ArrayList<Value>();
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Debug.println("An error occured during the execution of ToUnlimitedNatural " + e.getMessage());
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new ToUnlimitedNatural();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.classpath b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.classpath
new file mode 100644
index 00000000000..ec07c2d49d9
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="generated"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.project b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.project
new file mode 100644
index 00000000000..2e1c3b8286b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.moka.fuml</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.settings/org.eclipse.jdt.core.prefs b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/META-INF/MANIFEST.MF b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..71383e636d5
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/META-INF/MANIFEST.MF
@@ -0,0 +1,36 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.moka.fuml;singleton:=true
+Bundle-Version: 0.10.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.moka.fuml.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.uml.extensionpoints;bundle-version="0.10.0",
+ org.eclipse.emf;bundle-version="2.6.0",
+ org.eclipse.uml2.uml;bundle-version="4.1.0",
+ org.eclipse.papyrus.moka;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
+ org.eclipse.debug.core;bundle-version="3.8.0",
+ org.eclipse.papyrus.moka.ui;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.core;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.moka.fuml;uses:="org.eclipse.ui.plugin,org.osgi.framework",
+ org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions,
+ org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions,
+ org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions,
+ org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities,
+ org.eclipse.papyrus.moka.fuml.Semantics.Activities.ExtraStructuredActivities,
+ org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities,
+ org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel,
+ org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors,
+ org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications,
+ org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1,
+ org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL2,
+ org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL3,
+ org.eclipse.papyrus.moka.fuml.debug,
+ org.eclipse.papyrus.moka.fuml.registry
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/about.html b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/build.properties b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/build.properties
new file mode 100644
index 00000000000..a0d2dc54f65
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/build.properties
@@ -0,0 +1,12 @@
+source.. = src/, generated/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ build.properties,\
+ generated/,\
+ model/,\
+ schema/
+jre.compilation.profile = JavaSE-1.6
+src.includes = about.html
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/ActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/ActionActivation.java
new file mode 100644
index 00000000000..644aa86368d
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/ActionActivation.java
@@ -0,0 +1,376 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityEdgeInstance;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ControlToken;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ForkNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ObjectToken;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ConditionalNode;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.LiteralBoolean;
+import org.eclipse.uml2.uml.LoopNode;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Pin;
+import org.eclipse.uml2.uml.UMLFactory;
+
+public abstract class ActionActivation extends ActivityNodeActivation {
+
+ /*
+ * The activations of the pins owned by the action of this action
+ * activation.
+ */
+ public List<PinActivation> pinActivations = new ArrayList<PinActivation>();
+
+ /*
+ * Whether this action activation is already firing. This attribute is only
+ * used if the action for this action activation has isLocallyReentrant =
+ * false (the default). If isLocallyReentrant=true, then firing always just
+ * remains false.
+ */
+ public Boolean firing;
+
+ public void run() {
+ // Run this action activation and any outoging fork node attached to it.
+ super.run();
+ if(this.outgoingEdges.size() > 0) {
+ this.outgoingEdges.get(0).target.run();
+ }
+ this.firing = false;
+ }
+
+ public List<Token> takeOfferedTokens() {
+ // If the action is not locally reentrant, then mark this activation as
+ // firing.
+ // Take any incoming offers of control tokens, then concurrently fire
+ // all input pin activations.
+ // Note: This is included here to happen in the same isolation scope as
+ // the isReady test.
+ this.firing = !((Action)this.node).isLocallyReentrant();
+ List<Token> offeredTokens = new ArrayList<Token>();
+ List<ActivityEdgeInstance> incomingEdges = this.incomingEdges;
+ for(int i = 0; i < incomingEdges.size(); i++) {
+ ActivityEdgeInstance incomingEdge = incomingEdges.get(i);
+ List<Token> tokens = incomingEdge.takeOfferedTokens();
+ for(int j = 0; j < tokens.size(); j++) {
+ Token token = tokens.get(j);
+ token.withdraw();
+ offeredTokens.add(token);
+ }
+ }
+ Action action = (Action)(this.node);
+ // *** Fire all input pins concurrently. ***
+ List<InputPin> inputPins = getInputs(action); // CHANGED from: action.getInputs();
+ for(Iterator<InputPin> i = inputPins.iterator(); i.hasNext();) {
+ InputPin pin = i.next();
+ PinActivation pinActivation = this.getPinActivation(pin);
+ List<Token> tokens = pinActivation.takeOfferedTokens();
+ pinActivation.fire(tokens);
+ for(int j = 0; j < tokens.size(); j++) {
+ Token token = tokens.get(j);
+ offeredTokens.add(token);
+ }
+ }
+ return offeredTokens;
+ }
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Do the main action behavior then concurrently fire all output pin
+ // activations
+ // and offer a single control token. Then activate the action again,
+ // if it is still ready to fire and has at least one token actually
+ // being
+ // offered to it.
+ do {
+ Debug.println("[fire] Action " + this.node.getName() + "...");
+ Debug.println("[event] Fire activity=" + this.getActivityExecution().getBehavior().getName() + " action=" + this.node.getName());
+ this.doAction();
+ incomingTokens = this.completeAction();
+ } while(incomingTokens.size() > 0);
+ }
+
+ public void terminate() {
+ // Terminate this action activation and any outgoing fork node attached
+ // to it.
+ super.terminate();
+ if(this.outgoingEdges.size() > 0) {
+ this.outgoingEdges.get(0).target.terminate();
+ }
+ }
+
+ public List<Token> completeAction() {
+ // Concurrently fire all output pin activations and offer a single
+ // control token. Then check if the action should fire again
+ // and, if so, return additional incoming tokens for this.
+ this.sendOffers();
+ Debug.println("[fire] Checking if " + this.node.getName() + " should fire again...");
+ _beginIsolation();
+ List<Token> incomingTokens = new ArrayList<Token>();
+ this.firing = false;
+ if(this.isReady()) {
+ incomingTokens = this.takeOfferedTokens();
+ this.firing = this.isFiring() & incomingTokens.size() > 0;
+ }
+ _endIsolation();
+ return incomingTokens;
+ }
+
+ public Boolean isReady() {
+ // In addition to the default condition, check that, if the action has
+ // isLocallyReentrant=false, then the activation is not currently
+ // firing,
+ // and that the sources of all incoming edges (control flows) have
+ // offers and all input pin activations are ready.
+ // [This assumes that all edges directly incoming to the action are
+ // control flows.]
+ boolean ready = super.isReady() & (((Action)this.node).isLocallyReentrant() | !this.isFiring());
+ int i = 1;
+ while(ready & i <= this.incomingEdges.size()) {
+ ready = this.incomingEdges.get(i - 1).hasOffer();
+ i = i + 1;
+ }
+ List<InputPin> inputPins = getInputs((Action)this.node); // CHANGED from: ((Action)(this.node)).getInputs();
+ int j = 1;
+ while(ready & j <= inputPins.size()) {
+ ready = this.getPinActivation(inputPins.get(j - 1)).isReady();
+ j = j + 1;
+ }
+ return ready;
+ }
+
+ public Boolean isFiring() {
+ // Indicate whether this action activation is currently firing or not.
+ return this.firing == null? false: this.firing; // ADDED check for null
+ }
+
+ public abstract void doAction();
+
+ public void sendOffers() {
+ // Fire all output pins and send offers on all outgoing control flows.
+ Action action = (Action)(this.node);
+ // *** Send offers from all output pins concurrently. ***
+ List<OutputPin> outputPins = getOutputs(action); // CHANGED from: action.getOutputs();
+ for(Iterator<OutputPin> i = outputPins.iterator(); i.hasNext();) {
+ OutputPin outputPin = i.next();
+ PinActivation pinActivation = this.getPinActivation(outputPin);
+ pinActivation.sendUnofferedTokens();
+ }
+ // Send offers on all outgoing control flows.
+ if(this.outgoingEdges.size() > 0) {
+ List<Token> tokens = new ArrayList<Token>();
+ tokens.add(new ControlToken());
+ this.addTokens(tokens);
+ this.outgoingEdges.get(0).sendOffer(tokens);
+ }
+ }
+
+ public void createNodeActivations() {
+ // Create node activations for the input and output pins of the action
+ // for this activation.
+ // [Note: Pins are owned by their actions, not by the enclosing activity
+ // (or group), so they must be activated through the action activation.]
+ Action action = (Action)(this.node);
+ List<ActivityNode> inputPinNodes = new ArrayList<ActivityNode>();
+ List<InputPin> inputPins = getInputs(action); // CHANGED from: action.getInputs();
+ for(int i = 0; i < inputPins.size(); i++) {
+ InputPin inputPin = inputPins.get(i);
+ inputPinNodes.add(inputPin);
+ }
+ this.group.createNodeActivations(inputPinNodes);
+ for(int i = 0; i < inputPinNodes.size(); i++) {
+ ActivityNode node = inputPinNodes.get(i);
+ this.addPinActivation((PinActivation)(this.group.getNodeActivation(node)));
+ }
+ List<ActivityNode> outputPinNodes = new ArrayList<ActivityNode>();
+ List<OutputPin> outputPins = getOutputs(action); // CHANGED from: action.getOutputs();
+ for(int i = 0; i < outputPins.size(); i++) {
+ OutputPin outputPin = outputPins.get(i);
+ outputPinNodes.add(outputPin);
+ }
+ this.group.createNodeActivations(outputPinNodes);
+ for(int i = 0; i < outputPinNodes.size(); i++) {
+ ActivityNode node = outputPinNodes.get(i);
+ this.addPinActivation((PinActivation)(this.group.getNodeActivation(node)));
+ }
+ }
+
+ public void addOutgoingEdge(ActivityEdgeInstance edge) {
+ // If there are no outgoing activity edge instances, create a single
+ // activity edge instance with a fork node execution at the other end.
+ // Add the give edge to the fork node execution that is the target of
+ // the activity edge instance out of this action execution.
+ // [This assumes that all edges directly outgoing from the action are
+ // control flows, with an implicit fork for offers out of the action.]
+ ActivityNodeActivation forkNodeActivation;
+ if(this.outgoingEdges.size() == 0) {
+ forkNodeActivation = new ForkNodeActivation();
+ forkNodeActivation.running = false; // ADDED
+ ActivityEdgeInstance newEdge = new ActivityEdgeInstance();
+ super.addOutgoingEdge(newEdge);
+ forkNodeActivation.addIncomingEdge(newEdge);
+ } else {
+ forkNodeActivation = this.outgoingEdges.get(0).target;
+ }
+ forkNodeActivation.addOutgoingEdge(edge);
+ }
+
+ public void addPinActivation(PinActivation pinActivation) {
+ // Add a pin activation to this action activation.
+ this.pinActivations.add(pinActivation);
+ pinActivation.actionActivation = this;
+ }
+
+ public PinActivation getPinActivation(Pin pin) {
+ // Precondition: The given pin is owned by the action of the action
+ // activation.
+ // Return the pin activation corresponding to the given pin.
+ PinActivation pinActivation = null;
+ int i = 1;
+ while(pinActivation == null & i <= this.pinActivations.size()) {
+ PinActivation thisPinActivation = this.pinActivations.get(i - 1);
+ if(thisPinActivation.node == pin) {
+ pinActivation = thisPinActivation;
+ }
+ i = i + 1;
+ }
+ return pinActivation;
+ }
+
+ public void putToken(OutputPin pin, Value value) {
+ // Precondition: The action execution has fired and the given pin is
+ // owned by the action of the action execution.
+ // Place a token for the given value on the pin activation corresponding
+ // to the given output pin.
+ Debug.println("[putToken] node = " + this.node.getName());
+ ObjectToken token = new ObjectToken();
+ token.value = value;
+ PinActivation pinActivation = this.getPinActivation(pin);
+ pinActivation.addToken(token);
+ }
+
+ public void putTokens(OutputPin pin, List<Value> values) {
+ // Precondition: The action execution has fired and the given pin is
+ // owned by the action of the action execution.
+ // Place tokens for the given values on the pin activation corresponding
+ // to the given output pin.
+ // Debug.println("[putTokens] node = " + this.node.getName());
+ for(int i = 0; i < values.size(); i++) {
+ Value value = values.get(i);
+ this.putToken(pin, value);
+ }
+ }
+
+ public List<Value> getTokens(InputPin pin) {
+ // Precondition: The action execution has fired and the given pin is
+ // owned by the action of the action execution.
+ // Get any tokens held by the pin activation corresponding to the given
+ // input pin and return them
+ // (but leave the tokens on the pin).
+ Debug.println("[getTokens] node = " + this.node.getName() + ", pin = " + pin.getName());
+ PinActivation pinActivation = this.getPinActivation(pin);
+ List<Token> tokens = pinActivation.getUnofferedTokens();
+ List<Value> values = new ArrayList<Value>();
+ for(int i = 0; i < tokens.size(); i++) {
+ Token token = tokens.get(i);
+ Value value = ((ObjectToken)token).value;
+ if(value != null) {
+ values.add(value);
+ }
+ }
+ return values;
+ }
+
+ public List<Value> takeTokens(InputPin pin) {
+ // Precondition: The action execution has fired and the given pin is
+ // owned by the action of the action execution.
+ // Take any tokens held by the pin activation corresponding to the given
+ // input pin and return them.
+ Debug.println("[takeTokens] node = " + this.node.getName() + ", pin = " + pin.getName());
+ PinActivation pinActivation = this.getPinActivation(pin);
+ List<Token> tokens = pinActivation.takeUnofferedTokens();
+ List<Value> values = new ArrayList<Value>();
+ for(int i = 0; i < tokens.size(); i++) {
+ Token token = tokens.get(i);
+ Value value = ((ObjectToken)token).value;
+ if(value != null) {
+ values.add(value);
+ }
+ }
+ return values;
+ }
+
+ public Boolean isSourceFor(ActivityEdgeInstance edgeInstance) {
+ // If this action has an outgoing fork node, check that the fork node is
+ // the source of the given edge instance.
+ boolean isSource = false;
+ if(this.outgoingEdges.size() > 0) {
+ isSource = this.outgoingEdges.get(0).target.isSourceFor(edgeInstance);
+ }
+ return isSource;
+ }
+
+ public Boolean valueParticipatesInLink(Value value, Link link) {
+ // Test if the given value participates in the given link.
+ List<FeatureValue> linkFeatureValues = link.getFeatureValues();
+ boolean participates = false;
+ int i = 1;
+ while(!participates & i <= linkFeatureValues.size()) {
+ participates = linkFeatureValues.get(i - 1).values.get(0).equals(value);
+ i = i + 1;
+ }
+ return participates;
+ }
+
+ public BooleanValue makeBooleanValue(Boolean value) {
+ // Make a Boolean value using the built-in Boolean primitive type.
+ // [This ensures that Boolean values created internally are the same as
+ // the default used for evaluating Boolean literals.]
+ LiteralBoolean booleanLiteral = UMLFactory.eINSTANCE.createLiteralBoolean();
+ booleanLiteral.setValue(value);
+ return (BooleanValue)(this.getExecutionLocus().executor.evaluate(booleanLiteral));
+ }
+
+ // ADDED:
+ protected static List<InputPin> getInputs(Action action) {
+ return action instanceof LoopNode? ((LoopNode)action).getLoopVariableInputs():
+ action.getInputs();
+ }
+
+ protected static List<OutputPin> getOutputs(Action action) {
+ return action instanceof LoopNode? ((LoopNode)action).getResults():
+ action instanceof ConditionalNode? ((ConditionalNode)action).getResults():
+ action.getOutputs();
+ }
+ //
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallActionActivation.java
new file mode 100644
index 00000000000..46742380c67
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallActionActivation.java
@@ -0,0 +1,107 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.uml2.uml.CallAction;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+
+public abstract class CallActionActivation extends InvocationActionActivation {
+
+ /*
+ * The set of execution object for currently ongoing calls made through this
+ * call action activation.
+ */
+ public List<Execution> callExecutions = new ArrayList<Execution>();
+
+ public void doAction() {
+ // Get the call execution object, set its input parameters from the
+ // argument pins and execute it.
+ // Once execution completes, copy the values of the output parameters of
+ // the call execution to the result pins of the call action execution,
+ // then destroy the execution.
+ Execution callExecution = this.getCallExecution();
+ if(callExecution != null) {
+ this.callExecutions.add(callExecution);
+ CallAction callAction = (CallAction)(this.node);
+ List<InputPin> argumentPins = callAction.getArguments();
+ List<OutputPin> resultPins = callAction.getResults();
+ List<Parameter> parameters = callExecution.getBehavior().getOwnedParameters();
+ int pinNumber = 1;
+ int i = 1;
+ while(i <= parameters.size()) {
+ Parameter parameter = parameters.get(i - 1);
+ if(parameter.getDirection() == ParameterDirectionKind.IN_LITERAL | parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) {
+ ParameterValue parameterValue = new ParameterValue();
+ parameterValue.parameter = parameter;
+ parameterValue.values = this.takeTokens(argumentPins.get(pinNumber - 1));
+ callExecution.setParameterValue(parameterValue);
+ pinNumber = pinNumber + 1;
+ }
+ i = i + 1;
+ }
+ callExecution.execute();
+ List<ParameterValue> outputParameterValues = callExecution.getOutputParameterValues();
+ pinNumber = 1;
+ i = 1;
+ while(i <= parameters.size()) {
+ Parameter parameter = parameters.get(i - 1);
+ if((parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.OUT_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL)) {
+ for(int j = 0; j < outputParameterValues.size(); j++) {
+ ParameterValue outputParameterValue = outputParameterValues.get(j);
+ if(outputParameterValue.parameter == parameter) {
+ OutputPin resultPin = resultPins.get(pinNumber - 1);
+ this.putTokens(resultPin, outputParameterValue.values);
+ }
+ }
+ pinNumber = pinNumber + 1;
+ }
+ i = i + 1;
+ }
+ callExecution.destroy();
+ this.removeCallExecution(callExecution);
+ }
+ }
+
+ public abstract Execution getCallExecution();
+
+ public void terminate() {
+ // Terminate all call executions (if any), then terminate the call
+ // action activation (self).
+ for(int i = 0; i < this.callExecutions.size(); i++) {
+ Execution execution = this.callExecutions.get(i);
+ execution.terminate();
+ }
+ super.terminate();
+ }
+
+ public void removeCallExecution(Execution execution) {
+ // Remove the given execution from the current list of call executions.
+ boolean notFound = true;
+ int i = 1;
+ while(notFound & i <= this.callExecutions.size()) {
+ if(this.callExecutions.get(i - 1) == execution) {
+ this.callExecutions.remove(i - 1);
+ notFound = false;
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallBehaviorActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallBehaviorActionActivation.java
new file mode 100644
index 00000000000..0b171b3b92f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallBehaviorActionActivation.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.CallBehaviorAction;
+
+public class CallBehaviorActionActivation extends CallActionActivation {
+
+ public Execution getCallExecution() {
+ // Create and execution for the given behavior at the current locus and
+ // return the resulting execution object.
+ // If the given behavior is in the context of a classifier, then pass
+ // the current context object as the context for the call.
+ // Otherwise, use a null context.
+ // [Note that this requires the behavior context to be compatible with
+ // the type of the current contect object.]
+ Behavior behavior = ((CallBehaviorAction)(this.node)).getBehavior();
+ Object_ context;
+ if(behavior.getContext() == null) {
+ context = null;
+ } else {
+ // Debug.println("[getCallExecution] behavior context = " +
+ // behavior.context.name);
+ context = this.getExecutionContext();
+ }
+ // Debug.println("[getCallExecution] context = " + context);
+ return this.getExecutionLocus().factory.createExecution(behavior, context);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallOperationActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallOperationActionActivation.java
new file mode 100644
index 00000000000..7140f7bab29
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/CallOperationActionActivation.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.uml2.uml.CallOperationAction;
+
+public class CallOperationActionActivation extends CallActionActivation {
+
+ public Execution getCallExecution() {
+ // If the value on the target input pin is a reference, dispatch the
+ // operation to it and return the resulting execution object.
+ CallOperationAction action = (CallOperationAction)(this.node);
+ Value target = this.takeTokens(action.getTarget()).get(0);
+ Execution execution;
+ if(target instanceof Reference) {
+ execution = ((Reference)target).dispatch(action.getOperation());
+ } else {
+ execution = null;
+ }
+ return execution;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InputPinActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InputPinActivation.java
new file mode 100644
index 00000000000..f639623f43a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InputPinActivation.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import org.eclipse.uml2.uml.Pin;
+
+public class InputPinActivation extends PinActivation {
+
+ public void receiveOffer() {
+ // Forward the offer to the action activation. [When all input pins are
+ // ready, the action will fire them.]
+ this.actionActivation.receiveOffer();
+ }
+
+ public Boolean isReady() {
+ // Return true if the total number of values already being offered by
+ // this pin plus those being offered
+ // by the sources of incoming edges is at least equal to the minimum
+ // multiplicity of the pin.
+ boolean ready = super.isReady();
+ if(ready) {
+ int totalValueCount = this.countUnofferedTokens() + this.countOfferedValues();
+ int minimum = ((Pin)this.node).getLower();
+ ready = totalValueCount >= minimum;
+ }
+ return ready;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InvocationActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InvocationActionActivation.java
new file mode 100644
index 00000000000..7d0c7af4940
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/InvocationActionActivation.java
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+public abstract class InvocationActionActivation extends ActionActivation {
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/OutputPinActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/OutputPinActivation.java
new file mode 100644
index 00000000000..42df9fb586a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/OutputPinActivation.java
@@ -0,0 +1,91 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import java.util.List;
+
+import org.eclipse.papyrus.infra.core.Activator;
+import org.eclipse.papyrus.moka.MokaConstants;
+import org.eclipse.papyrus.moka.communication.event.isuspendresume.Suspend_Event;
+import org.eclipse.papyrus.moka.debug.MokaStackFrame;
+import org.eclipse.papyrus.moka.debug.MokaThread;
+import org.eclipse.papyrus.moka.fuml.FUMLExecutionEngine;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.StackFrameManager;
+import org.eclipse.papyrus.moka.fuml.presentation.FUMLPresentationUtils;
+import org.eclipse.papyrus.moka.ui.presentation.AnimationUtils;
+import org.eclipse.uml2.uml.ActivityNode;
+
+public class OutputPinActivation extends PinActivation {
+
+ /**
+ * Overriding introduced to connect with the debug API
+ *
+ * (non-Javadoc)
+ * @see org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ObjectNodeActivation#sendOffers(java.util.List)
+ */
+ @Override
+ public void sendOffers(List<Token> tokens) {
+ // Connection with the debug api
+ Locus locus = this.getActivityExecution().locus ;
+ if (locus.isInDebugMode) {
+ this.incomingTokens_DEBUG = tokens ;
+ if (locus.engine.isTerminated())
+ return ;
+ boolean animationMarkerNeedsToBeRemoved = false ;
+ long date = 0 ;
+ if (MokaConstants.MOKA_AUTOMATIC_ANIMATION) {
+ date = System.currentTimeMillis() ;
+ AnimationUtils.getInstance().addAnimationMarker(node) ;
+ animationMarkerNeedsToBeRemoved = true ;
+ }
+ MokaStackFrame stackFrame = FUMLPresentationUtils.getMokaStackFrame(this) ;
+ stackFrame.setThread(locus.mainThread) ;
+ StackFrameManager.getInstance().setStackFrame(this.getActivityExecution(), stackFrame) ;
+ //locus.stackFrames = new MokaStackFrame[]{stackFrame} ;
+ int reasonForSuspending = FUMLExecutionEngine.controlDelegate.shallSuspend(this.getActivityExecution(), this) ;
+ if (reasonForSuspending != -1) {
+ locus.mainThread.setSuspended(true) ;
+ locus.mainThread.setStackFrames(null) ;
+ locus.stackFrames = StackFrameManager.getInstance().getStackFrames() ;
+ Suspend_Event breakpointEvent = new Suspend_Event(locus.mainThread, reasonForSuspending, new MokaThread[]{locus.mainThread}) ;
+ locus.engine.sendEvent(breakpointEvent) ;
+ try {
+ FUMLExecutionEngine.controlDelegate.suspend(this.getActivityExecution()) ;
+ } catch (InterruptedException e) {
+ Activator.log.error(e);
+ }
+ locus.mainThread.setSuspended(false) ;
+ }
+ if (animationMarkerNeedsToBeRemoved) {
+ try {
+ long ellapsed = System.currentTimeMillis() - date ;
+ long delay = Math.max(1,MokaConstants.MOKA_ANIMATION_DELAY - ellapsed) ;
+ Thread.sleep(delay) ;
+ } catch (InterruptedException e1) {
+ Activator.log.error(e1);
+ }
+ AnimationUtils.getInstance().removeAnimationMarker(node) ;
+ }
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // End: Connection with the debug api
+ super.sendOffers(tokens);
+ }
+
+
+
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/PinActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/PinActivation.java
new file mode 100644
index 00000000000..d7843599b65
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/PinActivation.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityEdgeInstance;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ObjectNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.uml2.uml.Pin;
+
+public abstract class PinActivation extends ObjectNodeActivation {
+
+ /*
+ * The activation of the action that owns the pin for this pin activation.
+ */
+ public ActionActivation actionActivation;
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Add all incoming tokens to the pin.
+ Debug.println("[fire] Pin " + (this.node == null ? "" : this.node.getName() + "..."));
+ this.addTokens(incomingTokens);
+ }
+
+ public List<Token> takeOfferedTokens() {
+ // Take only a number of tokens only up to the limit allowed by
+ // the multiplicity upper bound of the pin for this activation.
+ int count = this.countUnofferedTokens();
+ int upper = -1;
+ // Note: A pin activation used in an expansion activation group
+ // will have this.node == null.
+ if(this.node != null) {
+ upper = ((Pin)(this.node)).getUpper();
+ }
+ List<Token> tokens = new ArrayList<Token>();
+ // Note: upper < 0 indicates an unbounded upper multiplicity.
+ if(upper < 0 | count < upper) {
+ List<ActivityEdgeInstance> incomingEdges = this.incomingEdges;
+ for(int i = 0; i < incomingEdges.size(); i++) {
+ ActivityEdgeInstance edge = incomingEdges.get(i);
+ int incomingCount = edge.countOfferedValues();
+ List<Token> incomingTokens = new ArrayList<Token>();
+ if(upper < 0 | incomingCount < upper - count) {
+ incomingTokens = edge.takeOfferedTokens();
+ count = count + incomingCount;
+ } else if(count < upper) {
+ incomingTokens = edge.takeOfferedTokens(upper - count);
+ count = upper;
+ }
+ for(int j = 0; j < incomingTokens.size(); j++) {
+ Token token = incomingTokens.get(j);
+ tokens.add(token);
+ }
+ }
+ }
+ return tokens;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/SendSignalActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/SendSignalActionActivation.java
new file mode 100644
index 00000000000..335b0dec9b9
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/BasicActions/SendSignalActionActivation.java
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.SignalInstance;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.SendSignalAction;
+import org.eclipse.uml2.uml.Signal;
+
+public class SendSignalActionActivation extends InvocationActionActivation {
+
+ public void doAction() {
+ // Get the value from the target pin. If the value is not a reference,
+ // then do nothing.
+ // Otherwise, construct a signal using the values from the argument pins
+ // and send it to the referent object.
+ SendSignalAction action = (SendSignalAction)(this.node);
+ Value target = this.takeTokens(action.getTarget()).get(0);
+ if(target instanceof Reference) {
+ Signal signal = action.getSignal();
+ SignalInstance signalInstance = new SignalInstance();
+ signalInstance.type = signal;
+ List<Property> attributes = signal.getOwnedAttributes();
+ List<InputPin> argumentPins = action.getArguments();
+ for(int i = 0; i < attributes.size(); i++) {
+ Property attribute = attributes.get(i);
+ InputPin argumentPin = argumentPins.get(i);
+ List<Value> values = this.takeTokens(argumentPin);
+ signalInstance.setFeatureValue(attribute, values, 0);
+ }
+ ((Reference)target).send(signalInstance);
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionActivation.java
new file mode 100644
index 00000000000..d119f42db48
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionActivation.java
@@ -0,0 +1,150 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.SignalInstance;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.uml2.uml.AcceptEventAction;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Signal;
+import org.eclipse.uml2.uml.SignalEvent;
+import org.eclipse.uml2.uml.Trigger;
+
+public class AcceptEventActionActivation extends ActionActivation {
+
+ /*
+ * If the accept event action activation is waiting for an event, then this
+ * is the accepter it has registered for the event.
+ */
+ public AcceptEventActionEventAccepter eventAccepter;
+
+ public Boolean waiting;
+
+ public void run() {
+ // Create an event accepter and initialize waiting to false.
+ super.run();
+ this.eventAccepter = new AcceptEventActionEventAccepter();
+ this.eventAccepter.actionActivation = this;
+ this.waiting = false;
+ }
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Register the event accepter for this accept event action activation
+ // with the context object of the enclosing activity execution
+ // and wait for an event to be accepted.
+ Debug.println("[fire] Action " + this.node.getName() + "...");
+ this.getExecutionContext().register(this.eventAccepter);
+ this.waiting = true;
+ this.firing = false;
+ this.suspend();
+ }
+
+ public Boolean isReady() {
+ // An accept event action activiation is ready to fire only if it is not
+ // already waiting for an event.
+ boolean ready;
+ if(this.isWaiting()) { // CHANGED "this.waiting" to "this.isWaiting()".
+ ready = false;
+ } else {
+ ready = super.isReady();
+ }
+ return ready;
+ }
+
+ // ADDED:
+ public Boolean isWaiting() {
+ return this.waiting == null? false: this.waiting;
+ }
+ //
+
+ public void doAction() {
+ // Do nothing. [This will never be called.]
+ return;
+ }
+
+ public void accept(SignalInstance signalInstance) {
+ // Accept a signal occurance for the given signal instance.
+ // If the action does not unmarshall, then place the signal instance on
+ // the result pin, if any.
+ // If the action does unmarshall, then get the feature values of the
+ // signal instance, and place the values for each feature on the
+ // corresponding output pin.
+ // Concurrently fire all output pins while offering a single control
+ // token.
+ // If there are no incoming edges, then re-register this accept event
+ // action execution with the context object.
+ AcceptEventAction action = (AcceptEventAction)(this.node);
+ List<OutputPin> resultPins = action.getResults();
+ Debug.println("[accept] action = " + action.getName() + ", signalinstance = " + signalInstance);
+ if(this.running) {
+ if(!action.isUnmarshall()) {
+ List<Value> result = new ArrayList<Value>();
+ result.add(signalInstance);
+ if(resultPins.size() > 0) {
+ this.putTokens(resultPins.get(0), result);
+ }
+ } else {
+ List<FeatureValue> featureValues = signalInstance.getFeatureValues();
+ for(int i = 0; i < featureValues.size(); i++) {
+ FeatureValue featureValue = featureValues.get(i);
+ OutputPin resultPin = resultPins.get(i);
+ this.putTokens(resultPin, featureValue.values);
+ }
+ }
+ this.sendOffers();
+ this.waiting = false;
+ Debug.println("[fire] Checking if " + this.node.getName() + " should fire again...");
+ this.receiveOffer();
+ this.resume();
+ }
+ }
+
+ public Boolean match(SignalInstance signalInstance) {
+ // Return true if the given signal instance matches a trigger of the
+ // accept action of this activation.
+ AcceptEventAction action = (AcceptEventAction)(this.node);
+ List<Trigger> triggers = action.getTriggers();
+ Signal signal = signalInstance.type;
+ boolean matches = false;
+ int i = 1;
+ while(!matches & i <= triggers.size()) {
+ matches = ((SignalEvent)(triggers.get(i - 1).getEvent())).getSignal() == signal;
+ i = i + 1;
+ }
+ return matches;
+ }
+
+ public void terminate() {
+ // Terminate this action and unregister its event accepter.
+ super.terminate();
+ if(this.isWaiting()) { // CHANGED "this.waiting" to "this.isWaiting()".
+ this.getExecutionContext().unregister(this.eventAccepter);
+ this.waiting = false;
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionEventAccepter.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionEventAccepter.java
new file mode 100644
index 00000000000..36897d0a945
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/AcceptEventActionEventAccepter.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.EventAccepter;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.SignalInstance;
+
+public class AcceptEventActionEventAccepter extends EventAccepter {
+
+ /*
+ * The accept event action activation on behalf of which this event accepter
+ * is waiting.
+ */
+ public AcceptEventActionActivation actionActivation;
+
+ public void accept(SignalInstance signalInstance) {
+ // Accept a signal occurance for the given signal instance.
+ // Forward the signal occuranceto the action activation.
+ this.actionActivation.accept(signalInstance);
+ }
+
+ public Boolean match(SignalInstance signalInstance) {
+ // Return true if the given signal instance matches a trigger of the
+ // accept action of the action activation.
+ return this.actionActivation.match(signalInstance);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadExtentActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadExtentActionActivation.java
new file mode 100644
index 00000000000..81816936535
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadExtentActionActivation.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.ReadExtentAction;
+
+public class ReadExtentActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the extent, at the current execution locus, of the classifier
+ // (which must be a class) identified in the action.
+ // Place references to the resulting set of objects on the result pin.
+ ReadExtentAction action = (ReadExtentAction)(this.node);
+ List<ExtensionalValue> objects = this.getExecutionLocus().getExtent(action.getClassifier());
+ // Debug.println("[doAction] " + action.classifier.name + " has " +
+ // objects.size() + " instance(s).");
+ List<Value> references = new ArrayList<Value>();
+ for(int i = 0; i < objects.size(); i++) {
+ Value object = objects.get(i);
+ Reference reference = new Reference();
+ reference.referent = (Object_)object;
+ references.add(reference);
+ }
+ this.putTokens(action.getResult(), references);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadIsClassifiedObjectActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadIsClassifiedObjectActionActivation.java
new file mode 100644
index 00000000000..f52b719844f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReadIsClassifiedObjectActionActivation.java
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.ReadIsClassifiedObjectAction;
+
+public class ReadIsClassifiedObjectActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the value on the object input pin and determine if it is
+ // classified by the classifier specified in the action.
+ // If the isDirect attribute of the action is false, then place true on
+ // the result output pin if the input object has the specified
+ // classifier or of one its (direct or indirect) descendants as a type.
+ // If the isDirect attribute of the action is true, then place true on
+ // the result output pin if the input object has the specified
+ // classifier as a type.
+ // Otherwise place false on the result output pin.
+ ReadIsClassifiedObjectAction action = (ReadIsClassifiedObjectAction)(this.node);
+ Value input = this.takeTokens(action.getObject()).get(0);
+ List<Classifier> types = input.getTypes();
+ boolean result = false;
+ int i = 1;
+ while(!result & i <= types.size()) {
+ Classifier type = types.get(i - 1);
+ if(type == action.getClassifier()) {
+ result = true;
+ } else if(!action.isDirect()) {
+ result = this.checkAllParents(type, action.getClassifier());
+ }
+ i = i + 1;
+ }
+ List<Value> values = new ArrayList<Value>();
+ values.add(this.makeBooleanValue(result));
+ this.putTokens(action.getResult(), values);
+ }
+
+ public Boolean checkAllParents(Classifier type, Classifier classifier) {
+ // Check if the given classifier matches any of the direct or indirect
+ // ancestors of a given type.
+ List<Classifier> directParents = type.getGenerals();
+ boolean matched = false;
+ int i = 1;
+ while(!matched & i <= directParents.size()) {
+ Classifier directParent = directParents.get(i - 1);
+ if(directParent == classifier) {
+ matched = true;
+ } else {
+ matched = this.checkAllParents(directParent, classifier);
+ }
+ i = i + 1;
+ }
+ return matched;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReclassifyObjectActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReclassifyObjectActionActivation.java
new file mode 100644
index 00000000000..23c1a30498b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReclassifyObjectActionActivation.java
@@ -0,0 +1,95 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.ReclassifyObjectAction;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class ReclassifyObjectActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the value of the object input pin. If it is not a reference, then
+ // do nothing. Otherwise, do the following.
+ // Remove all types from the referent object that are in the set of old
+ // classifiers but not the set of new classifiers (or just all types
+ // that are not new classifiers, if isReplaceAll is true).
+ // Remove the feature values from the referent object for all
+ // classifiers that are removed.
+ // Add all new classifiers as types of the referent object that are not
+ // already types.
+ // Add (empty) feature values to the referent object for the structural
+ // features of all added classifiers.
+ ReclassifyObjectAction action = (ReclassifyObjectAction)(this.node);
+ List<Classifier> newClassifiers = action.getNewClassifiers();
+ List<Classifier> oldClassifiers = action.getOldClassifiers();
+ Value input = this.takeTokens(action.getObject()).get(0);
+ if(input instanceof Reference) {
+ Object_ object = ((Reference)input).referent;
+ int i = 1;
+ while(i <= object.types.size()) {
+ Class type = object.types.get(i - 1);
+ boolean toBeRemoved = true;
+ int j = 1;
+ while(toBeRemoved & j <= newClassifiers.size()) {
+ toBeRemoved = (type != newClassifiers.get(j - 1));
+ j = j + 1;
+ }
+ if(toBeRemoved & !action.isReplaceAll()) {
+ boolean notInOld = true;
+ int k = 1;
+ while(notInOld & k <= oldClassifiers.size()) {
+ notInOld = (type != oldClassifiers.get(k - 1));
+ k = k + 1;
+ }
+ toBeRemoved = !notInOld;
+ }
+ if(toBeRemoved) {
+ object.types.remove(i - 1);
+ object.removeFeatureValues(type);
+ } else {
+ i = i + 1;
+ }
+ }
+ for(int n = 0; n < newClassifiers.size(); n++) {
+ Classifier classifier = newClassifiers.get(n);
+ boolean toBeAdded = true;
+ int j = 1;
+ while(toBeAdded & j <= object.types.size()) {
+ toBeAdded = (classifier != object.types.get(j - 1));
+ j = j + 1;
+ }
+ if(toBeAdded) {
+ object.types.add((Class)classifier);
+ List<NamedElement> members = classifier.getMembers();
+ for(int k = 0; k < members.size(); k++) {
+ NamedElement member = members.get(k);
+ if(member instanceof StructuralFeature) {
+ object.setFeatureValue((StructuralFeature)member, new ArrayList<Value>(), 0);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReduceActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReduceActionActivation.java
new file mode 100644
index 00000000000..b1e5f26b486
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/ReduceActionActivation.java
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.ReduceAction;
+
+public class ReduceActionActivation extends ActionActivation {
+
+ /*
+ * The current execution of the reducer behavior.
+ */
+ public Execution currentExecution;
+
+ public void doAction() {
+ // Get the values of the collection input pin.
+ // If the input pin has no values, then do nothing. Otherwise, do the
+ // following.
+ // Repeatedly invoke the reducer behavior on successive pairs to reduce
+ // the collection to a single value, and place that value on the result
+ // pin.
+ // To invoke the reducer behavior, compile it to create an execution,
+ // make the execution the current execution, place the appropriate
+ // values on its input parameters, and execute it.
+ ReduceAction action = (ReduceAction)(this.node);
+ List<Value> values = this.takeTokens(action.getCollection());
+ if(values.size() > 0) {
+ List<Parameter> parameters = action.getReducer().getOwnedParameters();
+ Parameter input1 = null;
+ Parameter input2 = null;
+ Parameter output = null;
+ int i = 1;
+ while(i <= parameters.size()) {
+ Parameter parameter = parameters.get(i - 1);
+ if(parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) {
+ if(input1 == null) {
+ input1 = parameter;
+ } else {
+ input2 = parameter;
+ }
+ } else if(parameter.getDirection() == ParameterDirectionKind.OUT_LITERAL | parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL) {
+ output = parameter;
+ }
+ i = i + 1;
+ }
+ ParameterValue parameterValue1 = new ParameterValue();
+ parameterValue1.parameter = input1;
+ parameterValue1.values = new ArrayList<Value>();
+ parameterValue1.values.add(values.get(0));
+ int j = 2;
+ while(j <= values.size()) {
+ this.currentExecution = this.getExecutionLocus().factory.createExecution(action.getReducer(), this.getExecutionContext());
+ this.currentExecution.setParameterValue(parameterValue1);
+ ParameterValue parameterValue2 = new ParameterValue();
+ parameterValue2.parameter = input2;
+ parameterValue2.values = new ArrayList<Value>();
+ parameterValue2.values.add(values.get(j - 1));
+ this.currentExecution.setParameterValue(parameterValue2);
+ this.currentExecution.execute();
+ parameterValue1.values = this.currentExecution.getParameterValue(output).values;
+ j = j + 1;
+ if(parameterValue1.values.isEmpty() & j <= values.size()) {
+ parameterValue1.values.add(values.get(j - 1));
+ j = j + 1;
+ }
+ }
+ this.putTokens(action.getResult(), parameterValue1.values);
+ }
+ }
+
+ public void terminate() {
+ // If there is a current execution, terminate it. Then terminate self.
+ if(this.currentExecution != null) {
+ this.currentExecution.terminate();
+ }
+ super.terminate();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartClassifierBehaviorActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartClassifierBehaviorActionActivation.java
new file mode 100644
index 00000000000..6b362fb11cc
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartClassifierBehaviorActionActivation.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.StartClassifierBehaviorAction;
+
+public class StartClassifierBehaviorActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the value on the object input pin. If it is not a reference, then
+ // do nothing.
+ // Start the classifier behavior of the referent object for the
+ // classifier given as the type of the object input pin.
+ // If the object input pin has no type, then start the classifier
+ // behaviors of all types of the referent object. [The required behavior
+ // in this case is not clear from the spec.]
+ StartClassifierBehaviorAction action = (StartClassifierBehaviorAction)(this.node);
+ Value object = this.takeTokens(action.getObject()).get(0);
+ if(object instanceof Reference) {
+ ((Reference)object).startBehavior((Class)(action.getObject().getType()), new ArrayList<ParameterValue>());
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartObjectBehaviorActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartObjectBehaviorActionActivation.java
new file mode 100644
index 00000000000..750d241e74a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/CompleteActions/StartObjectBehaviorActionActivation.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.CompleteActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.InvocationActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.StartObjectBehaviorAction;
+
+public class StartObjectBehaviorActionActivation extends InvocationActionActivation {
+
+ public void doAction() {
+ // Get the value on the object input pin. If it is not a reference, then
+ // do nothing.
+ // Start the behavior of the referent object for the classifier given as
+ // the type of the object input pin, with parameter values taken from
+ // the argument input pins.
+ // If the object input pin has no type, then start the classifier
+ // behaviors of all types of the referent object.
+ StartObjectBehaviorAction action = (StartObjectBehaviorAction)(this.node);
+ Value object = this.takeTokens(action.getObject()).get(0);
+ if(object instanceof Reference) {
+ Class type = (Class)(action.getObject().getType());
+ List<InputPin> argumentPins = action.getArguments();
+ List<ParameterValue> inputs = new ArrayList<ParameterValue>();
+ if(type != null) {
+ Behavior behavior;
+ if(type instanceof Behavior) {
+ behavior = (Behavior)type;
+ } else {
+ behavior = type.getClassifierBehavior();
+ }
+ if(behavior != null) {
+ List<Parameter> parameters = behavior.getOwnedParameters();
+ int pinNumber = 1;
+ int i = 1;
+ while(i <= parameters.size()) {
+ Parameter parameter = parameters.get(i - 1);
+ int j = pinNumber;
+ if(parameter.getDirection() == ParameterDirectionKind.IN_LITERAL | parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) {
+ ParameterValue parameterValue = new ParameterValue();
+ parameterValue.parameter = parameter;
+ parameterValue.values = this.takeTokens(argumentPins.get(j - 1));
+ inputs.add(parameterValue);
+ j = j + 1;
+ }
+ pinNumber = j;
+ i = i + 1;
+ }
+ }
+ }
+ ((Reference)object).startBehavior(type, inputs);
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/AddStructuralFeatureValueActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/AddStructuralFeatureValueActionActivation.java
new file mode 100644
index 00000000000..c0a7580df04
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/AddStructuralFeatureValueActionActivation.java
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StructuredValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.ChoiceStrategy;
+import org.eclipse.uml2.uml.AddStructuralFeatureValueAction;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class AddStructuralFeatureValueActionActivation extends WriteStructuralFeatureActionActivation {
+
+ public void doAction() {
+ // Get the values of the object and value input pins.
+ // If the given feature is an association end, then create a link
+ // between the object and value inputs.
+ // Otherwise, if the object input is a structural value, then add a
+ // value to the values for the feature.
+ // If isReplaceAll is true, first remove all current matching links or
+ // feature values.
+ // If isReplaceAll is false and there is an insertAt pin, insert the
+ // value at the appropriate position.
+ AddStructuralFeatureValueAction action = (AddStructuralFeatureValueAction)(this.node);
+ StructuralFeature feature = action.getStructuralFeature();
+ Association association = this.getAssociation(feature);
+ Value value = this.takeTokens(action.getObject()).get(0);
+ List<Value> inputValues = this.takeTokens(action.getValue());
+ // NOTE: Multiplicity of the value input pin is required to be 1..1.
+ Value inputValue = inputValues.get(0);
+ int insertAt = 0;
+ if(action.getInsertAt() != null) {
+ insertAt = ((UnlimitedNaturalValue)this.takeTokens(action.getInsertAt()).get(0)).value;
+ }
+ if(association != null) {
+ List<Link> links = this.getMatchingLinks(association, feature, value);
+ Property oppositeEnd = this.getOppositeEnd(association, feature);
+ int position = 0;
+ if(oppositeEnd.isOrdered()) {
+ position = this.getMatchingLinks(association, oppositeEnd, inputValue).size() + 1;
+ }
+ if(action.isReplaceAll()) {
+ for(int i = 0; i < links.size(); i++) {
+ Link link = links.get(i);
+ link.destroy();
+ }
+ } else if(feature.isUnique()) {
+ int i = 1;
+ boolean destroyed = false;
+ while(!destroyed & i <= links.size()) {
+ Link link = links.get(i - 1);
+ FeatureValue featureValue = link.getFeatureValue(feature);
+ if(featureValue.values.get(0).equals(inputValue)) {
+ position = link.getFeatureValue(oppositeEnd).position;
+ link.destroy();
+ destroyed = true;
+ }
+ i = i + 1;
+ }
+ }
+ Link newLink = new Link();
+ newLink.type = association;
+ newLink.setFeatureValue(feature, inputValues, insertAt);
+ List<Value> oppositeValues = new ArrayList<Value>();
+ oppositeValues.add(value);
+ newLink.setFeatureValue(oppositeEnd, oppositeValues, position);
+ newLink.addTo(this.getExecutionLocus());
+ } else if(value instanceof StructuredValue) {
+ // If the value is a data value, then it must be copied before
+ // any change is made.
+ if(!(value instanceof Reference)) {
+ value = value.copy();
+ }
+ StructuredValue structuredValue = (StructuredValue)value;
+ if(action.isReplaceAll()) {
+ structuredValue.setFeatureValue(feature, inputValues, 0);
+ } else {
+ FeatureValue featureValue = structuredValue.getFeatureValue(feature);
+ if(featureValue.values.size() > 0 & insertAt == 0) {
+ // *** If there is no insertAt pin, then the structural
+ // feature must be unordered, and the insertion position is
+ // immaterial. ***
+ insertAt = ((ChoiceStrategy)this.getExecutionLocus().factory.getStrategy("choice")).choose(featureValue.values.size());
+ }
+ if(feature.isUnique()) {
+ // Remove any existing value that duplicates the input value
+ int j = position(inputValue, featureValue.values, 1);
+ if(j > 0) {
+ featureValue.values.remove(j - 1);
+ }
+ }
+ if(insertAt <= 0) { // Note: insertAt = -1 indicates an
+ // unlimited value of "*"
+ featureValue.values.add(inputValue);
+ } else {
+ featureValue.values.add(insertAt - 1, inputValue);
+ }
+ }
+ }
+ if(action.getResult() != null) {
+ this.putToken(action.getResult(), value);
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearAssociationActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearAssociationActionActivation.java
new file mode 100644
index 00000000000..f5e9a3dbff4
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearAssociationActionActivation.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.ClearAssociationAction;
+
+public class ClearAssociationActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the extent, at the current execution locus, of the given
+ // association.
+ // Read the object input pin. Destroy all links in which the object
+ // participates.
+ ClearAssociationAction action = (ClearAssociationAction)(this.node);
+ List<ExtensionalValue> extent = this.getExecutionLocus().getExtent(action.getAssociation());
+ Value objectValue = this.takeTokens(action.getObject()).get(0);
+ for(int i = 0; i < extent.size(); i++) {
+ Link link = (Link)(extent.get(i));
+ if(this.valueParticipatesInLink(objectValue, link)) {
+ link.destroy();
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearStructuralFeatureActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearStructuralFeatureActionActivation.java
new file mode 100644
index 00000000000..cc5d4495fdb
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ClearStructuralFeatureActionActivation.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StructuredValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.ClearStructuralFeatureAction;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class ClearStructuralFeatureActionActivation extends StructuralFeatureActionActivation {
+
+ public void doAction() {
+ // Get the value of the object input pin.
+ // If the given feature is an association end, then
+ // destroy all links that have the object input on the opposite end.
+ // Otherwise, if the object input is a structured value, then
+ // set the appropriate feature of the input value to be empty.
+ ClearStructuralFeatureAction action = (ClearStructuralFeatureAction)(this.node);
+ StructuralFeature feature = action.getStructuralFeature();
+ Association association = this.getAssociation(feature);
+ Value value = this.takeTokens(action.getObject()).get(0);
+ if(association != null) {
+ List<Link> links = this.getMatchingLinks(association, feature, value);
+ for(int i = 0; i < links.size(); i++) {
+ Link link = links.get(i);
+ link.destroy();
+ }
+ } else if(value instanceof StructuredValue) {
+ // If the value is a data value, then it must be copied before
+ // any change is made.
+ if(!(value instanceof Reference)) {
+ value = value.copy();
+ }
+ ((StructuredValue)value).setFeatureValue(action.getStructuralFeature(), new ArrayList<Value>(), 0);
+ }
+ if(action.getResult() != null) {
+ this.putToken(action.getResult(), value);
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateLinkActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateLinkActionActivation.java
new file mode 100644
index 00000000000..87ccf1d0ebc
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateLinkActionActivation.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.CreateLinkAction;
+import org.eclipse.uml2.uml.LinkEndCreationData;
+import org.eclipse.uml2.uml.LinkEndData;
+
+public class CreateLinkActionActivation extends WriteLinkActionActivation {
+
+ public void doAction() {
+ // If the association has any unique ends, then destroy an existing link
+ // that matches all ends of the link being created.
+ // Get the extent at the current execution locus of the association for
+ // which a link is being created.
+ // Destroy all links that have a value for any end for which
+ // isReplaceAll is true.
+ // Create a new link for the association, at the current locus, with the
+ // given end data values,
+ // inserted at the given insertAt position (for ordered ends).
+ CreateLinkAction action = (CreateLinkAction)(this.node);
+ List<LinkEndCreationData> endDataList = new ArrayList<LinkEndCreationData>();
+ for(LinkEndData data : action.getEndData()) {
+ endDataList.add((LinkEndCreationData)data);
+ }
+ Association linkAssociation = this.getAssociation();
+ List<ExtensionalValue> extent = this.getExecutionLocus().getExtent(linkAssociation);
+ boolean unique = false;
+ for(int i = 0; i < endDataList.size(); i++) {
+ if(endDataList.get(i).getEnd().isUnique()) {
+ unique = true;
+ }
+ }
+ for(int i = 0; i < extent.size(); i++) {
+ ExtensionalValue value = extent.get(i);
+ Link link = (Link)value;
+ boolean match = true;
+ boolean destroy = false;
+ int j = 1;
+ while(j <= endDataList.size()) {
+ LinkEndCreationData endData = endDataList.get(j - 1);
+ if(this.endMatchesEndData(link, endData)) {
+ if(endData.isReplaceAll()) {
+ destroy = true;
+ }
+ } else {
+ match = false;
+ }
+ j = j + 1;
+ }
+ if(destroy | unique & match) {
+ link.destroy();
+ }
+ }
+ Link newLink = new Link();
+ newLink.type = linkAssociation;
+ for(int i = 0; i < endDataList.size(); i++) {
+ LinkEndCreationData endData = endDataList.get(i);
+ int insertAt = 0;
+ if(endData.getInsertAt() != null) {
+ insertAt = ((UnlimitedNaturalValue)(this.takeTokens(endData.getInsertAt()).get(0))).value;
+ }
+ newLink.setFeatureValue(endData.getEnd(), this.takeTokens(endData.getValue()), insertAt);
+ }
+ newLink.addTo(this.getExecutionLocus());
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateObjectActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateObjectActionActivation.java
new file mode 100644
index 00000000000..1ae6eb53f76
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/CreateObjectActionActivation.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.CreateObjectAction;
+
+public class CreateObjectActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Create an object with the given classifier (which must be a class) as
+ // its type, at the same locus as the action activation.
+ // Place a reference to the object on the result pin of the action.
+ CreateObjectAction action = (CreateObjectAction)(this.node);
+ Reference reference = new Reference();
+ reference.referent = this.getExecutionLocus().instantiate((Class)(action.getClassifier()));
+ this.putToken(action.getResult(), reference);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyLinkActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyLinkActionActivation.java
new file mode 100644
index 00000000000..74ea5406bf0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyLinkActionActivation.java
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.ChoiceStrategy;
+import org.eclipse.uml2.uml.DestroyLinkAction;
+import org.eclipse.uml2.uml.LinkEndData;
+import org.eclipse.uml2.uml.LinkEndDestructionData;
+import org.eclipse.uml2.uml.Property;
+
+public class DestroyLinkActionActivation extends WriteLinkActionActivation {
+
+ public void doAction() {
+ // Get the extent, at the current execution locus, of the association
+ // for which links are being destroyed.
+ // Destroy all links that match the given link end destruction data.
+ // For unique ends, or non-unique ends for which isDestroyDuplicates is
+ // true, match links with a matching value for that end.
+ // For non-unique, ordered ends for which isDestroyDuplicates is false,
+ // match links with an end value at the given destroyAt position. [Must
+ // a value be given, too, in this case?]
+ // For non-unique, non-ordered ends for which isDestroyDuplicates is
+ // false, pick one matching link (if any) non-deterministically. [The
+ // semantics of this case is not clear from the current spec.]
+ Debug.println("[doAction] DestroyLinkAction...");
+ DestroyLinkAction action = (DestroyLinkAction)(this.node);
+ List<LinkEndDestructionData> destructionDataList = new ArrayList<LinkEndDestructionData>();
+ for(LinkEndData data : action.getEndData()) {
+ destructionDataList.add((LinkEndDestructionData)data);
+ }
+ Debug.println("[doAction] end data size = " + destructionDataList.size());
+ boolean destroyOnlyOne = false;
+ int j = 1;
+ while(!destroyOnlyOne & j <= destructionDataList.size()) {
+ LinkEndDestructionData endData = destructionDataList.get(j - 1);
+ destroyOnlyOne = !endData.getEnd().isUnique() & !endData.getEnd().isOrdered() & !endData.isDestroyDuplicates();
+ j = j + 1;
+ }
+ List<LinkEndData> endDataList = new ArrayList<LinkEndData>();
+ for(int i = 0; i < destructionDataList.size(); i++) {
+ LinkEndDestructionData endData = destructionDataList.get(i);
+ Debug.println("[doAction] Matching end = " + endData.getEnd().getName());
+ endDataList.add(endData);
+ }
+ List<ExtensionalValue> extent = this.getExecutionLocus().getExtent(this.getAssociation());
+ List<ExtensionalValue> matchingLinks = new ArrayList<ExtensionalValue>();
+ for(int i = 0; i < extent.size(); i++) {
+ ExtensionalValue value = extent.get(i);
+ Link link = (Link)value;
+ if(this.linkMatchesEndData(link, endDataList)) {
+ matchingLinks.add(link);
+ }
+ }
+ // Now that matching is done, ensure that all tokens on end data input
+ // pins
+ // are consumed.
+ for(int i = 0; i < destructionDataList.size(); i++) {
+ LinkEndDestructionData endData = destructionDataList.get(i);
+ Property end = endData.getEnd();
+ if(!endData.isDestroyDuplicates() & !end.isUnique() & end.isOrdered()) {
+ this.takeTokens(endData.getDestroyAt());
+ }
+ Debug.println("[doAction] Consuming tokens for end " + end.getName());
+ this.takeTokens(endData.getValue());
+ }
+ if(destroyOnlyOne) {
+ // *** If there is more than one matching link,
+ // non-deterministically choose one. ***
+ if(matchingLinks.size() > 0) {
+ int i = ((ChoiceStrategy)this.getExecutionLocus().factory.getStrategy("choice")).choose(matchingLinks.size());
+ matchingLinks.get(i - 1).destroy();
+ }
+ } else {
+ for(int i = 0; i < matchingLinks.size(); i++) {
+ ExtensionalValue matchingLink = matchingLinks.get(i);
+ matchingLink.destroy();
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyObjectActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyObjectActionActivation.java
new file mode 100644
index 00000000000..447ab45d7ea
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/DestroyObjectActionActivation.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.DestroyObjectAction;
+import org.eclipse.uml2.uml.Property;
+
+public class DestroyObjectActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the value on the target input pin.
+ // If the value is not a reference, then the action has no effect.
+ // Otherwise, do the following.
+ // If isDestroyLinks is true, destroy all links in which the referent
+ // participates.
+ // If isDestroyOwnedObjects is true, destroy all objects owned by the
+ // referent via composition links.
+ // Destroy the referent object.
+ DestroyObjectAction action = (DestroyObjectAction)(this.node);
+ Value value = this.takeTokens(action.getTarget()).get(0);
+ this.destroyObject(value, action.isDestroyLinks(), action.isDestroyOwnedObjects());
+ }
+
+ public void destroyObject(Value value, Boolean isDestroyLinks, Boolean isDestroyOwnedObjects) {
+ // If the given value is a reference, then destroy the referenced
+ // object, per the given destroy action attribute values.
+ // Debug.println("[destroyObject] object = " + value.objectId());
+ if(value instanceof Reference) {
+ Reference reference = (Reference)value;
+ if(isDestroyLinks | isDestroyOwnedObjects) {
+ Debug.println("[destroyObject] Destroying links...");
+ List<ExtensionalValue> extensionalValues = this.getExecutionLocus().extensionalValues;
+ for(int i = 0; i < extensionalValues.size(); i++) {
+ ExtensionalValue extensionalValue = extensionalValues.get(i);
+ if(extensionalValue instanceof Link) {
+ Link link = (Link)extensionalValue;
+ if(this.valueParticipatesInLink(reference, link)) {
+ if(isDestroyLinks | this.objectIsComposite(reference, link)) {
+ // Debug.println("[destroyObject] Destroying link "
+ // + link.objectId());
+ link.destroy();
+ }
+ }
+ }
+ }
+ }
+ if(isDestroyOwnedObjects) {
+ Debug.println("[destroyObject] Destroying owned objects...");
+ List<FeatureValue> objectFeatureValues = reference.getFeatureValues();
+ for(int i = 0; i < objectFeatureValues.size(); i++) {
+ FeatureValue featureValue = objectFeatureValues.get(i);
+ if(((Property)featureValue.feature).getAggregation() == AggregationKind.COMPOSITE_LITERAL) {
+ List<Value> values = featureValue.values;
+ for(int j = 0; j < values.size(); j++) {
+ Value ownedValue = values.get(j);
+ this.destroyObject(ownedValue, isDestroyLinks, isDestroyOwnedObjects);
+ }
+ }
+ }
+ }
+ reference.destroy();
+ }
+ }
+
+ public Boolean objectIsComposite(Reference reference, Link link) {
+ // Test whether the given reference participates in the given link as a
+ // composite.
+ List<FeatureValue> linkFeatureValues = link.getFeatureValues();
+ boolean isComposite = false;
+ int i = 1;
+ while(!isComposite & i <= linkFeatureValues.size()) {
+ FeatureValue featureValue = linkFeatureValues.get(i - 1);
+ if(!featureValue.values.get(0).equals(reference) & ((Property)featureValue.feature).getAggregation() == AggregationKind.COMPOSITE_LITERAL) {
+ isComposite = true;
+ }
+ i = i + 1;
+ }
+ return isComposite;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/LinkActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/LinkActionActivation.java
new file mode 100644
index 00000000000..76c21d9b291
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/LinkActionActivation.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.LinkAction;
+import org.eclipse.uml2.uml.LinkEndData;
+import org.eclipse.uml2.uml.LinkEndDestructionData;
+import org.eclipse.uml2.uml.Property;
+
+public abstract class LinkActionActivation extends ActionActivation {
+
+ public Boolean linkMatchesEndData(Link link, List<LinkEndData> endDataList) {
+ // Test whether the given link matches the given end data.
+ boolean matches = true;
+ int i = 1;
+ while(matches & i <= endDataList.size()) {
+ matches = this.endMatchesEndData(link, endDataList.get(i - 1));
+ i = i + 1;
+ }
+ return matches;
+ }
+
+ public Boolean endMatchesEndData(Link link, LinkEndData endData) {
+ // Test whether the appropriate end of the given link matches the given
+ // end data.
+ boolean matches = false;
+ if(endData.getValue() == null) {
+ matches = true;
+ } else {
+ Property end = endData.getEnd();
+ FeatureValue linkFeatureValue = link.getFeatureValue(end);
+ Value endValue = this.getTokens(endData.getValue()).get(0);
+ if(endData instanceof LinkEndDestructionData) {
+ if(!((LinkEndDestructionData)endData).isDestroyDuplicates() & !end.isUnique() & end.isOrdered()) {
+ int destroyAt = ((UnlimitedNaturalValue)(this.getTokens(((LinkEndDestructionData)endData).getDestroyAt()).get(0))).value;
+ matches = linkFeatureValue.values.get(0).equals(endValue) && linkFeatureValue.position == destroyAt;
+ } else {
+ matches = linkFeatureValue.values.get(0).equals(endValue);
+ }
+ } else {
+ matches = linkFeatureValue.values.get(0).equals(endValue);
+ }
+ }
+ return matches;
+ }
+
+ public Association getAssociation() {
+ // Get the association for the link action of this activation.
+ return (Association)(((LinkAction)(this.node)).getEndData().get(0).getEnd().getAssociation());
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadLinkActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadLinkActionActivation.java
new file mode 100644
index 00000000000..ec446580068
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadLinkActionActivation.java
@@ -0,0 +1,81 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.uml2.uml.LinkEndData;
+import org.eclipse.uml2.uml.ReadLinkAction;
+
+public class ReadLinkActionActivation extends LinkActionActivation {
+
+ public void doAction() {
+ // Get the extent, at the current execution locus, of the association to
+ // which the action applies.
+ // For all links that match the link end data, place the value of the
+ // remaining "open" end on the result pin.
+ ReadLinkAction action = (ReadLinkAction)(this.node);
+ List<LinkEndData> endDataList = action.getEndData();
+ LinkEndData openEnd = null;
+ int i = 1;
+ while((openEnd == null) & i <= endDataList.size()) {
+ if(endDataList.get(i - 1).getValue() == null) {
+ openEnd = endDataList.get(i - 1);
+ }
+ i = i + 1;
+ }
+ List<ExtensionalValue> extent = this.getExecutionLocus().getExtent(this.getAssociation());
+ List<FeatureValue> featureValues = new ArrayList<FeatureValue>();
+ for(int j = 0; j < extent.size(); j++) {
+ ExtensionalValue value = extent.get(j);
+ Link link = (Link)value;
+ if(this.linkMatchesEndData(link, endDataList)) {
+ FeatureValue featureValue = link.getFeatureValue(openEnd.getEnd());
+ if(!openEnd.getEnd().isOrdered() | featureValues.size() == 0) {
+ featureValues.add(featureValue);
+ } else {
+ int n = featureValue.position;
+ boolean continueSearching = true;
+ int k = 0;
+ while(continueSearching & k < featureValues.size()) {
+ k = k + 1;
+ continueSearching = featureValues.get(k - 1).position < n;
+ }
+ if(continueSearching) {
+ featureValues.add(featureValue);
+ } else {
+ featureValues.add(k - 1, featureValue);
+ }
+ }
+ }
+ }
+ for(int j = 0; j < featureValues.size(); j++) {
+ FeatureValue featureValue = featureValues.get(j);
+ this.putToken(action.getResult(), featureValue.values.get(0));
+ }
+ // Now that matching is done, ensure that all tokens on end data input
+ // pins
+ // are consumed.
+ for(int k = 0; k < endDataList.size(); k++) {
+ LinkEndData endData = endDataList.get(k);
+ if(endData.getValue() != null) {
+ this.takeTokens(endData.getValue());
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadSelfActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadSelfActionActivation.java
new file mode 100644
index 00000000000..6d1ca769e17
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadSelfActionActivation.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.ReadSelfAction;
+
+public class ReadSelfActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the context object of the activity execution containing this
+ // action activation and place a reference to it on the result output
+ // pin.
+ // Debug.println("[ReadSelfActionActivation] Start...");
+ Reference context = new Reference();
+ context.referent = this.getExecutionContext();
+ // Debug.println("[ReadSelfActionActivation] context object = " +
+ // context.referent);
+ OutputPin resultPin = ((ReadSelfAction)(this.node)).getResult();
+ this.putToken(resultPin, context);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadStructuralFeatureActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadStructuralFeatureActionActivation.java
new file mode 100644
index 00000000000..0fe5c25a91b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ReadStructuralFeatureActionActivation.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StructuredValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.ReadStructuralFeatureAction;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class ReadStructuralFeatureActionActivation extends StructuralFeatureActionActivation {
+
+ public void doAction() {
+ // Get the value of the object input pin.
+ // If the given feature is an association end, then get all values of
+ // the that end.
+ // for which the opposite end has the object input value and place them
+ // on the result pin.
+ // Otherwise, if the object input value is a structural value, then get
+ // the values
+ // of the appropriate feature of the input value and place them on the
+ // result output pin.
+ ReadStructuralFeatureAction action = (ReadStructuralFeatureAction)(this.node);
+ StructuralFeature feature = action.getStructuralFeature();
+ Association association = this.getAssociation(feature);
+ Value value = this.takeTokens(action.getObject()).get(0);
+ List<Value> resultValues = new ArrayList<Value>();
+ if(association != null) {
+ List<Link> links = this.getMatchingLinks(association, feature, value);
+ for(int i = 0; i < links.size(); i++) {
+ Link link = links.get(i);
+ resultValues.add(link.getFeatureValue(feature).values.get(0));
+ }
+ } else if(value instanceof StructuredValue) {
+ // Debug.println("[ReadStructuralFeatureActionActivation] value = "
+ // + value +", structural feature = " + feature.name);
+ resultValues = ((StructuredValue)value).getFeatureValue(feature).values;
+ }
+ this.putTokens(action.getResult(), resultValues);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/RemoveStructuralFeatureValueActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/RemoveStructuralFeatureValueActionActivation.java
new file mode 100644
index 00000000000..96dbc0c031e
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/RemoveStructuralFeatureValueActionActivation.java
@@ -0,0 +1,119 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.FeatureValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Reference;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.StructuredValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.UnlimitedNaturalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.ChoiceStrategy;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.RemoveStructuralFeatureValueAction;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class RemoveStructuralFeatureValueActionActivation extends WriteStructuralFeatureActionActivation {
+
+ public void doAction() {
+ // Get the values of the object and value input pins.
+ // If the given feature is an association end, then destroy any matching
+ // links.
+ // Otherwise, if the object input is a structural value, remove values
+ // from the given feature.
+ // If isRemoveDuplicates is true, then destroy all current matching
+ // links or remove all values equal to the input value.
+ // If isRemoveDuplicates is false and there is no removeAt input pin,
+ // remove any one feature value equal to the input value (if there are
+ // any that are equal).
+ // If isRemoveDuplicates is false, and there is a removeAt input pin
+ // remove the feature value at that position.
+ RemoveStructuralFeatureValueAction action = (RemoveStructuralFeatureValueAction)(this.node);
+ StructuralFeature feature = action.getStructuralFeature();
+ Association association = this.getAssociation(feature);
+ Value value = this.takeTokens(action.getObject()).get(0);
+ Value inputValue = null;
+ if(action.getValue() != null) {
+ // NOTE: Multiplicity of the value input pin is required to be 1..1.
+ inputValue = this.takeTokens(action.getValue()).get(0);
+ }
+ int removeAt = 0;
+ if(action.getRemoveAt() != null) {
+ removeAt = ((UnlimitedNaturalValue)this.takeTokens(action.getRemoveAt()).get(0)).value;
+ }
+ if(association != null) {
+ List<Link> links = this.getMatchingLinks(association, feature, value);
+ if(action.isRemoveDuplicates()) {
+ for(int i = 0; i < links.size(); i++) {
+ Link link = links.get(i);
+ link.destroy();
+ }
+ } else if(action.getRemoveAt() == null) {
+ // *** If there is more than one matching link,
+ // non-deterministically choose one. ***
+ if(links.size() > 0) {
+ int i = ((ChoiceStrategy)this.getExecutionLocus().factory.getStrategy("choice")).choose(links.size());
+ links.get(i - 1).destroy();
+ }
+ } else {
+ boolean notFound = true;
+ int i = 1;
+ while(notFound & i < links.size()) {
+ Link link = links.get(i - 1);
+ if(link.getFeatureValue(feature).position == removeAt) {
+ notFound = false;
+ link.destroy();
+ }
+ }
+ }
+ } else if(value instanceof StructuredValue) {
+ // If the value is a data value, then it must be copied before
+ // any change is made.
+ if(!(value instanceof Reference)) {
+ value = value.copy();
+ }
+ FeatureValue featureValue = ((StructuredValue)value).getFeatureValue(action.getStructuralFeature());
+ if(action.isRemoveDuplicates()) {
+ int j = this.position(inputValue, featureValue.values, 1);
+ while(j > 0) {
+ featureValue.values.remove(j - 1);
+ j = this.position(inputValue, featureValue.values, j);
+ }
+ } else if(action.getRemoveAt() == null) {
+ List<Integer> positions = new ArrayList<Integer>();
+ int j = this.position(inputValue, featureValue.values, 1);
+ while(j > 0) {
+ positions.add(j);
+ j = this.position(inputValue, featureValue.values, j);
+ }
+ if(positions.size() > 0) {
+ // *** Nondeterministically choose which value to remove.
+ // ***
+ int k = ((ChoiceStrategy)this.getExecutionLocus().factory.getStrategy("choice")).choose(positions.size());
+ featureValue.values.remove(positions.get(k - 1) - 1);
+ }
+ } else {
+ if(featureValue.values.size() >= removeAt) {
+ featureValue.values.remove(removeAt - 1);
+ }
+ }
+ }
+ if(action.getResult() != null) {
+ this.putToken(action.getResult(), value);
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/StructuralFeatureActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/StructuralFeatureActionActivation.java
new file mode 100644
index 00000000000..9922b44c7a6
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/StructuralFeatureActionActivation.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.ExtensionalValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Link;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public abstract class StructuralFeatureActionActivation extends ActionActivation {
+
+ public Association getAssociation(StructuralFeature feature) {
+ // If the structural feature for the action of this activation is an
+ // association end,
+ // then get the associated association.
+ Association association = null;
+ if(feature instanceof Property) {
+ association = ((Property)feature).getAssociation();
+ }
+ return association;
+ }
+
+ public List<Link> getMatchingLinks(Association association, StructuralFeature end, Value oppositeValue) {
+ // Get the links of the given binary association whose end opposite
+ // to the given end has the given value
+ Property oppositeEnd = this.getOppositeEnd(association, end);
+ List<ExtensionalValue> extent = this.getExecutionLocus().getExtent(association);
+ List<Link> links = new ArrayList<Link>();
+ for(int i = 0; i < extent.size(); i++) {
+ ExtensionalValue link = extent.get(i);
+ if(link.getFeatureValue(oppositeEnd).values.get(0).equals(oppositeValue)) {
+ if(!end.isOrdered() | links.size() == 0) {
+ links.add((Link)link);
+ } else {
+ int n = link.getFeatureValue(end).position;
+ boolean continueSearching = true;
+ int j = 0;
+ while(continueSearching & j < links.size()) {
+ j = j + 1;
+ continueSearching = links.get(j - 1).getFeatureValue(end).position < n;
+ }
+ if(continueSearching) {
+ links.add((Link)link);
+ } else {
+ links.add(j - 1, (Link)link);
+ }
+ }
+ }
+ }
+ return links;
+ }
+
+ public Property getOppositeEnd(Association association, StructuralFeature end) {
+ // Get the end of a binary association opposite to the given end.
+ Property oppositeEnd = association.getMemberEnds().get(0);
+ if(oppositeEnd == end) {
+ oppositeEnd = association.getMemberEnds().get(1);
+ }
+ return oppositeEnd;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/TestIdentityActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/TestIdentityActionActivation.java
new file mode 100644
index 00000000000..6f4588b6317
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/TestIdentityActionActivation.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.TestIdentityAction;
+
+public class TestIdentityActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Get the values from the first and second input pins and test if they
+ // are equal. (Note the equality of references is defined to be that
+ // they have identical referents.)
+ // If they are equal, place true on the pin execution for the result
+ // output pin, otherwise place false.
+ TestIdentityAction action = (TestIdentityAction)(this.node);
+ Value firstValue = this.takeTokens(action.getFirst()).get(0);
+ Value secondValue = this.takeTokens(action.getSecond()).get(0);
+ Value testResult = this.makeBooleanValue(firstValue.equals(secondValue));
+ this.putToken(action.getResult(), testResult);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ValueSpecificationActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ValueSpecificationActionActivation.java
new file mode 100644
index 00000000000..5d736529b21
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/ValueSpecificationActionActivation.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.ValueSpecificationAction;
+
+public class ValueSpecificationActionActivation extends ActionActivation {
+
+ public void doAction() {
+ // Evaluate the value specification for the action and place the result
+ // on the result pin of the action.
+ ValueSpecificationAction action = (ValueSpecificationAction)(this.node);
+ Value value = this.getExecutionLocus().executor.evaluate(action.getValue());
+ this.putToken(action.getResult(), value);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteLinkActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteLinkActionActivation.java
new file mode 100644
index 00000000000..88db8285f54
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteLinkActionActivation.java
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+public abstract class WriteLinkActionActivation extends LinkActionActivation {
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteStructuralFeatureActionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteStructuralFeatureActionActivation.java
new file mode 100644
index 00000000000..e367e1c9755
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Actions/IntermediateActions/WriteStructuralFeatureActionActivation.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Actions.IntermediateActions;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+
+public abstract class WriteStructuralFeatureActionActivation extends StructuralFeatureActionActivation {
+
+ public Integer position(Value value, List<Value> list, Integer startAt) {
+ // Return the position (counting from 1) of the first occurance of the
+ // given value in the given list at or after the starting index, or 0 if
+ // it is not found.
+ boolean found = false;
+ int i = startAt;
+ while(!found & i <= list.size()) {
+ found = list.get(i - 1).equals(value);
+ i = i + 1;
+ }
+ if(!found) {
+ i = 1;
+ }
+ return i - 1;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ClauseActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ClauseActivation.java
new file mode 100644
index 00000000000..66f072092d0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ClauseActivation.java
@@ -0,0 +1,129 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Clause;
+
+public class ClauseActivation {
+
+ /*
+ * The activation of the conditional node that contains the clause for this
+ * clause activation.
+ */
+ public ConditionalNodeActivation conditionalNodeActivation;
+
+ public Clause clause;
+
+ public void receiveControl() {
+ // If all predecessors to the clause for this activation have run their
+ // tests and failed, then run the test for this clause.
+ // If the test succeeds, then terminate any other clauses that may be
+ // running and run the body of this clause.
+ // If the test fails, then pass control to successor clauses.
+ Debug.println("[receiveControl] clauseActivation = " + this);
+ if(this.isReady()) {
+ Debug.println("[receiveControl] Running test...");
+ this.runTest();
+ BooleanValue decision = this.getDecision();
+ // Note that the decision may be null if the test was terminated
+ // before completion.
+ if(decision != null) {
+ if(decision.value == true) {
+ Debug.println("[receiveControl] Test succeeded.");
+ this.selectBody();
+ } else {
+ Debug.println("[receiveControl] Test failed.");
+ List<ClauseActivation> successors = this.getSuccessors();
+ // *** Give control to all successors concurrently. ***
+ for(Iterator<ClauseActivation> i = successors.iterator(); i.hasNext();) {
+ ClauseActivation successor = i.next();
+ successor.receiveControl();
+ }
+ }
+ }
+ }
+ }
+
+ public Boolean isReady() {
+ // Test if all predecessors to this clause activation have failed.
+ List<ClauseActivation> predecessors = this.getPredecessors();
+ boolean ready = true;
+ int i = 1;
+ while(ready & i <= predecessors.size()) {
+ ClauseActivation predecessor = predecessors.get(i - 1);
+ BooleanValue decisionValue = predecessor.getDecision();
+ // Note that the decision will be null if the predecessor clause has
+ // not run yet.
+ if(decisionValue == null) {
+ ready = false;
+ } else {
+ ready = !decisionValue.value;
+ }
+ i = i + 1;
+ }
+ return ready;
+ }
+
+ public void runTest() {
+ // Run the test of the clause for this clause activation.
+ this.conditionalNodeActivation.runTest(this.clause);
+ }
+
+ public void selectBody() {
+ // Select the body of the clause for this clause activation.
+ this.conditionalNodeActivation.selectBody(this.clause);
+ }
+
+ public BooleanValue getDecision() {
+ // Get the value (if any) on the decider pin of the clause for this
+ // clause activation.
+ List<Value> deciderValues = this.conditionalNodeActivation.getPinValues(this.clause.getDecider());
+ BooleanValue deciderValue = null;
+ if(deciderValues.size() > 0) {
+ deciderValue = (BooleanValue)(deciderValues.get(0));
+ }
+ return deciderValue;
+ }
+
+ public List<ClauseActivation> getPredecessors() {
+ // Return the clause activations for the predecessors of the clause for
+ // this clause activation.
+ List<ClauseActivation> predecessors = new ArrayList<ClauseActivation>();
+ List<Clause> predecessorClauses = this.clause.getPredecessorClauses();
+ for(int i = 0; i < predecessorClauses.size(); i++) {
+ Clause predecessorClause = predecessorClauses.get(i);
+ predecessors.add(this.conditionalNodeActivation.getClauseActivation(predecessorClause));
+ }
+ return predecessors;
+ }
+
+ public List<ClauseActivation> getSuccessors() {
+ // Return the clause activations for the successors of the clause for
+ // this clause activation.
+ List<ClauseActivation> successors = new ArrayList<ClauseActivation>();
+ List<Clause> successorClauses = this.clause.getSuccessorClauses();
+ for(int i = 0; i < successorClauses.size(); i++) {
+ Clause successorClause = successorClauses.get(i);
+ successors.add(this.conditionalNodeActivation.getClauseActivation(successorClause));
+ }
+ return successors;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ConditionalNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ConditionalNodeActivation.java
new file mode 100644
index 00000000000..f02a3905f10
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/ConditionalNodeActivation.java
@@ -0,0 +1,176 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.ChoiceStrategy;
+import org.eclipse.uml2.uml.Clause;
+import org.eclipse.uml2.uml.ConditionalNode;
+import org.eclipse.uml2.uml.ExecutableNode;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Pin;
+
+public class ConditionalNodeActivation extends StructuredActivityNodeActivation {
+
+ /*
+ * The activations for each clause in the conditional node for this node
+ * activation.
+ */
+ public List<ClauseActivation> clauseActivations = new ArrayList<ClauseActivation>();
+
+ /*
+ * The set of clauses which meet the conditions to have their bodies
+ * activated.
+ */
+ public List<Clause> selectedClauses = new ArrayList<Clause>();
+
+ /*
+ * The clause chosen from the set of selectedClauses to actually be
+ * executed.
+ */
+ public Clause selectedClause;
+
+ public void doStructuredActivity() {
+ // Run all the non-executable, non-pin nodes in the conditional node.
+ // Activate all clauses in the conditional node and pass control to
+ // those that are ready (i.e., have no predecessors).
+ // If one or more clauses have succeeded in being selected, choose one
+ // non-deterministically and run its body, then copy the outputs of that
+ // clause to the output pins of the node.
+ ConditionalNode node = (ConditionalNode)(this.node);
+ List<ActivityNodeActivation> nodeActivations = this.activationGroup.nodeActivations;
+ List<ActivityNodeActivation> nonExecutableNodeActivations = new ArrayList<ActivityNodeActivation>();
+ for(int i = 0; i < nodeActivations.size(); i++) {
+ ActivityNodeActivation nodeActivation = nodeActivations.get(i);
+ if(!(nodeActivation.node instanceof ExecutableNode | nodeActivation.node instanceof Pin)) {
+ nonExecutableNodeActivations.add(nodeActivation);
+ }
+ }
+ this.activationGroup.run(nonExecutableNodeActivations);
+ this.clauseActivations.clear();
+ List<Clause> clauses = node.getClauses();
+ for(int i = 0; i < clauses.size(); i++) {
+ Clause clause = clauses.get(i);
+ ClauseActivation clauseActivation = new ClauseActivation();
+ clauseActivation.clause = clause;
+ clauseActivation.conditionalNodeActivation = this;
+ this.clauseActivations.add(clauseActivation);
+ }
+ this.selectedClauses.clear();
+ List<ClauseActivation> readyClauseActivations = new ArrayList<ClauseActivation>();
+ for(int i = 0; i < this.clauseActivations.size(); i++) {
+ ClauseActivation clauseActivation = this.clauseActivations.get(i);
+ Debug.println("[doStructuredActivity] clauseActivations[" + i + "] = " + clauseActivation);
+ if(clauseActivation.isReady()) {
+ Debug.println("[doStructuredActivity] Clause activation is ready.");
+ readyClauseActivations.add(clauseActivation);
+ }
+ }
+ // *** Give control to all ready clauses concurrently. ***
+ for(Iterator<ClauseActivation> i = readyClauseActivations.iterator(); i.hasNext();) {
+ ClauseActivation clauseActivation = (ClauseActivation)i.next();
+ Debug.println("[doStructuredActivity] Giving control to " + clauseActivation + "...");
+ clauseActivation.receiveControl();
+ }
+ this.selectedClause = null;
+ if(this.selectedClauses.size() > 0 & this.isRunning()) {
+ Debug.println("[doStructuredActivity] " + this.selectedClauses.size() + " clause(s) selected.");
+ // *** If multiple clauses are selected, choose one
+ // non-deterministically. ***
+ int i = ((ChoiceStrategy)this.getExecutionLocus().factory.getStrategy("choice")).choose(this.selectedClauses.size());
+ this.selectedClause = this.selectedClauses.get(i - 1);
+ Debug.println("[doStructuredActivity] Running selectedClauses[" + i + "] = " + this.selectedClause);
+ for(int j = 0; j < clauses.size(); j++) {
+ Clause clause = clauses.get(j);
+ if(clause != selectedClause) {
+ List<ExecutableNode> testNodes = clause.getTests();
+ for(int k = 0; k < testNodes.size(); k++) {
+ ExecutableNode testNode = testNodes.get(k);
+ this.activationGroup.getNodeActivation(testNode).terminate();
+ }
+ }
+ }
+ this.activationGroup.runNodes(this.makeActivityNodeList(this.selectedClause.getBodies()));
+ }
+ }
+
+ public void completeBody() {
+ // Complete the activation of the body of a conditional note by
+ // copying the outputs of the selected clause (if any) to the output
+ // pins of the node and terminating the activation of all nested nodes.
+ if(this.selectedClause != null) {
+ ConditionalNode node = (ConditionalNode)(this.node);
+ List<OutputPin> resultPins = node.getResults();
+ List<OutputPin> bodyOutputPins = this.selectedClause.getBodyOutputs();
+ for(int k = 0; k < resultPins.size(); k++) {
+ OutputPin resultPin = resultPins.get(k);
+ OutputPin bodyOutputPin = bodyOutputPins.get(k);
+ this.putTokens(resultPin, this.getPinValues(bodyOutputPin));
+ }
+ }
+ this.activationGroup.terminateAll();
+ }
+
+ public List<Token> completeAction() {
+ // Only complete the conditional node if it is not suspended.
+ if(!this.isSuspended()) {
+ completeBody();
+ }
+ return super.completeAction();
+ }
+
+ public ClauseActivation getClauseActivation(Clause clause) {
+ // Get the clause activation corresponding to the given clause.
+ // Debug.println("[getClauseActivation] clause = " + clause);
+ ClauseActivation selectedClauseActivation = null;
+ int i = 1;
+ while((selectedClauseActivation == null) & i <= this.clauseActivations.size()) {
+ ClauseActivation clauseActivation = this.clauseActivations.get(i - 1);
+ // Debug.println("[getClauseActivations] clauseActivations[" + i +
+ // "].clause = " + clauseActivation.clause);
+ if(clauseActivation.clause == clause) {
+ selectedClauseActivation = clauseActivation;
+ }
+ i = i + 1;
+ }
+ return selectedClauseActivation;
+ }
+
+ public void runTest(Clause clause) {
+ // Run the test for the given clause.
+ if(this.isRunning()) {
+ this.activationGroup.runNodes(this.makeActivityNodeList(clause.getTests()));
+ }
+ }
+
+ public void selectBody(Clause clause) {
+ // Add the clause to the list of selected clauses.
+ this.selectedClauses.add(clause);
+ }
+
+ public void resume() {
+ // When this conditional node is resumed after being suspended, complete
+ // its body and then resume it as a structured activity node.
+ // [Note that this presumes that accept event actions are not allowed
+ // in the test part of a clause of a conditional node.]
+ completeBody();
+ super.resume();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/LoopNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/LoopNodeActivation.java
new file mode 100644
index 00000000000..00f1a2f0a68
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/LoopNodeActivation.java
@@ -0,0 +1,256 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.OutputPinActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ExecutableNode;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.LoopNode;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.Pin;
+
+public class LoopNodeActivation extends StructuredActivityNodeActivation {
+
+ public List<Values> bodyOutputLists = new ArrayList<Values>();
+ public Boolean isTerminateAll;
+
+ public void doStructuredActivity() {
+ // Set the initial values for the body outputs to the values of the loop
+ // variable input pins.
+ // If isTestedFirst is true, then repeatedly run the test part and the
+ // body part of the loop, copying values from the body outputs to the
+ // loop variables.
+ // If isTestedFirst is false, then repeatedly run the body part and the
+ // test part of the loop, copying values from the body outputs to the
+ // loop variables.
+ // When the test fails, copy the values of the body outputs to the loop
+ // outputs.
+ // [Note: The body outputs are used for the loop outputs, rather than
+ // the loop variables, since values on the loop variables may be
+ // consumed when running the test for the last time.]
+ LoopNode loopNode = (LoopNode)(this.node);
+ List<InputPin> loopVariableInputs = loopNode.getLoopVariableInputs();
+
+ this.bodyOutputLists.clear(); // Added
+
+ for(int i = 0; i < loopVariableInputs.size(); i++) {
+ InputPin loopVariableInput = loopVariableInputs.get(i);
+ Values bodyOutputList = new Values();
+ bodyOutputList.values = this.takeTokens(loopVariableInput);
+ this.bodyOutputLists.add(bodyOutputList);
+ }
+ this.isTerminateAll = false;
+ this.doLoop(true);
+ }
+
+ public void doLoop(Boolean continuing) {
+ // If isTestedFirst is true, then repeatedly run the test part and the
+ // body part of the loop, copying values from the body outputs to the
+ // loop variables.
+ // If isTestedFirst is false, then repeatedly run the body part and the
+ // test part of the loop, copying values from the body outputs to the
+ // loop variables.
+ LoopNode loopNode = (LoopNode)(this.node);
+ List<OutputPin> loopVariables = loopNode.getLoopVariables();
+ List<OutputPin> resultPins = this.getResults(); // CHANGED from: loopNode.getResults();
+ while(continuing) {
+ // Set loop variable values
+ this.runLoopVariables();
+ for(int i = 0; i < loopVariables.size(); i++) {
+ OutputPin loopVariable = loopVariables.get(i);
+ Values bodyOutputList = bodyOutputLists.get(i);
+ List<Value> values = bodyOutputList.values;
+ this.putPinValues(loopVariable, values);
+ ((OutputPinActivation)this.activationGroup.getNodeActivation(loopVariable)).sendUnofferedTokens();
+ }
+ // Run all the non-executable, non-pin nodes in the conditional
+ // node.
+ List<ActivityNodeActivation> nodeActivations = this.activationGroup.nodeActivations;
+ List<ActivityNodeActivation> nonExecutableNodeActivations = new ArrayList<ActivityNodeActivation>();
+ for(int i = 0; i < nodeActivations.size(); i++) {
+ ActivityNodeActivation nodeActivation = nodeActivations.get(i);
+ if(!(nodeActivation.node instanceof ExecutableNode | nodeActivation.node instanceof Pin)) {
+ nonExecutableNodeActivations.add(nodeActivation);
+ }
+ }
+ this.activationGroup.run(nonExecutableNodeActivations);
+ // Run the loop
+ if(loopNode.isTestedFirst()) {
+ continuing = this.runTest();
+ if(continuing) {
+ this.runBody();
+ }
+ } else {
+ this.runBody();
+ if(this.isRunning() & !this.isSuspended()) {
+ continuing = this.runTest();
+ }
+ }
+ if(!this.isTerminateAll & this.isRunning() & !this.isSuspended()) {
+ this.activationGroup.terminateAll();
+ } else {
+ continuing = false;
+ }
+ Debug.println("[doStructuredActivity] " + (continuing ? "Continuing." : this.isSuspended() ? "Suspended" : "Done."));
+ }
+ if(!this.isTerminateAll & this.isRunning() & !this.isSuspended()) {
+ for(int i = 0; i < bodyOutputLists.size(); i++) {
+ Values bodyOutputList = bodyOutputLists.get(i);
+ OutputPin resultPin = resultPins.get(i);
+ this.putTokens(resultPin, bodyOutputList.values);
+ }
+ }
+ }
+
+ public Boolean runTest() {
+ // Run the test part of the loop node for this node activation.
+ // Return the value on the decider pin.
+ Debug.println("[runTest] Running test...");
+ LoopNode loopNode = (LoopNode)(this.node);
+ this.activationGroup.runNodes(this.makeActivityNodeList(loopNode.getTests()));
+ List<Value> values = this.getPinValues(loopNode.getDecider());
+ // If there is no decider value, treat it as false.
+ boolean decision = false;
+ if(values.size() > 0) {
+ decision = ((BooleanValue)(values.get(0))).value;
+ }
+ Debug.println("[runTest] " + (decision ? "Test succeeded." : "Test failed."));
+ return decision;
+ }
+
+ public void runBody() {
+ // Run the body part of the loop node for this node activation and save
+ // the body outputs.
+ Debug.println("[runBody] Running body...");
+ LoopNode loopNode = (LoopNode)this.node;
+ this.activationGroup.runNodes(this.makeActivityNodeList(loopNode.getBodyParts()));
+ if(!this.isTerminateAll && !this.isSuspended()) {
+ this.saveBodyOutputs();
+ }
+ }
+
+ public void saveBodyOutputs() {
+ // Save the body outputs for use in the next iteration.
+ LoopNode loopNode = (LoopNode)this.node;
+ List<OutputPin> bodyOutputs = loopNode.getBodyOutputs();
+ List<Values> bodyOutputLists = this.bodyOutputLists;
+ for(int i = 0; i < bodyOutputs.size(); i++) {
+ OutputPin bodyOutput = bodyOutputs.get(i);
+ Values bodyOutputList = bodyOutputLists.get(i);
+ bodyOutputList.values = this.getPinValues(bodyOutput);
+ }
+ }
+
+ public void runLoopVariables() {
+ // Run the loop variable pins of the loop node for this node activation.
+ this.activationGroup.runNodes(this.makeLoopVariableList());
+ }
+
+ public void createNodeActivations() {
+ // In addition to creating activations for contained nodes, create
+ // activations for any loop variables.
+
+ super.createNodeActivations();
+ this.activationGroup.createNodeActivations(this.makeLoopVariableList());
+ }
+
+ public List<ActivityNode> makeLoopVariableList() {
+ // Return an activity node list containing the loop variable pins for
+ // the loop node of this activation.
+ LoopNode loopNode = (LoopNode)(this.node);
+ List<ActivityNode> nodes = new ArrayList<ActivityNode>();
+ List<OutputPin> loopVariables = loopNode.getLoopVariables();
+ for(int i = 0; i < loopVariables.size(); i++) {
+ OutputPin loopVariable = loopVariables.get(i);
+ nodes.add(loopVariable);
+ }
+ return nodes;
+ }
+
+ public void terminateAll() {
+ // Copy the values of the body outputs to the loop outputs, and then
+ // terminate all activations in the loop.
+ this.isTerminateAll = true;
+ LoopNode loopNode = (LoopNode) this.node;
+ List<OutputPin> bodyOutputs = loopNode.getBodyOutputs();
+ List<OutputPin> resultPins = this.getResults();
+ for (int i = 0; i < bodyOutputs.size(); i++) {
+ OutputPin bodyOutput = bodyOutputs.get(i);
+ OutputPin resultPin = resultPins.get(i);
+ this.putTokens(resultPin, this.getPinValues(bodyOutput));
+ }
+ super.terminateAll();
+ }
+
+ public void resume() {
+ // When this loop node is resumed after being suspended, continue with
+ // its next iteration (if any). Once the loop has completed execution
+ // without being suspended again, complete the action.
+ LoopNode loopNode = (LoopNode)(this.node);
+ this.saveBodyOutputs();
+ if (!this.isTerminateAll) {
+ if(loopNode.isMustIsolate()) {
+ _beginIsolation();
+ this.continueLoop();
+ _endIsolation();
+ } else {
+ this.continueLoop();
+ }
+ }
+ if(this.isSuspended()) {
+ // NOTE: If the subsequent iteration of the loop suspends it again,
+ // then it is necessary to remove the previous suspension from the
+ // containing activity node activation group.
+ this.group.resume(this);
+ } else {
+ super.resume();
+ }
+ }
+
+ public void continueLoop() {
+ // Continue the loop node when it is resumed after being suspended. If
+ // isTestedFirst is true, then continue executing the loop. If
+ // isTestedFirst is false, then run the test to determine whether
+ // the loop should be continued or completed.
+ // [Note that this presumes that an accept event action is not allowed
+ // in the test part of a loop node.]
+ LoopNode loopNode = (LoopNode)(this.node);
+ boolean continuing = true;
+ if(!loopNode.isTestedFirst()) {
+ continuing = this.runTest();
+ }
+ if(this.isRunning()) {
+ this.activationGroup.terminateAll();
+ this.doLoop(continuing);
+ }
+ }
+
+ // ADDED:
+ private List<OutputPin> getResults() {
+ LoopNode node = (LoopNode)this.node;
+ List<OutputPin> results = new ArrayList<OutputPin>(node.getResults());
+ List<OutputPin> loopVariables = node.getLoopVariables();
+ results.removeAll(loopVariables);
+ return results;
+ }
+ //
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/StructuredActivityNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/StructuredActivityNodeActivation.java
new file mode 100644
index 00000000000..dcc779150ab
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/StructuredActivityNodeActivation.java
@@ -0,0 +1,211 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.PinActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityEdgeInstance;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivationGroup;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ObjectToken;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ExecutableNode;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.StructuredActivityNode;
+
+public class StructuredActivityNodeActivation extends ActionActivation {
+
+ /*
+ * The group of activations of the activity nodes contained in the
+ * structured activity node.
+ */
+ public ActivityNodeActivationGroup activationGroup;
+
+ public void doAction() {
+ // If the structured activity node has mustIsolate=true, then carry out
+ // its behavior with isolation.
+ // Otherwise just activate it normally.
+ if(((StructuredActivityNode)(this.node)).isMustIsolate()) {
+ _beginIsolation();
+ this.doStructuredActivity();
+ _endIsolation();
+ } else {
+ this.doStructuredActivity();
+ }
+ }
+
+ public void doStructuredActivity() {
+ // Run all activations of contained nodes. When this is complete,
+ // return.
+ // (This is the default behavior for a structured activity node used
+ // simply as a group. It is overridden for the execution of conditional
+ // and loop nodes.)
+ Action action = (Action)(this.node);
+ // *** Concurrently send offers from all input pins. ***
+ List<InputPin> inputPins = getInputs(action); // CHANGED from: action.getInputs();
+ for(Iterator<InputPin> i = inputPins.iterator(); i.hasNext();) {
+ InputPin inputPin = i.next();
+ PinActivation pinActivation = this.getPinActivation(inputPin);
+ pinActivation.sendUnofferedTokens();
+ }
+ this.activationGroup.run(this.activationGroup.nodeActivations);
+ }
+
+ public void terminate() {
+ // Terminate the execution of all contained node activations (which
+ // completes the performance of the structured activity node
+ // activation), and then terminate this node itself.
+ this.terminateAll();
+ super.terminate();
+ }
+
+ public ActivityNodeActivation getNodeActivation(ActivityNode node) {
+ // If this structured activity node activation is not for the given
+ // node, then check if there is an activation for the node in the
+ // activation group.
+ ActivityNodeActivation thisActivation = super.getNodeActivation(node);
+ ActivityNodeActivation activation = null;
+ if(thisActivation != null) {
+ activation = thisActivation;
+ } else if(this.activationGroup != null) {
+ activation = this.activationGroup.getNodeActivation(node);
+ }
+ return activation;
+ }
+
+ public List<ActivityNode> makeActivityNodeList(List<ExecutableNode> nodes) {
+ // Return an activity node list containing the given list of executable
+ // nodes
+ // and any pins that they own.
+ List<ActivityNode> activityNodes = new ArrayList<ActivityNode>();
+ for(int i = 0; i < nodes.size(); i++) {
+ ActivityNode node = nodes.get(i);
+ activityNodes.add(node);
+ if(node instanceof Action) {
+ Action action = (Action)node;
+ List<InputPin> inputPins = getInputs(action); // CHANGED from: action.getInputs();
+ for(int j = 0; j < inputPins.size(); j++) {
+ InputPin inputPin = inputPins.get(j);
+ activityNodes.add(inputPin);
+ }
+ List<OutputPin> outputPins = getOutputs(action); // CHANGED from: action.getOutputs();
+ for(int j = 0; j < outputPins.size(); j++) {
+ OutputPin outputPin = outputPins.get(j);
+ activityNodes.add(outputPin);
+ }
+ }
+ }
+ return activityNodes;
+ }
+
+ public List<Value> getPinValues(OutputPin pin) {
+ // Return the values of the tokens on the pin activation corresponding
+ // to the given pin in the internal activation group for this node
+ // activation.
+ PinActivation pinActivation = (PinActivation)(this.activationGroup.getNodeActivation(pin));
+ List<Token> tokens = pinActivation.getTokens();
+ List<Value> values = new ArrayList<Value>();
+ for(int i = 0; i < tokens.size(); i++) {
+ Token token = tokens.get(i);
+ Value value = ((ObjectToken)token).value;
+ if(value != null) {
+ values.add(value);
+ }
+ }
+ return values;
+ }
+
+ public void putPinValues(OutputPin pin, List<Value> values) {
+ // Place tokens for the given values on the pin activation corresponding
+ // to the given output pin on the internal activation group for this
+ // node activation.
+ PinActivation pinActivation = (PinActivation)(this.activationGroup.getNodeActivation(pin));
+ for(int i = 0; i < values.size(); i++) {
+ Value value = values.get(i);
+ ObjectToken token = new ObjectToken();
+ token.value = value;
+ pinActivation.addToken(token);
+ }
+ }
+
+ public void createNodeActivations() {
+ // Create an activation group and create node activations for all the
+ // nodes within the structured activity node.
+ super.createNodeActivations();
+
+ this.activationGroup = new ActivityNodeActivationGroup();
+ this.activationGroup.containingNodeActivation = this;
+ this.activationGroup.createNodeActivations(((StructuredActivityNode)(this.node)).getNodes());
+ }
+
+ public void createEdgeInstances() {
+ // Create instances for all edges owned by this node.
+ this.activationGroup.createEdgeInstances(((StructuredActivityNode)(this.node)).getEdges());
+ }
+
+ public Boolean isSourceFor(ActivityEdgeInstance edgeInstance) {
+ // Returns true if this node is either the source for the given
+ // edgeInstance itself or if it contains the source in its
+ // activation group.
+ boolean isSource = super.isSourceFor(edgeInstance);
+ if(!isSource) {
+ isSource = this.activationGroup.hasSourceFor(edgeInstance);
+ }
+ return isSource;
+ }
+
+ public void terminateAll() {
+ // Terminate the execution of all contained node activations (which
+ // completes the performance of the structured activity node
+ // activation).
+ this.activationGroup.terminateAll();
+ }
+
+ public Boolean isSuspended() {
+ // Check if the activation group for this node is suspended.
+ return this.activationGroup.isSuspended();
+ }
+
+ public List<Token> completeAction() {
+ // Only actually complete this structured activity node if it is not
+ // suspended.
+ List<Token> incomingTokens = new ArrayList<Token>();
+ if(!this.isSuspended()) {
+ incomingTokens = super.completeAction();
+ }
+ return incomingTokens;
+ }
+
+ public void resume() {
+ // When this structured activity node is resumed after being suspended,
+ // then complete its prior firing and, if there are more incoming
+ // tokens, fire it again. If, after that, the node is not suspended,
+ // then finish its resumption.
+ List<Token> incomingTokens = super.completeAction();
+ if(incomingTokens.size() > 0) {
+ this.fire(incomingTokens);
+ }
+ if(!this.isSuspended()) {
+ super.resume();
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/Values.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/Values.java
new file mode 100644
index 00000000000..1b1a50373c3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/CompleteStructuredActivities/Values.java
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+
+public class Values {
+
+ public List<Value> values = new ArrayList<Value>();
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionActivationGroup.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionActivationGroup.java
new file mode 100644
index 00000000000..d66654af7dc
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionActivationGroup.java
@@ -0,0 +1,122 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.ExtraStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.OutputPinActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivationGroup;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.ExpansionRegion;
+
+public class ExpansionActivationGroup extends ActivityNodeActivationGroup {
+
+ /*
+ * Output pin activations corresponding, in order, to the input pins of the
+ * expansion region of this activation group.
+ */
+ public List<OutputPinActivation> regionInputs = new ArrayList<OutputPinActivation>();
+
+ /*
+ * Output pin activations corresponding, in order, to the input expansion
+ * nodes of the expansion region of this activation group.
+ */
+ public List<OutputPinActivation> groupInputs = new ArrayList<OutputPinActivation>();
+
+ /*
+ * The expansion region activation this activation group is for.
+ */
+ public ExpansionRegionActivation regionActivation;
+
+ /*
+ * Output pin activations corresponding, in order, to the output expansion
+ * nodes of the expansion region of this activation group.
+ */
+ public List<OutputPinActivation> groupOutputs = new ArrayList<OutputPinActivation>();
+
+ /*
+ * The index (starting at 1) of this activation group in the list held by
+ * the expansion region activation.
+ */
+ public Integer index;
+
+ public ActivityNodeActivation getNodeActivation(ActivityNode node) {
+ // If the given node is an input pin of the expansion region, then
+ // return the corresponding region-input output-pin activation.
+ // If the given node is an input expansion node of the expansion region,
+ // then return the corresponding group-input output-pin activation.
+ // If the given node is an output expansion node of the expansion
+ // region, then return the corresponding group-output output-pin
+ // activation.
+ // Otherwise return the node activation from the activation group, as
+ // usual.
+ ExpansionRegion region = (ExpansionRegion)(this.regionActivation.node);
+ // List<InputPin> inputs = region.getInputs();
+ ActivityNodeActivation activation = null;
+ int i = 1;
+ while(activation == null & i <= region.getInputs().size()) {
+ if(node == region.getInputs().get(i - 1)) {
+ activation = this.regionInputs.get(i - 1);
+ }
+ i = i + 1;
+ }
+ int j = 1;
+ while(activation == null & j <= region.getInputElements().size()) {
+ if(node == region.getInputElements().get(j - 1)) {
+ activation = this.groupInputs.get(j - 1);
+ }
+ j = j + 1;
+ }
+ int k = 1;
+ while(activation == null & k <= region.getOutputElements().size()) {
+ if(node == region.getOutputElements().get(k - 1)) {
+ activation = this.groupOutputs.get(k - 1);
+ }
+ k = k + 1;
+ }
+ if(activation == null) {
+ activation = super.getNodeActivation(node);
+ }
+ return activation;
+ }
+
+ public ActivityExecution getActivityExecution() {
+ // Get the activity execution that contains the expansion region
+ // activation for this activation group.
+ return this.regionActivation.getActivityExecution();
+ }
+
+ public void suspend(ActivityNodeActivation activation) {
+ // Suspend the given activation in this activation group. If this is
+ // the only suspended activation, then suspend the associated region
+ // activation.
+ if(!this.isSuspended()) {
+ this.regionActivation.suspend();
+ }
+ super.suspend(activation);
+ }
+
+ public void resume(ActivityNodeActivation activation) {
+ // Resume the given activation in this activation group. If this is the
+ // last suspended activation, then resume the associated region
+ // activation.
+ super.resume(activation);
+ if(!this.isSuspended()) {
+ this.regionActivation.resume(this);
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionNodeActivation.java
new file mode 100644
index 00000000000..4c99267ae0b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionNodeActivation.java
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.ExtraStructuredActivities;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ObjectNodeActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.uml2.uml.ExpansionNode;
+import org.eclipse.uml2.uml.ExpansionRegion;
+
+public class ExpansionNodeActivation extends ObjectNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Take tokens from all incoming edges.
+ Debug.println("[fire] Expansion node " + this.node.getName() + "...");
+ this.addTokens(incomingTokens);
+ }
+
+ public void receiveOffer() {
+ // Forward the offer on to the expansion region.
+ this.getExpansionRegionActivation().receiveOffer();
+ }
+
+ public Boolean isReady() {
+ // An expansion node is always fired by its expansion region.
+ return false;
+ }
+
+ public ExpansionRegionActivation getExpansionRegionActivation() {
+ // Return the expansion region activation corresponding to this
+ // expansion node, in the context of the activity node activation group
+ // this expansion node activation is in.
+ ExpansionNode node = (ExpansionNode)(this.node);
+ ExpansionRegion region = node.getRegionAsInput();
+ if(region == null) {
+ region = node.getRegionAsOutput();
+ }
+ return (ExpansionRegionActivation)(this.group.getNodeActivation(region));
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionRegionActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionRegionActivation.java
new file mode 100644
index 00000000000..ac64fe6a74a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/ExpansionRegionActivation.java
@@ -0,0 +1,326 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.ExtraStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.OutputPinActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.ActivityNodeActivationGroup;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+import org.eclipse.uml2.uml.ExpansionKind;
+import org.eclipse.uml2.uml.ExpansionNode;
+import org.eclipse.uml2.uml.ExpansionRegion;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.StructuredActivityNode;
+
+public class ExpansionRegionActivation extends ActionActivation {
+
+ /*
+ * The set of expansion activation groups for this expansion region
+ * activation. One activation group is created corresponding to each token
+ * held by the first input expansion node activation for the expansion
+ * region.
+ */
+ public List<ExpansionActivationGroup> activationGroups = new ArrayList<ExpansionActivationGroup>();
+
+ /*
+ * The tokens taken from each of the input pin activations for this
+ * expansion region activation. These are preserved for initializing the
+ * region inputs of each of the activation groups.
+ */
+ public List<TokenSet> inputTokens = new ArrayList<TokenSet>();
+
+ /*
+ * The tokens taken from each of the input expansion node activations for
+ * this expansion region activation. These are preserved for initializing
+ * the group input of each of the activation groups.
+ */
+ public List<TokenSet> inputExpansionTokens = new ArrayList<TokenSet>();
+
+ public Integer next;
+
+ public List<Token> takeOfferedTokens() {
+ // Take the tokens from the input pin and input expansion node
+ // activations and save them.
+ super.takeOfferedTokens();
+ ExpansionRegion region = (ExpansionRegion)(this.node);
+ List<InputPin> inputPins = region.getInputs();
+ List<ExpansionNode> inputElements = region.getInputElements();
+ this.inputTokens.clear();
+ this.inputExpansionTokens.clear();
+ for(int i = 0; i < inputPins.size(); i++) {
+ InputPin inputPin = inputPins.get(i);
+ TokenSet tokenSet = new TokenSet();
+ tokenSet.tokens = this.getPinActivation(inputPin).takeTokens();
+ this.inputTokens.add(tokenSet);
+ }
+ int n = this.numberOfValues();
+ for(int i = 0; i < inputElements.size(); i++) {
+ ExpansionNode inputElement = inputElements.get(i);
+ ExpansionNodeActivation expansionNodeActivation = this.getExpansionNodeActivation(inputElement);
+ expansionNodeActivation.fire(expansionNodeActivation.takeOfferedTokens());
+ List<Token> tokens = expansionNodeActivation.takeTokens();
+ TokenSet tokenSet = new TokenSet();
+ int j = 1;
+ while(j <= n) {
+ tokenSet.tokens.add(tokens.get(j - 1));
+ j = j + 1;
+ }
+ this.inputExpansionTokens.add(tokenSet);
+ }
+ return new ArrayList<Token>();
+ }
+
+ public void doAction() {
+ // If the expansion region has mustIsolate=true, then carry out its
+ // behavior with isolation.
+ // Otherwise just activate it normally.
+ if(((StructuredActivityNode)(this.node)).isMustIsolate()) {
+ _beginIsolation();
+ this.doStructuredActivity();
+ _endIsolation();
+ } else {
+ this.doStructuredActivity();
+ }
+ }
+
+ public void doStructuredActivity() {
+ // Create a number of expansion region activation groups equal to the
+ // number of values expanded in the region,
+ // setting the region inputs and group inputs for each group.
+ // Run the body of the region in each group, either iteratively or in
+ // parallel.
+ // Add the outputs of each activation group to the corresonding output
+ // expansion node activations.
+ ExpansionRegion region = (ExpansionRegion)this.node;
+ List<InputPin> inputPins = region.getInputs();
+ List<ExpansionNode> inputElements = region.getInputElements();
+ List<ExpansionNode> outputElements = region.getOutputElements();
+ this.activationGroups.clear();
+ int n = this.inputExpansionTokens.get(0).tokens.size();
+ int k = 1;
+ while(k <= n) {
+ ExpansionActivationGroup activationGroup = new ExpansionActivationGroup();
+ activationGroup.regionActivation = this;
+ activationGroup.index = k;
+ int j = 1;
+ while(j <= inputPins.size()) {
+ OutputPinActivation regionInput = new OutputPinActivation();
+ regionInput.run();
+ activationGroup.regionInputs.add(regionInput);
+ j = j + 1;
+ }
+ j = 1;
+ while(j <= inputElements.size()) {
+ OutputPinActivation groupInput = new OutputPinActivation();
+ groupInput.run();
+ activationGroup.groupInputs.add(groupInput);
+ j = j + 1;
+ }
+ j = 1;
+ while(j <= outputElements.size()) {
+ OutputPinActivation groupOutput = new OutputPinActivation();
+ groupOutput.run();
+ activationGroup.groupOutputs.add(groupOutput); // CHANGED "new OutputPinActivation()" to "groupOutput"
+ j = j + 1;
+ }
+ activationGroup.createNodeActivations(region.getNodes());
+ activationGroup.createEdgeInstances(region.getEdges());
+ this.activationGroups.add(activationGroup);
+ k = k + 1;
+ }
+ // List<ExpansionActivationGroup> activationGroups =
+ // this.activationGroups;
+ if(region.getMode() == ExpansionKind.ITERATIVE_LITERAL) {
+ Debug.println("[doStructuredActivity] Expansion mode = iterative");
+ this.next = 1;
+ this.runIterative();
+ } else if(region.getMode() == ExpansionKind.PARALLEL_LITERAL) {
+ Debug.println("[doStructuredActivity] Expansion mode = parallel");
+ this.runParallel();
+ }
+ this.doOutput();
+ }
+
+ public void runIterative() {
+ // Run the body of the region iteratively, either until all activation
+ // groups have run or until the region is suspended.
+ List<ExpansionActivationGroup> activationGroups = this.activationGroups;
+ while(this.next <= activationGroups.size() & !this.isSuspended()) {
+ ExpansionActivationGroup activationGroup = activationGroups.get(this.next - 1);
+ this.runGroup(activationGroup);
+ this.next = this.next + 1;
+ }
+ }
+
+ public void runParallel() {
+ // Run the body of the region concurrently.
+ List<ExpansionActivationGroup> activationGroups = this.activationGroups;
+ // *** Activate all groups concurrently. ***
+ for(Iterator<ExpansionActivationGroup> i = activationGroups.iterator(); i.hasNext();) {
+ ExpansionActivationGroup activationGroup = i.next();
+ this.runGroup(activationGroup);
+ }
+ }
+
+ public void doOutput() {
+ // Place tokens on the output expansion nodes.
+ ExpansionRegion region = (ExpansionRegion)this.node;
+ List<ExpansionNode> outputElements = region.getOutputElements();
+ Debug.println("[doOutput] Expansion region " + region.getName() + " is " + (this.isSuspended() ? "suspended." : "completed."));
+ if(!this.isSuspended()) {
+ for(int i = 0; i < activationGroups.size(); i++) {
+ ExpansionActivationGroup activationGroup = activationGroups.get(i);
+ List<OutputPinActivation> groupOutputs = activationGroup.groupOutputs;
+ for(int j = 0; j < groupOutputs.size(); j++) {
+ OutputPinActivation groupOutput = groupOutputs.get(j);
+ ExpansionNode outputElement = outputElements.get(j);
+ this.getExpansionNodeActivation(outputElement).addTokens(groupOutput.takeTokens());
+ }
+ }
+ }
+ }
+
+ public void terminate() {
+ // Terminate the execution of all contained node activations (which
+ // completes the performance of the expansion region activation).
+ List<ExpansionActivationGroup> activationGroups = this.activationGroups;
+ for(int i = 0; i < activationGroups.size(); i++) {
+ ExpansionActivationGroup activationGroup = this.activationGroups.get(i);
+ List<OutputPinActivation> groupOutputs = activationGroup.groupOutputs;
+ _beginIsolation();
+ for(int j = 0; j < groupOutputs.size(); j++) {
+ OutputPinActivation groupOutput = groupOutputs.get(j);
+ groupOutput.fire(groupOutput.takeOfferedTokens());
+ }
+ activationGroup.terminateAll();
+ _endIsolation();
+ }
+ super.terminate();
+ }
+
+ public void sendOffers() {
+ // Fire all output expansion nodes and send offers on all outgoing
+ // control flows.
+ ExpansionRegion region = (ExpansionRegion)(this.node);
+ // *** Send offers from all output expansion nodes concurrently. ***
+ List<ExpansionNode> outputElements = region.getOutputElements();
+ for(Iterator<ExpansionNode> i = outputElements.iterator(); i.hasNext();) {
+ ExpansionNode outputElement = i.next();
+ this.getExpansionNodeActivation(outputElement).sendUnofferedTokens();
+ }
+ // Send offers on all outgoing control flows.
+ super.sendOffers();
+ }
+
+ public void runGroup(ExpansionActivationGroup activationGroup) {
+ // Set up the inputs for the group with the given index, run the group
+ // and then fire the group outputs.
+ if(this.isRunning()) {
+ Debug.println("[runGroup] groupInput[0] = " + this.inputExpansionTokens.get(0).tokens.get(activationGroup.index - 1).getValue());
+ List<TokenSet> inputTokens = this.inputTokens;
+ for(int j = 0; j < inputTokens.size(); j++) {
+ TokenSet tokenSet = inputTokens.get(j);
+ OutputPinActivation regionInput = activationGroup.regionInputs.get(j);
+ regionInput.clearTokens();
+ regionInput.addTokens(tokenSet.tokens);
+ regionInput.sendUnofferedTokens();
+ }
+ List<TokenSet> inputExpansionTokens = this.inputExpansionTokens;
+ for(int j = 0; j < inputExpansionTokens.size(); j++) {
+ TokenSet tokenSet = inputExpansionTokens.get(j);
+ OutputPinActivation groupInput = activationGroup.groupInputs.get(j);
+ groupInput.clearTokens();
+ if(tokenSet.tokens.size() >= activationGroup.index) {
+ groupInput.addToken(tokenSet.tokens.get(activationGroup.index - 1));
+ }
+ groupInput.sendUnofferedTokens();
+ }
+ activationGroup.run(activationGroup.nodeActivations);
+ this.terminateGroup(activationGroup);
+ }
+ }
+
+ public void terminateGroup(ExpansionActivationGroup activationGroup) {
+ // Terminate the given activation group, after preserving any group
+ // outputs.
+ if(this.isRunning() & !this.isSuspended()) {
+ List<OutputPinActivation> groupOutputs = activationGroup.groupOutputs;
+ for(int i = 0; i < groupOutputs.size(); i++) {
+ OutputPinActivation groupOutput = groupOutputs.get(i);
+ groupOutput.fire(groupOutput.takeOfferedTokens());
+ }
+ activationGroup.terminateAll();
+ }
+ }
+
+ public ExpansionNodeActivation getExpansionNodeActivation(ExpansionNode node) {
+ // Return the expansion node activation corresponding to the given
+ // expansion node, in the context of the activity node activation group
+ // this expansion region activation is in.
+ // [Note: Expansion regions do not own their expansion nodes. Instead,
+ // they are own as object nodes by the enclosing activity or group.
+ // Therefore, they will already be activated along with their expansion
+ // region.]
+ return (ExpansionNodeActivation)(this.group.getNodeActivation(node));
+ }
+
+ public Integer numberOfValues() {
+ // Return the number of values to be acted on by the expansion region of
+ // this activation, which is the minimum of the number of values offered
+ // to each of the input expansion nodes of the activation.
+ ExpansionRegion region = (ExpansionRegion)(this.node);
+ List<ExpansionNode> inputElements = region.getInputElements();
+ int n = this.getExpansionNodeActivation(inputElements.get(0)).countOfferedValues();
+ int i = 2;
+ while(i <= inputElements.size()) {
+ int count = this.getExpansionNodeActivation(inputElements.get(i - 1)).countOfferedValues();
+ if(count < n) {
+ n = count;
+ }
+ i = i + 1;
+ }
+ return n;
+ }
+
+ public Boolean isSuspended() {
+ // Check if the activation group for this node is suspended.
+ boolean suspended = false;
+ int i = 1;
+ while(i <= this.activationGroups.size() & !suspended) {
+ ActivityNodeActivationGroup group = this.activationGroups.get(i - 1);
+ suspended = group.isSuspended();
+ i = i + 1;
+ }
+ return suspended;
+ }
+
+ public void resume(ExpansionActivationGroup activationGroup) {
+ // Resume an expansion region after the suspension of the given
+ // activation group. If the region is iterative, then continue with the
+ // iteration. If the region is parallel, and there are no more suspended
+ // activation groups, then generate the expansion node output.
+ ExpansionRegion region = (ExpansionRegion)this.node;
+ this.resume();
+ this.terminateGroup(activationGroup);
+ if(region.getMode() == ExpansionKind.ITERATIVE_LITERAL) {
+ this.runIterative();
+ }
+ this.doOutput();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/TokenSet.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/TokenSet.java
new file mode 100644
index 00000000000..c1974e1f452
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/ExtraStructuredActivities/TokenSet.java
@@ -0,0 +1,27 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.ExtraStructuredActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities.Token;
+
+public class TokenSet {
+
+ /*
+ * The set of tokens in this input set.
+ */
+ public List<Token> tokens = new ArrayList<Token>();
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityEdgeInstance.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityEdgeInstance.java
new file mode 100644
index 00000000000..56c3ee900df
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityEdgeInstance.java
@@ -0,0 +1,202 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.core.Activator;
+import org.eclipse.papyrus.moka.MokaConstants;
+import org.eclipse.papyrus.moka.communication.event.isuspendresume.Suspend_Event;
+import org.eclipse.papyrus.moka.debug.MokaStackFrame;
+import org.eclipse.papyrus.moka.debug.MokaThread;
+import org.eclipse.papyrus.moka.fuml.FUMLExecutionEngine;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.StackFrameManager;
+import org.eclipse.papyrus.moka.fuml.presentation.FUMLPresentationUtils;
+import org.eclipse.papyrus.moka.ui.presentation.AnimationUtils;
+import org.eclipse.uml2.uml.ActivityEdge;
+
+public class ActivityEdgeInstance {
+
+ /*
+ * The activity edge of which this is an instance. [This is optional to
+ * allow for an implicit fork node execution to be connected to its action
+ * execution by an edge instance which does not have a corresponding node in
+ * the model.]
+ */
+ public ActivityEdge edge;
+
+ /*
+ * The activity group that contains this activity edge instance.
+ */
+ public ActivityNodeActivationGroup group;
+
+ /*
+ * The source of this activity edge instance. The node of the source must be
+ * the same as the source of the edge of this edge instance.
+ */
+ public ActivityNodeActivation source;
+
+ /*
+ * The target of this activity edge instance. The node of the target must be
+ * the same as the target of the edge of this edge instance.
+ */
+ public ActivityNodeActivation target;
+
+ public List<Offer> offers = new ArrayList<Offer>();
+
+ public void sendOffer(List<Token> tokens) {
+ // Send an offer from the source to the target.
+ // Keep the offered tokens until taken by the target.
+ // (Note that any one edge should only be handling either all object
+ // tokens or all control tokens.)
+ Offer offer = new Offer();
+ for(int i = 0; i < tokens.size(); i++) {
+ Token token = tokens.get(i);
+ // Debug.println("[sendOffer] token value = " + token.get());
+ offer.offeredTokens.add(token);
+ }
+ this.offers.add(offer);
+
+ // Connection with the debug api
+ if (this.group != null) { // TODO : Understand why group may be null
+ Locus locus = this.group.getActivityExecution().locus ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ boolean animationMarkerNeedsToBeRemoved = false ;
+ long date = 0 ;
+ if (MokaConstants.MOKA_AUTOMATIC_ANIMATION) {
+ date = System.currentTimeMillis() ;
+ AnimationUtils.getInstance().addAnimationMarker(edge) ;
+ animationMarkerNeedsToBeRemoved = true ;
+ }
+ MokaStackFrame stackFrame = FUMLPresentationUtils.getMokaStackFrame(this) ;
+ //stackFrame.setModelElement(this.edge) ;
+ stackFrame.setThread(locus.mainThread) ;
+ stackFrame.setName(this.edge.getName()) ;
+ StackFrameManager.getInstance().setStackFrame(this.group.getActivityExecution(), stackFrame) ;
+ int reasonForSuspending = FUMLExecutionEngine.controlDelegate.shallSuspend(this.group.getActivityExecution(), this) ;
+ if (reasonForSuspending != -1) {
+ locus.mainThread.setSuspended(true) ;
+ locus.mainThread.setStackFrames(null) ;
+ //locus.stackFrames = new MokaStackFrame[]{stackFrame} ;
+ locus.stackFrames = StackFrameManager.getInstance().getStackFrames() ;
+ Suspend_Event breakpointEvent = new Suspend_Event(locus.mainThread, reasonForSuspending, new MokaThread[]{locus.mainThread}) ;
+ locus.engine.sendEvent(breakpointEvent) ;
+ try {
+ FUMLExecutionEngine.controlDelegate.suspend(this.group.getActivityExecution()) ;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ locus.mainThread.setSuspended(false) ;
+ }
+ if (animationMarkerNeedsToBeRemoved) {
+ try {
+ long ellapsed = System.currentTimeMillis() - date ;
+ long delay = Math.max(1,MokaConstants.MOKA_ANIMATION_DELAY - ellapsed) ;
+ Thread.sleep(delay) ;
+ } catch (InterruptedException e1) {
+ Activator.log.error(e1);
+ }
+ AnimationUtils.getInstance().removeAnimationMarker(edge) ;
+ }
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ }
+
+ // End: Connection with the debug api
+
+ this.target.receiveOffer();
+ }
+
+ public Integer countOfferedValues() {
+ // Return the number of values being offered in object tokens.
+ int count = 0;
+ List<Offer> offers = this.offers;
+ for(int i = 0; i < offers.size(); i++) {
+ count = count + offers.get(i).countOfferedValues();
+ }
+ return count;
+ }
+
+ public List<Token> takeOfferedTokens() {
+ // Take all the offered tokens and return them.
+ List<Token> tokens = new ArrayList<Token>();
+ while(this.offers.size() > 0) {
+ List<Token> offeredTokens = this.offers.get(0).getOfferedTokens();
+ for(int i = 0; i < offeredTokens.size(); i++) {
+ tokens.add(offeredTokens.get(i));
+ }
+ this.offers.remove(0);
+ }
+ return tokens;
+ }
+
+ public List<Token> takeOfferedTokens(Integer maxCount) {
+ // Take all the offered tokens, up to the given maximum count of
+ // non-null object tokens, and return them.
+ List<Token> tokens = new ArrayList<Token>();
+ int remainingCount = maxCount;
+ while(this.offers.size() > 0 & remainingCount > 0) {
+ Offer offer = this.offers.get(0);
+ List<Token> offeredTokens = offer.getOfferedTokens();
+ int count = offer.countOfferedValues();
+ if(count <= remainingCount) {
+ for(int i = 0; i < offeredTokens.size(); i++) {
+ tokens.add(offeredTokens.get(i));
+ }
+ remainingCount = remainingCount - count;
+ this.offers.remove(0);
+ } else {
+ for(int i = 0; i < remainingCount; i++) {
+ Token token = offeredTokens.get(i);
+ if(token.getValue() != null) {
+ tokens.add(token);
+ }
+ }
+ offer.removeOfferedValues(remainingCount);
+ remainingCount = 0;
+ }
+ }
+ return tokens;
+ }
+
+ public List<Token> getOfferedTokens() {
+ // Get the offered tokens (after which the tokens will still be
+ // offered).
+ List<Token> tokens = new ArrayList<Token>();
+ List<Offer> offers = this.offers;
+ for(int i = 0; i < offers.size(); i++) {
+ List<Token> offeredTokens = offers.get(i).getOfferedTokens();
+ for(int j = 0; j < offeredTokens.size(); j++) {
+ tokens.add(offeredTokens.get(j));
+ }
+ }
+ return tokens;
+ }
+
+ public Boolean hasOffer() {
+ // Return true if there are any pending offers.
+ boolean hasTokens = false;
+ int i = 1;
+ while(!hasTokens & i <= this.offers.size()) {
+ hasTokens = this.offers.get(i - 1).hasTokens();
+ i = i + 1;
+ }
+ return hasTokens;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityExecution.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityExecution.java
new file mode 100644
index 00000000000..5d4ec8b35a8
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityExecution.java
@@ -0,0 +1,89 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.debug.StackFrameManager;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityParameterNode;
+
+public class ActivityExecution extends Execution {
+
+ /*
+ * The group of activations of the activity nodes of the activity.
+ */
+ public ActivityNodeActivationGroup activationGroup;
+
+ public void execute() {
+ // Execute the activity for this execution by creating an activity node
+ // activation group and activating all the activity nodes in the
+ // activity.
+ // When this is complete, copy the values on the tokens offered by
+ // output parameter nodes to the corresponding output parameters.
+ Activity activity = (Activity)(this.getTypes().get(0));
+ Debug.println("[execute] Activity " + activity.getName() + "...");
+ // Debug.println("[execute] context = " + this.context.objectId());
+ Debug.println("[event] Execute activity=" + activity.getName());
+ this.activationGroup = new ActivityNodeActivationGroup();
+ this.activationGroup.activityExecution = this;
+ this.activationGroup.activate(activity.getNodes(), activity.getEdges());
+ // Debug.println("[execute] Getting output parameter node activations...");
+ List<ActivityParameterNodeActivation> outputActivations = this.activationGroup.getOutputParameterNodeActivations();
+ // Debug.println("[execute] There are " + outputActivations.size() +
+ // " output parameter node activations.");
+ for(int i = 0; i < outputActivations.size(); i++) {
+ ActivityParameterNodeActivation outputActivation = outputActivations.get(i);
+ ParameterValue parameterValue = new ParameterValue();
+ parameterValue.parameter = ((ActivityParameterNode)(outputActivation.node)).getParameter();
+ List<Token> tokens = outputActivation.getTokens();
+ for(int j = 0; j < tokens.size(); j++) {
+ Token token = tokens.get(j);
+ Value value = ((ObjectToken)token).value;
+ if(value != null) {
+ parameterValue.values.add(value);
+ Debug.println("[event] Output activity=" + activity.getName() + " parameter=" + parameterValue.parameter.getName() + " value=" + value);
+ }
+ }
+ this.setParameterValue(parameterValue);
+ }
+ // Statement added for connection with the DebugAPI
+ StackFrameManager.getInstance().popActivityExecution() ;
+ Debug.println("[execute] Activity " + activity.getName() + " completed.");
+ }
+
+ public Value copy() {
+ // Create a new activity execution that is a copy of this execution.
+ // [Note: This currently just returns a non-executing execution for the
+ // same activity as this execution.]
+ return super.copy();
+ }
+
+ public Value new_() {
+ // Create a new activity execution with empty properties.
+ return new ActivityExecution();
+ }
+
+ public void terminate() {
+ // Terminate all node activations (which will ultimately result in the
+ // activity execution completing).
+ if (this.activationGroup != null) {
+ this.activationGroup.terminateAll();
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityFinalNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityFinalNodeActivation.java
new file mode 100644
index 00000000000..f007a76e0aa
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityFinalNodeActivation.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.ExtraStructuredActivities.ExpansionActivationGroup;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+
+public class ActivityFinalNodeActivation extends ControlNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Terminate the activity execution or structured node activation
+ // containing this activation.
+ Debug.println("[fire] Activity final node " + this.node.getName() + "...");
+ if(incomingTokens.size() > 0 | this.incomingEdges.size() == 0) {
+ if(this.group.activityExecution != null) {
+ this.group.activityExecution.terminate();
+ } else if(this.group.containingNodeActivation != null) {
+ this.group.containingNodeActivation.terminateAll();
+ } else if(this.group instanceof ExpansionActivationGroup) {
+ ((ExpansionActivationGroup)this.group).regionActivation.terminate();
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivation.java
new file mode 100644
index 00000000000..d1bf5f9a1cf
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivation.java
@@ -0,0 +1,353 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.core.Activator;
+import org.eclipse.papyrus.moka.MokaConstants;
+import org.eclipse.papyrus.moka.communication.event.isuspendresume.Suspend_Event;
+import org.eclipse.papyrus.moka.debug.MokaStackFrame;
+import org.eclipse.papyrus.moka.debug.MokaThread;
+import org.eclipse.papyrus.moka.fuml.FUMLExecutionEngine;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.SemanticVisitor;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.debug.StackFrameManager;
+import org.eclipse.papyrus.moka.fuml.presentation.FUMLPresentationUtils;
+import org.eclipse.papyrus.moka.ui.presentation.AnimationUtils;
+import org.eclipse.uml2.uml.ActivityNode;
+
+public abstract class ActivityNodeActivation extends SemanticVisitor {
+
+ /*
+ * The group that contains this activity node activation.
+ */
+ public ActivityNodeActivationGroup group;
+
+ /*
+ * The activity node being activated by this activity node activation. The
+ * node must be owned by the activity (type) of the activity execution of
+ * this node activation. [This is optional, to allow for fork node edge
+ * queues and implicit fork and join node activations for actions to not
+ * have nodes in the model.]
+ */
+ public ActivityNode node;
+
+ /*
+ * The set of activity edge instances for the incoming edges of the node.
+ */
+ public List<ActivityEdgeInstance> incomingEdges = new ArrayList<ActivityEdgeInstance>();
+
+ /*
+ * The set of activity edge instances for the outgoing edges of the node.
+ */
+ public List<ActivityEdgeInstance> outgoingEdges = new ArrayList<ActivityEdgeInstance>();
+
+ /*
+ * If true, this node activation is enabled for execution once all its other
+ * prerequesites are satisfied.
+ */
+ public Boolean running;
+
+ public List<Token> heldTokens = new ArrayList<Token>();
+
+ public void run() {
+ // Run the activation of this node.
+ if(this.node != null) {
+ Debug.println("[run] node = " + this.node.getName());
+ } else {
+ Debug.println("[run] Anonymous activation of type " + this.getClass().getName());
+ }
+ this.running = true;
+ }
+
+ public void receiveOffer() {
+ // Receive an offer from an incoming edge.
+ // Check if all prerequisites have been satisfied. If so, fire.
+ Debug.println("[receiveOffer] " + (this.node == null ? "..." : "node = " + this.node.getName()));
+ _beginIsolation();
+ boolean ready = this.isReady();
+ List<Token> tokens = new ArrayList<Token>();
+ if(ready) {
+ Debug.println("[receiveOffer] Firing.");
+ tokens = this.takeOfferedTokens();
+ }
+ _endIsolation();
+ if(ready) {
+ this.fire(tokens);
+ }
+ }
+
+ public List<Token> takeOfferedTokens() {
+ // Get tokens from all incoming edges.
+ List<Token> allTokens = new ArrayList<Token>();
+ List<ActivityEdgeInstance> incomingEdges = this.incomingEdges;
+ for(int i = 0; i < incomingEdges.size(); i++) {
+ ActivityEdgeInstance incomingEdge = incomingEdges.get(i);
+ List<Token> tokens = incomingEdge.takeOfferedTokens();
+ for(int j = 0; j < tokens.size(); j++) {
+ Token token = tokens.get(j);
+ allTokens.add(token);
+ }
+ }
+ return allTokens;
+ }
+
+ // public abstract void fire(List<Token> incomingTokens);
+
+ // This property is introduced for connection to the debug API
+ public List<Token> incomingTokens_DEBUG ;
+
+ public void fire(List<Token> incomingTokens) {
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ this.incomingTokens_DEBUG = incomingTokens ;
+ if (locus.engine.isTerminated())
+ return ;
+ boolean animationMarkerNeedsToBeRemoved = false ;
+ long date = 0 ;
+ if (MokaConstants.MOKA_AUTOMATIC_ANIMATION) {
+ date = System.currentTimeMillis() ;
+ AnimationUtils.getInstance().addAnimationMarker(node) ;
+ animationMarkerNeedsToBeRemoved = true ;
+ }
+ MokaStackFrame stackFrame = FUMLPresentationUtils.getMokaStackFrame(this) ;
+ stackFrame.setThread(locus.mainThread) ;
+ stackFrame.setName(this.node.getName()) ;
+ StackFrameManager.getInstance().setStackFrame(this.getActivityExecution(), stackFrame) ;
+ int reasonForSuspending = FUMLExecutionEngine.controlDelegate.shallSuspend(this.getActivityExecution(), this) ;
+ if (reasonForSuspending != -1) {
+ locus.mainThread.setSuspended(true) ;
+ locus.mainThread.setStackFrames(null) ;
+ //locus.stackFrames = new MokaStackFrame[]{stackFrame} ;
+ locus.stackFrames = StackFrameManager.getInstance().getStackFrames() ;
+ Suspend_Event breakpointEvent = new Suspend_Event(locus.mainThread, reasonForSuspending, new MokaThread[]{locus.mainThread}) ;
+ locus.engine.sendEvent(breakpointEvent) ;
+ try {
+ FUMLExecutionEngine.controlDelegate.suspend(this.getActivityExecution()) ;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ locus.mainThread.setSuspended(false) ;
+ }
+ if (animationMarkerNeedsToBeRemoved) {
+ try {
+ long ellapsed = System.currentTimeMillis() - date ;
+ long delay = Math.max(1,MokaConstants.MOKA_ANIMATION_DELAY - ellapsed) ;
+ Thread.sleep(delay) ;
+ } catch (InterruptedException e1) {
+ Activator.log.error(e1);
+ }
+ AnimationUtils.getInstance().removeAnimationMarker(node) ;
+ }
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ }
+ //
+
+ public void sendOffers(List<Token> tokens) {
+ // Send offers for the given set of tokens over all outgoing edges (if
+ // there are any tokens actually being offered).
+ if(tokens.size() > 0) {
+ // *** Send all outgoing offers concurrently. ***
+ List<ActivityEdgeInstance> outgoingEdges = this.outgoingEdges;
+ for(Iterator<ActivityEdgeInstance> i = outgoingEdges.iterator(); i.hasNext();) {
+ ActivityEdgeInstance outgoingEdge = i.next();
+ // Debug.println("[sendOffers] Sending offer to " +
+ // outgoingEdge.target.node.getName() + ".");
+ outgoingEdge.sendOffer(tokens);
+ }
+ }
+ }
+
+ public void terminate() {
+ // Terminate the activation of this node.
+ if(this.running) {
+ if(this.node != null) {
+ Debug.println("[terminate] node = " + this.node.getName());
+ } else {
+ Debug.println("[terminate] Anonymous activation of type " + this.getClass().getName());
+ }
+ }
+ this.running = false;
+ }
+
+ public Boolean isReady() {
+ // Check if all the prerequisites for this node have been satisfied.
+ // By default, check that this node is running.
+ return this.isRunning();
+ }
+
+ public Boolean isRunning() {
+ // Test whether this node activation is running.
+ return this.running;
+ }
+
+ public void addOutgoingEdge(ActivityEdgeInstance edge) {
+ // Add an activity edge instance as an outgoing edge of this activity
+ // node activation.
+ edge.source = this;
+ this.outgoingEdges.add(edge);
+ }
+
+ public void addIncomingEdge(ActivityEdgeInstance edge) {
+ // Add an activity edge instance as an incoming edge of this activity
+ // node activation.
+ edge.target = this;
+ this.incomingEdges.add(edge);
+ }
+
+ public void createNodeActivations() {
+ // Create node activations for any subnodes of the node for this
+ // activation.
+ // For most kinds of nodes, this does nothing.
+ return;
+ }
+
+ public void createEdgeInstances() {
+ // Create edge instances for any edge instances owned by the node for
+ // this activation.
+ // For most kinds of nodes, this does nothing.
+ return;
+ }
+
+ public Boolean isSourceFor(ActivityEdgeInstance edgeInstance) {
+ // Check if this node activation is the effective source for the given
+ // edge instance.
+ return edgeInstance.source == this;
+ }
+
+ public ActivityExecution getActivityExecution() {
+ // Return the activity execution that contains this activity node
+ // activation, directly or indirectly.
+ return this.group.getActivityExecution();
+ }
+
+ public Object_ getExecutionContext() {
+ // Get the context object for the containing activity execution.
+ return this.getActivityExecution().context;
+ }
+
+ public Locus getExecutionLocus() {
+ // Get the locus of the containing activity execution.
+ return this.getActivityExecution().locus;
+ }
+
+ public ActivityNodeActivation getNodeActivation(ActivityNode node) {
+ // Get the activity node activation corresponding to the given activity
+ // node, in the context of this activity node activation.
+ // By default, return this activity node activation, if it is for the
+ // given node, otherwise return nothing.
+ ActivityNodeActivation activation = null;
+ if(node == this.node) {
+ activation = this;
+ }
+ return activation;
+ }
+
+ public void addToken(Token token) {
+ // Transfer the given token to be held by this node.
+ if(this.node == null) {
+ Debug.println("[addToken] ...");
+ } else {
+ Debug.println("[addToken] node = " + this.node.getName());
+ }
+ Token transferredToken = token.transfer(this);
+ // Debug.println("[addToken] Adding token with value = " +
+ // transferredToken.get());
+ this.heldTokens.add(transferredToken);
+ }
+
+ public Integer removeToken(Token token) {
+ // Remove the given token, if it is held by this node activation.
+ // Return the position (counting from 1) of the removed token (0 if
+ // there is none removed).
+ boolean notFound = true;
+ int i = 1;
+ while(notFound & i <= this.heldTokens.size()) {
+ if(this.heldTokens.get(i - 1) == token) {
+ if(this.node == null) {
+ Debug.println("[removeToken] ...");
+ } else {
+ Debug.println("[removeToken] node = " + this.node.getName());
+ }
+ this.heldTokens.remove(i - 1);
+ notFound = false;
+ }
+ i = i + 1;
+ }
+ if(notFound) {
+ i = 0;
+ } else {
+ i = i - 1;
+ }
+ return i;
+ }
+
+ public void addTokens(List<Token> tokens) {
+ // Transfer the given tokens to be the held tokens for this node.
+ // if (this.node == null) {
+ // Debug.println("[addTokens] ...");
+ // } else {
+ // Debug.println("[addTokens] node = " + this.node.getName());
+ // }
+ for(int i = 0; i < tokens.size(); i++) {
+ Token token = tokens.get(i);
+ this.addToken(token);
+ }
+ }
+
+ public List<Token> takeTokens() {
+ // Take the tokens held by this node activation.
+ List<Token> tokens = this.getTokens();
+ this.clearTokens();
+ return tokens;
+ }
+
+ public void clearTokens() {
+ // Remove all held tokens.
+ while(this.heldTokens.size() > 0) {
+ this.heldTokens.get(0).withdraw();
+ }
+ }
+
+ public List<Token> getTokens() {
+ // Get the tokens held by this node activation.
+ // Debug.println("[getTokens] node = " + this.node.getName());
+ List<Token> tokens = new ArrayList<Token>();
+ List<Token> heldTokens = this.heldTokens;
+ for(int i = 0; i < heldTokens.size(); i++) {
+ Token heldToken = heldTokens.get(i);
+ // Debug.println("[getTokens] token value = " +
+ // heldTokens.get());
+ tokens.add(heldToken);
+ }
+ return tokens;
+ }
+
+ public void suspend() {
+ // Suspend this activation within the activation group that contains it.
+ this.group.suspend(this);
+ }
+
+ public void resume() {
+ // Resume this activation within the activation group that contains it.
+ this.group.resume(this);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivationGroup.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivationGroup.java
new file mode 100644
index 00000000000..c054cf22d01
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityNodeActivationGroup.java
@@ -0,0 +1,313 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Actions.BasicActions.ActionActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.Activities.CompleteStructuredActivities.StructuredActivityNodeActivation;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.ActivityEdge;
+import org.eclipse.uml2.uml.ActivityNode;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.Pin;
+
+public class ActivityNodeActivationGroup {
+
+ /*
+ * The set of activity edge instances for this group.
+ */
+ public List<ActivityEdgeInstance> edgeInstances = new ArrayList<ActivityEdgeInstance>();
+
+ /*
+ * The set of activity node executions for this group.
+ */
+ public List<ActivityNodeActivation> nodeActivations = new ArrayList<ActivityNodeActivation>();
+
+ /*
+ * The activity execution to which this group belongs. (This will be empty
+ * if the group is for a structured activity node activation.)
+ */
+ public ActivityExecution activityExecution;
+
+ /*
+ * The structured activity node activation to which this group belongs.
+ * (This will be empty if the group is for an activity execution.)
+ */
+ public StructuredActivityNodeActivation containingNodeActivation;
+
+ /*
+ * Activity node activations in this activation group that are suspended
+ * waiting for an event occurrence. If an activation group has a containing
+ * node activation and any suspended activations, then the containing node
+ * activation will also be suspended.
+ */
+ public List<ActivityNodeActivation> suspendedActivations = new ArrayList<ActivityNodeActivation>();
+
+ public void run(List<ActivityNodeActivation> activations) {
+ // Run the given node activations and then (concurrently) send an offer
+ // to all activations for nodes with no incoming edges within the given
+ // set.
+ for(int i = 0; i < activations.size(); i++) {
+ ActivityNodeActivation activation = activations.get(i);
+ activation.run();
+ }
+ Debug.println("[run] Checking for enabled nodes...");
+ List<ActivityNodeActivation> enabledActivations = new ArrayList<ActivityNodeActivation>();
+ for(int i = 0; i < activations.size(); i++) {
+ ActivityNodeActivation activation = activations.get(i);
+ Debug.println("[run] Checking node " + activation.node.getName() + "...");
+ if(activation instanceof ActionActivation | activation instanceof ControlNodeActivation | activation instanceof ActivityParameterNodeActivation) {
+ boolean isEnabled = this.checkIncomingEdges(activation.incomingEdges, activations);
+ // For an action activation, also consider incoming edges to
+ // input pins
+ if(isEnabled & activation instanceof ActionActivation) {
+ List<InputPin> inputPins = ((Action)activation.node).getInputs();
+ int j = 1;
+ while(j <= inputPins.size() & isEnabled) {
+ InputPin inputPin = inputPins.get(j - 1);
+ List<ActivityEdgeInstance> inputEdges = ((ActionActivation)activation).getPinActivation(inputPin).incomingEdges;
+ isEnabled = this.checkIncomingEdges(inputEdges, activations);
+ j = j + 1;
+ }
+ }
+ if(isEnabled) {
+ Debug.println("[run] Node " + activation.node.getName() + " is enabled.");
+ enabledActivations.add(activation);
+ }
+ }
+ }
+ // Debug.println("[run] " + enabledActivations.size() +
+ // " node(s) are enabled.");
+ // *** Send offers to all enabled nodes concurrently. ***
+ for(Iterator<ActivityNodeActivation> i = enabledActivations.iterator(); i.hasNext();) {
+ ActivityNodeActivation activation = i.next();
+ Debug.println("[run] Sending offer to node " + activation.node.getName() + ".");
+ activation.receiveOffer();
+ }
+ }
+
+ public Boolean checkIncomingEdges(List<ActivityEdgeInstance> incomingEdges, List<ActivityNodeActivation> activations) {
+ // Check if any incoming edges have a source in a given set of
+ // activations.
+ int j = 1;
+ boolean notFound = true;
+ while(j <= incomingEdges.size() & notFound) {
+ int k = 1;
+ while(k <= activations.size() & notFound) {
+ if(activations.get(k - 1).isSourceFor(incomingEdges.get(j - 1))) {
+ notFound = false;
+ }
+ k = k + 1;
+ }
+ j = j + 1;
+ }
+ return notFound;
+ }
+
+ public void runNodes(List<ActivityNode> nodes) {
+ // Run the node activations associated with the given nodes in this
+ // activation group.
+ List<ActivityNodeActivation> nodeActivations = new ArrayList<ActivityNodeActivation>();
+ for(int i = 0; i < nodes.size(); i++) {
+ ActivityNode node = nodes.get(i);
+ ActivityNodeActivation nodeActivation = this.getNodeActivation(node);
+ if(nodeActivation != null) {
+ nodeActivations.add(nodeActivation);
+ }
+ }
+ this.run(nodeActivations);
+ }
+
+ public void activate(List<ActivityNode> nodes, List<ActivityEdge> edges) {
+ // Activate and run the given set of nodes with the given set of edges,
+ // within this activation group.
+ this.createNodeActivations(nodes);
+ this.createEdgeInstances(edges);
+ this.run(this.nodeActivations);
+ // Debug.println("[activate] Exiting.");
+ }
+
+ public void terminateAll() {
+ // Terminate all node activations in the group.
+ Debug.println("[terminateAll] Terminating activation group for " + (this.activityExecution != null ? "activity " + this.activityExecution.getTypes().get(0).getName() : this.containingNodeActivation != null ? "node " + this.containingNodeActivation.node.getName() : "expansion region") + ".");
+ List<ActivityNodeActivation> nodeActivations = this.nodeActivations;
+ for(int i = 0; i < nodeActivations.size(); i++) {
+ ActivityNodeActivation nodeActivation = nodeActivations.get(i);
+ nodeActivation.terminate();
+ }
+ this.suspendedActivations.clear();
+ }
+
+ public void createNodeActivations(List<ActivityNode> nodes) {
+ // Add activity node activations for the given set of nodes to this
+ // group and create edge instances between them.
+ for(int i = 0; i < nodes.size(); i++) {
+ ActivityNode node = nodes.get(i);
+ Debug.println("[createNodeActivations] Creating a node activation for " + node.getName() + "...");
+ this.createNodeActivation(node);
+ }
+ }
+
+ public ActivityNodeActivation createNodeActivation(ActivityNode node) {
+ // Create an activity node activation for a given activity node in this
+ // activity node activation group.
+ ActivityNodeActivation activation = (ActivityNodeActivation)(this.getActivityExecution().locus.factory.instantiateVisitor(node));
+ activation.node = node;
+ activation.running = false;
+ this.addNodeActivation(activation);
+ activation.createNodeActivations();
+ return activation;
+ }
+
+ public void addNodeActivation(ActivityNodeActivation activation) {
+ // Add the given node activation to this group.
+ activation.group = this;
+ this.nodeActivations.add(activation);
+ }
+
+ public ActivityNodeActivation getNodeActivation(ActivityNode node) {
+ // Return the node activation (if any) in this group,
+ // or any nested group, corresponding to the given activity node.
+ // If this is a group for a structured activity node activation,
+ // also include the pin activations for that node activation.
+ ActivityNodeActivation activation = null;
+ if(this.containingNodeActivation != null && node instanceof Pin) {
+ activation = this.containingNodeActivation.getPinActivation((Pin)node);
+ }
+ if(activation == null) {
+ int i = 1;
+ while(activation == null & i <= this.nodeActivations.size()) {
+ activation = this.nodeActivations.get(i - 1).getNodeActivation(node);
+ i = i + 1;
+ }
+ }
+ return activation;
+ }
+
+ public void createEdgeInstances(List<ActivityEdge> edges) {
+ // Create instance edges for the given activity edges, as well as for
+ // edge instances within any nodes activated in this group.
+ for(int i = 0; i < edges.size(); i++) {
+ ActivityEdge edge = edges.get(i);
+ Debug.println("[createEdgeInstances] Creating an edge instance from " + edge.getSource().getName() + " to " + edge.getTarget().getName() + ".");
+ ActivityEdgeInstance edgeInstance = new ActivityEdgeInstance();
+ edgeInstance.edge = edge;
+ this.addEdgeInstance(edgeInstance);
+ this.getNodeActivation(edge.getSource()).addOutgoingEdge(edgeInstance);
+ this.getNodeActivation(edge.getTarget()).addIncomingEdge(edgeInstance);
+ // Debug.println("[createEdgeInstances] Edge instance created...");
+ }
+ List<ActivityNodeActivation> nodeActivations = this.nodeActivations;
+ for(int i = 0; i < nodeActivations.size(); i++) {
+ ActivityNodeActivation nodeActivation = nodeActivations.get(i);
+ nodeActivation.createEdgeInstances();
+ }
+ // Debug.println("[createEdgeInstances] Done creating edge instances.");
+ }
+
+ public void addEdgeInstance(ActivityEdgeInstance instance) {
+ // Add the given edge instance to this group.
+ instance.group = this;
+ this.edgeInstances.add(instance);
+ }
+
+ public ActivityExecution getActivityExecution() {
+ // Return the activity execution to which this group belongs, directly
+ // or indirectly.
+ ActivityExecution activityExecution = this.activityExecution;
+ if(activityExecution == null) {
+ activityExecution = this.containingNodeActivation.group.getActivityExecution();
+ }
+ // Debug.println("[getActivityExecution] activityExecution = " +
+ // activityExecution);
+ return activityExecution;
+ }
+
+ public List<ActivityParameterNodeActivation> getOutputParameterNodeActivations() {
+ // Return the set of all activations in this group of activity parameter
+ // nodes for output (inout, out and return) parameters.
+ List<ActivityParameterNodeActivation> parameterNodeActivations = new ArrayList<ActivityParameterNodeActivation>();
+ List<ActivityNodeActivation> nodeActivations = this.nodeActivations;
+ for(int i = 0; i < nodeActivations.size(); i++) {
+ ActivityNodeActivation activation = nodeActivations.get(i);
+ if(activation instanceof ActivityParameterNodeActivation) {
+ if(activation.incomingEdges.size() > 0) {
+ parameterNodeActivations.add((ActivityParameterNodeActivation)activation);
+ }
+ }
+ }
+ return parameterNodeActivations;
+ }
+
+ public Boolean hasSourceFor(ActivityEdgeInstance edgeInstance) {
+ // Returns true if this activation group has a node activation
+ // corresponding to the source of the given edge instance.
+ boolean hasSource = false;
+ List<ActivityNodeActivation> activations = this.nodeActivations;
+ int i = 1;
+ while(!hasSource & i <= activations.size()) {
+ hasSource = activations.get(i - 1).isSourceFor(edgeInstance);
+ i = i + 1;
+ }
+ return hasSource;
+ }
+
+ public Boolean isSuspended() {
+ // Check if this activitation group has any suspended activations and
+ // is,
+ // therefore, itself suspended.
+ return this.suspendedActivations.size() > 0;
+ }
+
+ public void suspend(ActivityNodeActivation activation) {
+ // Suspend the given activation in this activation group. If this is
+ // the only suspended activation, and the activation group has a
+ // containing node activation, then suspend that containing activation.
+ Debug.println("[suspend] node=" + (activation.node == null ? "null" : activation.node.getName()));
+ if(!this.isSuspended()) {
+ StructuredActivityNodeActivation containingNodeActivation = this.containingNodeActivation;
+ if(containingNodeActivation != null) {
+ containingNodeActivation.suspend();
+ }
+ }
+ this.suspendedActivations.add(activation);
+ }
+
+ public void resume(ActivityNodeActivation activation) {
+ // Resume the given activation by removing it from the suspended
+ // activation list for this activation group. If this is the last
+ // suspended activation, and the activation group has a containing
+ // node activation, then resume that containing activation.
+ Debug.println("[resume] node=" + (activation.node == null ? "null" : activation.node.getName()));
+ boolean found = false;
+ int i = 1;
+ while(!found & i <= this.suspendedActivations.size()) {
+ if(this.suspendedActivations.get(i - 1) == activation) {
+ this.suspendedActivations.remove(i - 1);
+ found = true;
+ }
+ i = i + 1;
+ }
+ if(!this.isSuspended()) {
+ StructuredActivityNodeActivation containingNodeActivation = this.containingNodeActivation;
+ if(containingNodeActivation != null) {
+ containingNodeActivation.resume();
+ }
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityParameterNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityParameterNodeActivation.java
new file mode 100644
index 00000000000..0f9c7d372bb
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ActivityParameterNodeActivation.java
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.uml2.uml.ActivityParameterNode;
+import org.eclipse.uml2.uml.Parameter;
+
+public class ActivityParameterNodeActivation extends ObjectNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // If there are no incoming edges, this is an activation of an input
+ // activity parameter node.
+ // Get the values from the input parameter indicated by the activity
+ // parameter node and offer those values as object tokens.
+ if(this.node.getIncomings().size() == 0) {
+ Debug.println("[fire] Input activity parameter node " + this.node.getName() + "...");
+ Parameter parameter = ((ActivityParameterNode)(this.node)).getParameter();
+ ParameterValue parameterValue = this.getActivityExecution().getParameterValue(parameter);
+ // Debug.println("[fire] parameter = " + parameter.name);
+ if(parameterValue != null) {
+ Debug.println("[fire] Parameter has " + parameterValue.values.size() + " value(s).");
+ // List<Token> tokens = new ArrayList<Token>();
+ List<Value> values = parameterValue.values;
+ for(int i = 0; i < values.size(); i++) {
+ Value value = values.get(i);
+ ObjectToken token = new ObjectToken();
+ token.value = value;
+ this.addToken(token);
+ }
+ this.sendUnofferedTokens();
+ }
+ }
+ // If there are one or more incoming edges, this is an activation of an
+ // output activity parameter node.
+ // Take the tokens offered on incoming edges and add them to the set of
+ // tokens being offered.
+ // [Note that an output activity parameter node may fire multiple times,
+ // accumulating tokens offered to it.]
+ else {
+ Debug.println("[fire] Output activity parameter node " + this.node.getName() + "...");
+ this.addTokens(incomingTokens);
+ }
+ }
+
+ public void clearTokens() {
+ // Clear all held tokens only if this is an input parameter node.
+ if(this.node.getIncomings().size() == 0) {
+ super.clearTokens();
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlNodeActivation.java
new file mode 100644
index 00000000000..aca82d2b7f1
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlNodeActivation.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public abstract class ControlNodeActivation extends ActivityNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // By default, offer all tokens on all outgoing edges.
+ if(this.node != null) {
+ Debug.println("[fire] Control node " + this.node.getName() + "...");
+ }
+ this.sendOffers(incomingTokens);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlToken.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlToken.java
new file mode 100644
index 00000000000..956eec05cfe
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ControlToken.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+
+public class ControlToken extends Token {
+
+ public Boolean equals(Token other) {
+ // Return true if the other token is a control token, because control
+ // tokens are interchangable.
+ return other instanceof ControlToken;
+ }
+
+ public Token copy() {
+ // Return a new control token.
+ return new ControlToken();
+ }
+
+ public Boolean isControl() {
+ // Return true for a control token.
+ return true;
+ }
+
+ public Value getValue() {
+ // Control tokens do not have values.
+ return null;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/DecisionNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/DecisionNodeActivation.java
new file mode 100644
index 00000000000..5f54b89788a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/DecisionNodeActivation.java
@@ -0,0 +1,313 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.core.Activator;
+import org.eclipse.papyrus.moka.MokaConstants;
+import org.eclipse.papyrus.moka.communication.event.isuspendresume.Suspend_Event;
+import org.eclipse.papyrus.moka.debug.MokaStackFrame;
+import org.eclipse.papyrus.moka.debug.MokaThread;
+import org.eclipse.papyrus.moka.fuml.FUMLExecutionEngine;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.debug.StackFrameManager;
+import org.eclipse.papyrus.moka.fuml.presentation.FUMLPresentationUtils;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.ui.presentation.AnimationUtils;
+import org.eclipse.uml2.uml.ActivityEdge;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.DecisionNode;
+import org.eclipse.uml2.uml.ObjectFlow;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class DecisionNodeActivation extends ControlNodeActivation {
+
+ /*
+ * The current execution of the decision input behavior (if any).
+ */
+ public Execution decisionInputExecution;
+
+ public void fire(List<Token> incomingTokens) {
+ // Inserted for connection with the debug api
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ boolean animationMarkerNeedsToBeRemoved = false ;
+ long date = 0 ;
+ this.incomingTokens_DEBUG = incomingTokens ;
+ if (locus.engine.isTerminated())
+ return ;
+ if (MokaConstants.MOKA_AUTOMATIC_ANIMATION) {
+ date = System.currentTimeMillis() ;
+ AnimationUtils.getInstance().addAnimationMarker(node) ;
+ animationMarkerNeedsToBeRemoved = true ;
+ }
+ MokaStackFrame stackFrame = FUMLPresentationUtils.getMokaStackFrame(this) ;
+ stackFrame.setThread(locus.mainThread) ;
+ stackFrame.setName(this.node.getName()) ;
+ StackFrameManager.getInstance().setStackFrame(this.getActivityExecution(), stackFrame) ;
+ int reasonForSuspending = FUMLExecutionEngine.controlDelegate.shallSuspend(this.getActivityExecution(), this) ;
+ if (reasonForSuspending != -1) {
+ locus.mainThread.setSuspended(true) ;
+ locus.mainThread.setStackFrames(null) ;
+ //locus.stackFrames = new MokaStackFrame[]{stackFrame} ;
+ locus.stackFrames = StackFrameManager.getInstance().getStackFrames() ;
+ Suspend_Event breakpointEvent = new Suspend_Event(locus.mainThread, reasonForSuspending, new MokaThread[]{locus.mainThread}) ;
+ locus.engine.sendEvent(breakpointEvent) ;
+ try {
+ FUMLExecutionEngine.controlDelegate.suspend(this.getActivityExecution()) ;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ locus.mainThread.setSuspended(false) ;
+ }
+ if (animationMarkerNeedsToBeRemoved) {
+ try {
+ long ellapsed = System.currentTimeMillis() - date ;
+ long delay = Math.max(1,MokaConstants.MOKA_ANIMATION_DELAY - ellapsed) ;
+ Thread.sleep(delay) ;
+ } catch (InterruptedException e1) {
+ Activator.log.error(e1);
+ }
+ AnimationUtils.getInstance().removeAnimationMarker(node) ;
+ }
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Get the decision values and test them on each guard.
+ // Forward the offer over the edges for which the test succeeds.
+ Debug.println("[fire] Decision node " + this.node.getName() + "...");
+ // List<Token> incomingTokens = this.takeOfferedTokens();
+ List<Token> removedControlTokens = this.removeJoinedControlTokens(incomingTokens);
+ List<Value> decisionValues = this.getDecisionValues(incomingTokens);
+ List<ActivityEdgeInstance> outgoingEdges = this.outgoingEdges;
+ for(int i = 0; i < outgoingEdges.size(); i++) {
+ ActivityEdgeInstance edgeInstance = outgoingEdges.get(i);
+ ValueSpecification guard = edgeInstance.edge.getGuard();
+ List<Token> offeredTokens = new ArrayList<Token>();
+ for(int j = 0; j < incomingTokens.size(); j++) {
+ Token incomingToken = incomingTokens.get(j);
+ Value decisionValue = decisionValues.get(j);
+ if(this.test(guard, decisionValue)) {
+ offeredTokens.add(incomingToken);
+ }
+ }
+ if(offeredTokens.size() > 0) {
+ for(int j = 0; j < removedControlTokens.size(); j++) {
+ Token removedControlToken = removedControlTokens.get(j);
+ offeredTokens.add(removedControlToken);
+ }
+ edgeInstance.sendOffer(offeredTokens);
+ }
+ }
+ }
+
+ public List<Value> getDecisionValues(List<Token> incomingTokens) {
+ // If there is neither a decision input flow nor a decision input
+ // behavior, then return the set of values from the incoming tokens.
+ // [In this case, the single incoming edge must be an object flow.]
+ // If there is a decision input flow, but no decision input behavior,
+ // then return a list of the decision input values equal in size to the
+ // number of incoming tokens.
+ // If there is both a decision input flow and a decision input behavior,
+ // then execute the decision input behavior once for each incoming token
+ // and return the set of resulting values.
+ // If the primary incoming edge is an object flow, then the value on
+ // each object token is passed to the decision input behavior, along
+ // with the decision input flow value, if any.
+ // If the primary incoming edge is a control flow, then the decision
+ // input behavior only receives the decision input flow, if any.
+ Value decisionInputValue = this.getDecisionInputFlowValue();
+ List<Value> decisionValues = new ArrayList<Value>();
+ for(int i = 0; i < incomingTokens.size(); i++) {
+ Token incomingToken = incomingTokens.get(i);
+ Value value = this.executeDecisionInputBehavior(incomingToken.getValue(), decisionInputValue);
+ decisionValues.add(value);
+ }
+ // Debug.println("[getDecisionValues] " + decisionValues.size() +
+ // " decision value(s):");
+ for(int i = 0; i < decisionValues.size(); i++) {
+ Value decisionValue = decisionValues.get(i);
+ Debug.println("[getDecisionValues] decisionValues[" + i + "] = " + decisionValue);
+ }
+ return decisionValues;
+ }
+
+ public Value executeDecisionInputBehavior(Value inputValue, Value decisionInputValue) {
+ // Create the decision input execution from the decision input behavior.
+ // If the behavior has input parameter(s), set the input parameter(s) of
+ // the execution to the given value(s).
+ // Execute the decision input execution and then remove it.
+ // Return the value of the output parameter of the execution.
+ // If there is no decision input behavior, the decision input value is
+ // returned, if one is given, otherwise the input value is used as the
+ // decision value.
+ Debug.println("[executeDecisionBehavior] inputValue = " + inputValue);
+ Behavior decisionInputBehavior = ((DecisionNode)(this.node)).getDecisionInput();
+ Value decisionInputResult = null;
+ if(decisionInputBehavior == null) {
+ if(decisionInputValue != null) {
+ decisionInputResult = decisionInputValue;
+ } else {
+ decisionInputResult = inputValue;
+ }
+ } else {
+ this.decisionInputExecution = this.getExecutionLocus().factory.createExecution(decisionInputBehavior, this.getExecutionContext());
+ int i = 1;
+ int j = 0;
+ while((j == 0 | (j == 1 & decisionInputValue != null)) & i <= decisionInputBehavior.getOwnedParameters().size()) {
+ Parameter parameter = decisionInputBehavior.getOwnedParameters().get(i - 1);
+ if(parameter.getDirection().equals(ParameterDirectionKind.IN_LITERAL) | parameter.getDirection().equals(ParameterDirectionKind.INOUT_LITERAL)) {
+ ParameterValue inputParameterValue = new ParameterValue();
+ inputParameterValue.parameter = parameter;
+ j = j + 1;
+ if(j == 1 && inputValue != null) {
+ inputParameterValue.values.add(inputValue);
+ } else {
+ inputParameterValue.values.add(decisionInputValue);
+ }
+ this.decisionInputExecution.setParameterValue(inputParameterValue);
+ }
+ i = i + 1;
+ }
+ this.decisionInputExecution.execute();
+ List<ParameterValue> outputParameterValues = this.decisionInputExecution.getOutputParameterValues();
+ decisionInputExecution.destroy();
+ decisionInputResult = outputParameterValues.get(0).values.get(0);
+ }
+ return decisionInputResult;
+ }
+
+ public void terminate() {
+ // Terminate the decision input execution, if any, and then terminate
+ // this activation.
+ if(this.decisionInputExecution != null) {
+ this.decisionInputExecution.terminate();
+ }
+ super.terminate();
+ }
+
+ public Boolean isReady() {
+ // Check that all incoming edges have sources that are offering tokens.
+ // [This should be at most two incoming edges, if there is a decision
+ // input flow.]
+ int i = 1;
+ boolean ready = true;
+ while(ready & i <= this.incomingEdges.size()) {
+ ready = this.incomingEdges.get(i - 1).hasOffer();
+ i = i + 1;
+ }
+ return ready;
+ }
+
+ public List<Token> takeOfferedTokens() {
+ // Get tokens from the incoming edge that is not the decision input
+ // flow.
+ ObjectFlow decisionInputFlow = ((DecisionNode)(this.node)).getDecisionInputFlow();
+ List<Token> allTokens = new ArrayList<Token>();
+ List<ActivityEdgeInstance> incomingEdges = this.incomingEdges;
+ for(int i = 0; i < incomingEdges.size(); i++) {
+ ActivityEdgeInstance edgeInstance = incomingEdges.get(i);
+ if(edgeInstance.edge != decisionInputFlow) {
+ List<Token> tokens = edgeInstance.takeOfferedTokens();
+ for(int j = 0; j < tokens.size(); j++) {
+ allTokens.add(tokens.get(j));
+ }
+ }
+ }
+ return allTokens;
+ }
+
+ public Value getDecisionInputFlowValue() {
+ // Take the next token available on the decision input flow, if any, and
+ // return its value.
+ ActivityEdgeInstance decisionInputFlowInstance = this.getDecisionInputFlowInstance();
+ Value value = null;
+ if(decisionInputFlowInstance != null) {
+ List<Token> tokens = decisionInputFlowInstance.takeOfferedTokens();
+ if(tokens.size() > 0) {
+ value = tokens.get(0).getValue();
+ }
+ }
+ return value;
+ }
+
+ public ActivityEdgeInstance getDecisionInputFlowInstance() {
+ // Get the activity edge instance for the decision input flow, if any.
+ ActivityEdge decisionInputFlow = ((DecisionNode)(this.node)).getDecisionInputFlow();
+ ActivityEdgeInstance edgeInstance = null;
+ if(decisionInputFlow != null) {
+ int i = 1;
+ while(edgeInstance == null & i <= this.incomingEdges.size()) {
+ ActivityEdgeInstance incomingEdge = this.incomingEdges.get(i - 1);
+ if(incomingEdge.edge == decisionInputFlow) {
+ edgeInstance = incomingEdge;
+ }
+ i = i + 1;
+ }
+ }
+ return edgeInstance;
+ }
+
+ public Boolean test(ValueSpecification guard, Value value) {
+ // Test if the given value matches the guard. If there is no guard,
+ // return true.
+ boolean guardResult = true;
+ if(guard != null) {
+ Value guardValue = this.getExecutionLocus().executor.evaluate(guard);
+ guardResult = guardValue.equals(value);
+ }
+ return guardResult;
+ }
+
+ public List<Token> removeJoinedControlTokens(List<Token> incomingTokens) {
+ // If the primary incoming edge is an object flow, then remove any
+ // control tokens from the incoming tokens and return them.
+ // [Control tokens may effectively be offered on an object flow outgoing
+ // from a join node that has both control and object flows incoming.]
+ List<Token> removedControlTokens = new ArrayList<Token>();
+ if(this.hasObjectFlowInput()) {
+ int i = 1;
+ while(i <= incomingTokens.size()) {
+ Token token = incomingTokens.get(i - 1);
+ if(token.isControl()) {
+ removedControlTokens.add(token);
+ incomingTokens.remove(i - 1);
+ i = i - 1;
+ }
+ i = i + 1;
+ }
+ }
+ return removedControlTokens;
+ }
+
+ public Boolean hasObjectFlowInput() {
+ // Check that the primary incoming edge is an object flow.
+ ActivityEdge decisionInputFlow = ((DecisionNode)(this.node)).getDecisionInputFlow();
+ boolean isObjectFlow = false;
+ int i = 1;
+ while(!isObjectFlow & i <= this.incomingEdges.size()) {
+ ActivityEdge edge = this.incomingEdges.get(i - 1).edge;
+ isObjectFlow = edge != decisionInputFlow & edge instanceof ObjectFlow;
+ i = i + 1;
+ }
+ return isObjectFlow;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/FlowFinalNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/FlowFinalNodeActivation.java
new file mode 100644
index 00000000000..f08df12bb25
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/FlowFinalNodeActivation.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class FlowFinalNodeActivation extends ControlNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Consume all incoming tokens.
+ Debug.println("[fire] Flow final node " + this.node.getName() + "...");
+ for(int i = 0; i < incomingTokens.size(); i++) {
+ Token token = incomingTokens.get(i);
+ token.withdraw();
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkNodeActivation.java
new file mode 100644
index 00000000000..6f1f2852d32
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkNodeActivation.java
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+public class ForkNodeActivation extends ControlNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ if (this.group != null) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ }
+ // Create forked tokens for all incoming tokens and offer them on all
+ // outgoing edges.
+ if(this.node == null) {
+ Debug.println("[fire] Anonymous fork node.");
+ } else {
+ Debug.println("[fire] Fork node " + this.node.getName() + "...");
+ }
+ List<ActivityEdgeInstance> outgoingEdges = this.outgoingEdges;
+ int outgoingEdgeCount = outgoingEdges.size();
+ List<Token> forkedTokens = new ArrayList<Token>();
+ for(int i = 0; i < incomingTokens.size(); i++) {
+ Token token = incomingTokens.get(i);
+ ForkedToken forkedToken = new ForkedToken();
+ forkedToken.baseToken = token;
+ forkedToken.remainingOffersCount = outgoingEdgeCount;
+ forkedToken.baseTokenIsWithdrawn = false;
+ forkedTokens.add(forkedToken);
+ }
+ this.addTokens(forkedTokens);
+ this.sendOffers(forkedTokens);
+ }
+
+ public void terminate() {
+ // Remove any offered tokens and terminate.
+ this.clearTokens();
+ super.terminate();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkedToken.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkedToken.java
new file mode 100644
index 00000000000..4a34e88eef6
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ForkedToken.java
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+
+public class ForkedToken extends Token {
+
+ public Token baseToken;
+
+ /*
+ * The remaining number of outstanding offers for this token on outgoing
+ * edges of the fork node.
+ */
+ public Integer remainingOffersCount;
+
+ /*
+ * Indicates whether withdraw() has been called on the base token.
+ */
+ public Boolean baseTokenIsWithdrawn;
+
+ public Boolean isControl() {
+ // Test if the base token is a control token.
+ return this.baseToken.isControl();
+ }
+
+ public void withdraw() {
+ // If the base token is not withdrawn, then withdraw it.
+ // Decrement the remaining offers count.
+ // When the remaining number of offers is zero, then remove this token
+ // from its holder.
+ if(!this.baseTokenIsWithdrawn & !this.baseToken.isWithdrawn()) {
+ this.baseToken.withdraw();
+ // NOTE: This keeps a base token that is a forked token from being
+ // withdrawn more than once, since withdrawing a forked token may
+ // not actually remove it from its fork node holder.
+ this.baseTokenIsWithdrawn = true;
+ }
+ if(this.remainingOffersCount > 0) {
+ this.remainingOffersCount = this.remainingOffersCount - 1;
+ }
+ if(this.remainingOffersCount == 0) {
+ super.withdraw();
+ }
+ }
+
+ public Token copy() {
+ // Return a copy of the base token.
+ return this.baseToken.copy();
+ }
+
+ public Boolean equals(Token otherToken) {
+ // Test if this token is equal to another token.
+ return this == otherToken;
+ }
+
+ public Value getValue() {
+ // Return the value of the base token.
+ return this.baseToken.getValue();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/InitialNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/InitialNodeActivation.java
new file mode 100644
index 00000000000..51c40f7ac07
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/InitialNodeActivation.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+
+public class InitialNodeActivation extends ControlNodeActivation {
+
+ public void fire(List<Token> incomingTokens) {
+ super.fire(incomingTokens) ;
+ Locus locus = this.getExecutionLocus() ;
+ if (locus.isInDebugMode) {
+ if (locus.engine.isTerminated())
+ return ;
+ }
+ // Create a single token and send offers for it.
+ List<Token> tokens = new ArrayList<Token>();
+ tokens.add(new ControlToken());
+ this.addTokens(tokens);
+ this.sendOffers(tokens);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/JoinNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/JoinNodeActivation.java
new file mode 100644
index 00000000000..c2e6058fc64
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/JoinNodeActivation.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+public class JoinNodeActivation extends ControlNodeActivation {
+
+ public Boolean isReady() {
+ // Check that all incoming edges have sources that are offering tokens.
+ boolean ready = true;
+ int i = 1;
+ while(ready & i <= this.incomingEdges.size()) {
+ ready = this.incomingEdges.get(i - 1).hasOffer();
+ i = i + 1;
+ }
+ return ready;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/MergeNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/MergeNodeActivation.java
new file mode 100644
index 00000000000..283956b1db0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/MergeNodeActivation.java
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+public class MergeNodeActivation extends ControlNodeActivation {
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectNodeActivation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectNodeActivation.java
new file mode 100644
index 00000000000..99d2b602241
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectNodeActivation.java
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class ObjectNodeActivation extends ActivityNodeActivation {
+
+ /*
+ * The number of held tokens that have already been offered.
+ */
+ public Integer offeredTokenCount;
+
+ public void run() {
+ // Initialize the offered token count to zero.
+ super.run();
+ this.offeredTokenCount = 0;
+ }
+
+ public void sendOffers(List<Token> tokens) {
+ // If the set of tokens to be sent is empty, then offer a null token
+ // instead.
+ // Otherwise, offer the given tokens as usual.
+ if(tokens.size() == 0) {
+ ObjectToken token = new ObjectToken();
+ token.holder = this;
+ tokens.add(token);
+ }
+ super.sendOffers(tokens);
+ }
+
+ public void terminate() {
+ // Remove any offered tokens and terminate.
+ this.clearTokens();
+ super.terminate();
+ }
+
+ public void addToken(Token token) {
+ // Transfer the given token to be held by this node only if it is a
+ // non-null object token.
+ // If it is a control token or a null token, consume it without holding
+ // it.
+ if(token.getValue() == null) {
+ token.withdraw();
+ } else {
+ super.addToken(token);
+ }
+ }
+
+ public Integer removeToken(Token token) {
+ // Remove the given token, if it is held by this node activation.
+ int i = super.removeToken(token);
+ if(i > 0 & i <= this.offeredTokenCount) {
+ this.offeredTokenCount = this.offeredTokenCount - 1;
+ }
+ return i;
+ }
+
+ public void clearTokens() {
+ // Remove all held tokens.
+ super.clearTokens();
+ this.offeredTokenCount = 0;
+ }
+
+ public Integer countOfferedValues() {
+ // Count the total number of non-null object tokens being offered to
+ // this node activation.
+ int totalValueCount = 0;
+ int i = 1;
+ while(i <= this.incomingEdges.size()) {
+ totalValueCount = totalValueCount + this.incomingEdges.get(i - 1).countOfferedValues();
+ i = i + 1;
+ }
+ return totalValueCount;
+ }
+
+ public void sendUnofferedTokens() {
+ // Send offers over all outgoing edges, if there are any tokens to be
+ // offered.
+ List<Token> tokens = this.getUnofferedTokens();
+ this.offeredTokenCount = this.offeredTokenCount + tokens.size();
+ this.sendOffers(tokens);
+ }
+
+ public Integer countUnofferedTokens() {
+ // Return the number of unoffered tokens that are to be offered next.
+ // (By default, this is all unoffered tokens.)
+ if(this.heldTokens.size() == 0) {
+ this.offeredTokenCount = 0;
+ }
+ return this.heldTokens.size() - this.offeredTokenCount;
+ }
+
+ public List<Token> getUnofferedTokens() {
+ // Get the next set of unoffered tokens to be offered and return it.
+ // [Note: This effectively treats all object flows as if they have
+ // weight=*, rather than the weight=1 default in the current
+ // superstructure semantics.]
+ List<Token> tokens = new ArrayList<Token>();
+ int i = 1;
+ while(i <= this.countUnofferedTokens()) {
+ tokens.add(this.heldTokens.get(this.offeredTokenCount + i - 1));
+ i = i + 1;
+ }
+ return tokens;
+ }
+
+ public List<Token> takeUnofferedTokens() {
+ // Take the next set of unoffered tokens to be offered from this node
+ // activation and return them.
+ List<Token> tokens = this.getUnofferedTokens();
+ for(int i = 0; i < tokens.size(); i++) {
+ Token token = tokens.get(i);
+ token.withdraw();
+ }
+ return tokens;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectToken.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectToken.java
new file mode 100644
index 00000000000..ddee2aa78a8
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/ObjectToken.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+
+public class ObjectToken extends Token {
+
+ /*
+ * The value carried by this token. A token may have no value, in which case
+ * it is a "null token".
+ */
+ public Value value;
+
+ public Boolean equals(Token other) {
+ // Test if this object token is the same as the other token.
+ return this == other;
+ }
+
+ public Token copy() {
+ // Return a new object token with the same value as this token.
+ // [Note: the holder of the copy is not set.]
+ ObjectToken copy = new ObjectToken();
+ copy.value = this.value;
+ return copy;
+ }
+
+ public Boolean isControl() {
+ // Return false for an object token.
+ return false;
+ }
+
+ public Value getValue() {
+ // Return the value of this object token.
+ return this.value;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Offer.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Offer.java
new file mode 100644
index 00000000000..4b9c1af6e6d
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Offer.java
@@ -0,0 +1,84 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Offer {
+
+ public List<Token> offeredTokens = new ArrayList<Token>();
+
+ public Integer countOfferedValues() {
+ // Return the number of values being offered on object tokens.
+ // Remove any tokens that have already been withdrawn and don't include
+ // them in the count.
+ this.removeWithdrawnTokens();
+ int count = 0;
+ for(int i = 0; i < this.offeredTokens.size(); i++) {
+ if(this.offeredTokens.get(i).getValue() != null) {
+ count = count + 1;
+ }
+ }
+ return count;
+ }
+
+ public List<Token> getOfferedTokens() {
+ // Get the offered tokens, removing any that have been withdrawn.
+ this.removeWithdrawnTokens();
+ List<Token> tokens = new ArrayList<Token>();
+ List<Token> offeredTokens = this.offeredTokens;
+ for(int i = 0; i < this.offeredTokens.size(); i++) {
+ Token offeredToken = offeredTokens.get(i);
+ // Debug.println("[getOfferedTokens] token value = " +
+ // offeredToken.getValue());
+ tokens.add(offeredToken);
+ }
+ return tokens;
+ }
+
+ public void removeOfferedValues(Integer count) {
+ // Remove the given number of non-null object tokens from those in this
+ // offer.
+ int n = count;
+ int i = 1;
+ while(n > 0) {
+ if(this.offeredTokens.get(i - 1).getValue() != null) {
+ this.offeredTokens.remove(i - 1);
+ } else {
+ i = i + 1;
+ }
+ n = n - 1;
+ }
+ }
+
+ public void removeWithdrawnTokens() {
+ // Remove any tokens that have already been consumed.
+ // List<Token> offeredTokens = this.offeredTokens;
+ int i = 1;
+ while(i <= this.offeredTokens.size()) {
+ if(this.offeredTokens.get(i - 1).isWithdrawn()) {
+ this.offeredTokens.remove(i - 1);
+ i = i - 1;
+ }
+ i = i + 1;
+ }
+ }
+
+ public Boolean hasTokens() {
+ // Check whether this offer has any tokens that have not been withdrawn.
+ this.removeWithdrawnTokens();
+ return this.offeredTokens.size() > 0;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Token.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Token.java
new file mode 100644
index 00000000000..7a9887aced3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Activities/IntermediateActivities/Token.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Activities.IntermediateActivities;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+
+public abstract class Token {
+
+ public ActivityNodeActivation holder;
+
+ public Token transfer(ActivityNodeActivation holder) {
+ // if this token does not have any holder, make the given holder its
+ // holder.
+ // Otherwise, remove this token from its holder and return a copy of it
+ // transfered to a new holder.
+ Token token = this;
+ if(this.holder != null) {
+ this.withdraw();
+ token = this.copy();
+ }
+ token.holder = holder;
+ return token;
+ }
+
+ public void withdraw() {
+ // Remove this token from its holder, withdrawing any offers for it.
+ if(!this.isWithdrawn()) {
+ // Debug.println("[withdraw] Taking token with value = " +
+ // this.getValue());
+ this.holder.removeToken(this);
+ this.holder = null;
+ }
+ }
+
+ public abstract Boolean equals(Token other);
+
+ public abstract Token copy();
+
+ public Boolean isWithdrawn() {
+ // Test if this token has been withdrawn.
+ return this.holder == null;
+ }
+
+ public abstract Boolean isControl();
+
+ public abstract Value getValue();
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/BooleanValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/BooleanValue.java
new file mode 100644
index 00000000000..ee4eb384df6
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/BooleanValue.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralBoolean;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class BooleanValue extends PrimitiveValue {
+
+ /*
+ * The actual Boolean value.
+ */
+ public Boolean value;
+
+ public ValueSpecification specify() {
+ // Return a literal boolean with the value of this boolean value.
+ LiteralBoolean literal = UMLFactory.eINSTANCE.createLiteralBoolean();
+ literal.setType(this.type);
+ literal.setValue(this.value);
+ return literal;
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this boolean value is equal to the otherValue.
+ // To be equal, the otherValue must have the same value as this boolean
+ // value.
+ boolean isEqual = false;
+ if(otherValue instanceof BooleanValue) {
+ isEqual = ((BooleanValue)otherValue).value.equals(this.value); // CHANGED == to equals;
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new boolean value with the same value as this boolean value.
+ BooleanValue newValue = (BooleanValue)(super.copy());
+ newValue.value = this.value;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Return a new boolean value with no value.
+ return new BooleanValue();
+ }
+
+ public String toString() {
+ String stringValue = "false";
+ if(this.value) {
+ stringValue = "true";
+ }
+ return stringValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/CompoundValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/CompoundValue.java
new file mode 100644
index 00000000000..926636b5ef3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/CompoundValue.java
@@ -0,0 +1,150 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public abstract class CompoundValue extends StructuredValue {
+
+ public List<FeatureValue> featureValues = new ArrayList<FeatureValue>();
+
+ public Boolean equals(Value otherValue) {
+ // Test if this data value is equal to the otherValue.
+ // To be equal, the otherValue must also be a compund value with the
+ // same types and equal values for each feature.
+ // Debug.println("[equals] othervalue instanceof CompoundValue = " +
+ // (otherValue instanceof CompoundValue));
+ // Debug.println("[equals] super.equals(otherValue) = " +
+ // super.equals(otherValue));
+ boolean isEqual = otherValue instanceof CompoundValue;
+ if(isEqual) {
+ CompoundValue otherCompoundValue = (CompoundValue)otherValue;
+ // Debug.println("[equals] " + this.featureValues.size() +
+ // " feature(s).");
+ isEqual = super.equals(otherValue) & otherCompoundValue.featureValues.size() == this.featureValues.size();
+ int i = 1;
+ while(isEqual & i <= this.featureValues.size()) {
+ FeatureValue thisFeatureValue = this.featureValues.get(i - 1);
+ boolean matched = false;
+ int j = 1;
+ while(!matched & j <= otherCompoundValue.featureValues.size()) {
+ FeatureValue otherFeatureValue = otherCompoundValue.featureValues.get(j - 1);
+ if(thisFeatureValue.feature == otherFeatureValue.feature) {
+ matched = thisFeatureValue.hasEqualValues(otherFeatureValue);
+ }
+ j = j + 1;
+ }
+ isEqual = matched;
+ i = i + 1;
+ }
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new data value with the same featureValues as this data
+ // value.
+ CompoundValue newValue = (CompoundValue)(super.copy());
+ List<FeatureValue> featureValues = this.featureValues;
+ for(int i = 0; i < featureValues.size(); i++) {
+ FeatureValue featureValue = featureValues.get(i);
+ newValue.featureValues.add(featureValue.copy());
+ }
+ return newValue;
+ }
+
+ public FeatureValue getFeatureValue(StructuralFeature feature) {
+ // Get the value(s) of the member of featureValues for the given
+ // feature.
+ FeatureValue featureValue = null;
+ int i = 1;
+ while(featureValue == null & i <= this.featureValues.size()) {
+ if(this.featureValues.get(i - 1).feature == feature) {
+ featureValue = this.featureValues.get(i - 1);
+ }
+ i = i + 1;
+ }
+ return featureValue;
+ }
+
+ public void setFeatureValue(StructuralFeature feature, List<Value> values, Integer position) {
+ // Set the value(s) of the member of featureValues for the given
+ // feature.
+ FeatureValue featureValue = this.getFeatureValue(feature);
+ if(featureValue == null) {
+ featureValue = new FeatureValue();
+ this.featureValues.add(featureValue);
+ }
+ featureValue.feature = feature;
+ featureValue.values = values;
+ featureValue.position = position;
+ }
+
+ public List<FeatureValue> getFeatureValues() {
+ // Return the feature values for this compound value.
+ return this.featureValues;
+ }
+
+ public void removeFeatureValues(Classifier classifier) {
+ // Remove all feature values for features whose type is the given
+ // classifier.
+ int i = 1;
+ while(i <= this.featureValues.size()) {
+ if(this.featureValues.get(i - 1).feature.getType() == classifier) {
+ this.featureValues.remove(i - 1);
+ } else {
+ i = i + 1;
+ }
+ }
+ }
+
+ public String toString() {
+ String buffer = "(" + this.objectId() + ":";
+ List<Classifier> types = this.getTypes();
+ int i = 1;
+ while(i <= types.size()) {
+ buffer = buffer + " " + types.get(i - 1).getName();
+ i = i + 1;
+ }
+ int k = 1;
+ while(k <= this.featureValues.size()) {
+ FeatureValue featureValue = this.featureValues.get(k - 1);
+ buffer = buffer + "\n\t\t" + featureValue.feature.getName() + "[" + featureValue.position + "] =";
+ int j = 1;
+ while(j <= featureValue.values.size()) {
+ Value value = featureValue.values.get(j - 1);
+ if (value instanceof Reference) {
+ Object_ object = ((Reference)value).referent;
+ buffer = buffer + " Reference to (" + object.objectId() + ":";
+ types = object.getTypes();
+ int n = 1;
+ while (n <= types.size()) {
+ buffer = buffer + " " + types.get(n - 1).getName();
+ n = n + 1;
+ }
+ buffer = buffer + ")";
+ } else {
+ buffer = buffer + " " + value.toString();
+ }
+ j = j + 1;
+ }
+ k = k + 1;
+ }
+ return buffer + ")";
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DataValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DataValue.java
new file mode 100644
index 00000000000..2585ed45dbe
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DataValue.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.DataType;
+
+public class DataValue extends CompoundValue {
+
+ /*
+ * The type of this data value. This must not be a primitive or an
+ * enumeration.
+ */
+ public DataType type;
+
+ public List<Classifier> getTypes() {
+ // Return the single type of this data value.
+ List<Classifier> types = new ArrayList<Classifier>();
+ types.add(this.type);
+ return types;
+ }
+
+ public Value copy() {
+ // Create a new data value with the same type and feature values as this
+ // data value.
+ DataValue newValue = (DataValue)(super.copy());
+ newValue.type = this.type;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new data value with no type or feature values.
+ return new DataValue();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DispatchStrategy.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DispatchStrategy.java
new file mode 100644
index 00000000000..a8c5801858f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/DispatchStrategy.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.SemanticStrategy;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Operation;
+
+public abstract class DispatchStrategy extends SemanticStrategy {
+
+ public String getName() {
+ // Dispatch strategies are always named "dispatch".
+ return "dispatch";
+ }
+
+ public Execution dispatch(Object_ object, Operation operation) {
+ // Get the behavior for the given operation as determined by the type(s)
+ // of the given object, compile the behavior at the locus of the object,
+ // and return the resulting execution object.
+ return object.locus.factory.createExecution(this.getMethod(object, operation), object);
+ }
+
+ public abstract Behavior getMethod(Object_ object, Operation operation);
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/EnumerationValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/EnumerationValue.java
new file mode 100644
index 00000000000..07be5e8dac1
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/EnumerationValue.java
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class EnumerationValue extends Value {
+
+ /*
+ * The literal value of this enumeration value.
+ */
+ public EnumerationLiteral literal;
+
+ public Enumeration type;
+
+ public ValueSpecification specify() {
+ // Return an instance value with literal as the instance.
+ InstanceValue instanceValue = UMLFactory.eINSTANCE.createInstanceValue();
+ // InstanceSpecification instance =
+ // UMLFactory.eINSTANCE.createInstanceSpecification();
+ instanceValue.setType(this.type);
+ instanceValue.setInstance(this.literal);
+ return instanceValue;
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this enumeration value is equal to the otherValue.
+ // To be equal, the otherValue must also be an enumeration value with
+ // the same literal as this enumeration value.
+ boolean isEqual = false;
+ if(otherValue instanceof EnumerationValue) {
+ isEqual = ((EnumerationValue)otherValue).literal == this.literal;
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new enumeration value with the same literal as this
+ // enumeration value.
+ EnumerationValue newValue = (EnumerationValue)(super.copy());
+ newValue.type = this.type;
+ newValue.literal = this.literal;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new enumeration value with no literal.
+ return new EnumerationValue();
+ }
+
+ public List<Classifier> getTypes() {
+ // Return the single type of this enumeration value.
+ List<Classifier> types = new ArrayList<Classifier>();
+ types.add(this.type);
+ return types;
+ }
+
+ public String toString() {
+ return literal.getName();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Evaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Evaluation.java
new file mode 100644
index 00000000000..4f4f3d14f84
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Evaluation.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.SemanticVisitor;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public abstract class Evaluation extends SemanticVisitor {
+
+ /*
+ * The value specification to be evaluated.
+ */
+ public ValueSpecification specification;
+
+ /*
+ * The locus at which this evaluation is taking place.
+ */
+ public Locus locus;
+
+ public abstract Value evaluate();
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/ExtensionalValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/ExtensionalValue.java
new file mode 100644
index 00000000000..bef54d38e84
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/ExtensionalValue.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+
+public abstract class ExtensionalValue extends CompoundValue {
+
+ /*
+ * The locus of the extent of which this value is a member. (If the value
+ * has been destroyed, it has no locus.)
+ */
+ public Locus locus;
+
+ public void destroy() {
+ // Remove this value from its locus (if it has not already been
+ // destroyed).
+ if(this.locus != null) {
+ this.locus.remove(this);
+ }
+ }
+
+ public Value copy() {
+ // Create a new extensional value with the same feature values at the
+ // same locus as this one.
+ ExtensionalValue newValue = (ExtensionalValue)(super.copy());
+ if(this.locus != null) {
+ this.locus.add(newValue);
+ }
+ return newValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/FeatureValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/FeatureValue.java
new file mode 100644
index 00000000000..0c6579be295
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/FeatureValue.java
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class FeatureValue {
+
+ /*
+ * The structural feature being given value(s).
+ */
+ public StructuralFeature feature;
+
+ /*
+ * The values of for the feature. Zero or more values are possible, as
+ * constrained by the multiplicity of the feature.
+ */
+ public List<Value> values = new ArrayList<Value>();
+
+ /*
+ * The position of this feature value in a set of ordered values for a
+ * feature of an association. [This is only relevant if the feature value is
+ * for a link and the feature is ordered.]
+ */
+ public Integer position;
+
+ public Boolean hasEqualValues(FeatureValue other) {
+ // Determine if this feature value has an equal set of values as another
+ // feature value.
+ // If the feature is ordered, then the values also have to be in the
+ // same order.
+ boolean equal = true;
+ if(this.values.size() != other.values.size()) {
+ equal = false;
+ } else {
+ // Debug.println("[hasEqualValues] feature = " + this.feature.name +
+ // ", " + this.values.size() + " value(s).");
+ if(this.feature.isOrdered()) {
+ int i = 1;
+ while(equal & i <= this.values.size()) {
+ equal = this.values.get(i - 1).equals(other.values.get(i - 1));
+ i = i + 1;
+ }
+ } else {
+ // Note: otherFeatureValues is used here solely as a holder for
+ // a copy of the list of other values,
+ // since the Java to UML mapping conventions do not allow
+ // "remove" on a local list variable.
+ FeatureValue otherFeatureValues = new FeatureValue();
+ List<Value> values = other.values;
+ for(int i = 0; i < values.size(); i++) {
+ Value value = values.get(i);
+ otherFeatureValues.values.add(value);
+ }
+ int i = 1;
+ while(equal & i <= this.values.size()) {
+ // Debug.println("[hasEqualValues] This value [" + (i-1) +
+ // "] = " + this.values.get(i-1));
+ boolean matched = false;
+ int j = 1;
+ while(!matched & j <= otherFeatureValues.values.size()) {
+ if(this.values.get(i - 1).equals(otherFeatureValues.values.get(j - 1))) {
+ // Debug.println("[hasEqualValues] Other value [" +
+ // (j-1) + "] = " +
+ // otherFeatureValues.values.get(j-1));
+ matched = true;
+ otherFeatureValues.values.remove(j - 1);
+ }
+ j = j + 1;
+ }
+ equal = matched;
+ i = i + 1;
+ }
+ }
+ }
+ return equal;
+ }
+
+ public FeatureValue copy() {
+ // Create a copy of this feature value.
+ FeatureValue newValue = new FeatureValue();
+ newValue.feature = this.feature;
+ newValue.position = this.position;
+ List<Value> values = this.values;
+ for(int i = 0; i < values.size(); i++) {
+ Value value = values.get(i);
+ newValue.values.add(value.copy());
+ }
+ return newValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/InstanceValueEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/InstanceValueEvaluation.java
new file mode 100644
index 00000000000..18db33d1d8a
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/InstanceValueEvaluation.java
@@ -0,0 +1,110 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.Slot;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class InstanceValueEvaluation extends Evaluation {
+
+ public Value evaluate() {
+ // If the instance specification is for an enumeration, then return the
+ // identified enumeration literal.
+ // If the instance specification is for a data type (but not a primitive
+ // value or an enumeration), then create a data value of the given data
+ // type.
+ // If the instance specification is for an object, then create an object
+ // at the current locus with the specified types.
+ // Set each feature of the created value to the result of evaluating the
+ // value specifications for the specified slot for the feature.
+ // Debug.println("[evaluate] InstanceValueEvaluation...");
+ InstanceSpecification instance = ((InstanceValue)this.specification).getInstance();
+ // List<Classifier> types = instance.getClassifiers();
+ // Classifier myType = types.get(0);
+ // Debug.println("[evaluate] type = " + myType.getName());
+ Value value;
+ if(instance instanceof EnumerationLiteral) {
+ // Debug.println("[evaluate] Type is an enumeration.");
+ EnumerationValue enumerationValue = new EnumerationValue();
+ // enumerationValue.type = (Enumeration)myType;
+ enumerationValue.type = ((EnumerationLiteral)instance).getEnumeration(); // ADDED
+ enumerationValue.literal = (EnumerationLiteral)instance;
+ value = enumerationValue;
+ Debug.println("[evaluate] type = " + enumerationValue.type.getName()); // ADDED
+ } else {
+ // ADDED:
+ List<Classifier> types = instance.getClassifiers();
+ Classifier myType = types.get(0);
+ Debug.println("[evaluate] type = " + myType.getName());
+ //
+ StructuredValue structuredValue = null;
+ if(myType instanceof DataType) {
+ // Debug.println("[evaluate] Type is a data type.");
+ DataValue dataValue = new DataValue();
+ dataValue.type = (DataType)myType;
+ structuredValue = dataValue;
+ } else {
+ Object_ object = null;
+ if(myType instanceof Behavior) {
+ // Debug.println("[evaluate] Type is a behavior.");
+ object = this.locus.factory.createExecution((Behavior)myType, null);
+ } else {
+ // Debug.println("[evaluate] Type is a class.");
+ object = new Object_();
+ for(int i = 0; i < types.size(); i++) {
+ Classifier type = types.get(i);
+ object.types.add((Class)type);
+ }
+ }
+ this.locus.add(object);
+ Reference reference = new Reference();
+ reference.referent = object;
+ structuredValue = reference;
+ }
+ structuredValue.createFeatureValues();
+ // Debug.println("[evaluate] " + instance.slot.size() +
+ // " slot(s).");
+ List<Slot> instanceSlots = instance.getSlots();
+ for(int i = 0; i < instanceSlots.size(); i++) {
+ Slot slot = instanceSlots.get(i);
+ List<Value> values = new ArrayList<Value>();
+ // Debug.println("[evaluate] feature = " +
+ // slot.definingFeature.getName() + ", " + slot.value.size() +
+ // " value(s).");
+ List<ValueSpecification> slotValues = slot.getValues();
+ for(int j = 0; j < slotValues.size(); j++) {
+ ValueSpecification slotValue = slotValues.get(j);
+ // Debug.println("[evaluate] Value = " +
+ // slotValue.getClass().getName());
+ values.add(this.locus.executor.evaluate(slotValue));
+ }
+ structuredValue.setFeatureValue(slot.getDefiningFeature(), values, 0);
+ }
+ value = structuredValue;
+ }
+ return value;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/IntegerValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/IntegerValue.java
new file mode 100644
index 00000000000..6e351061b2b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/IntegerValue.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralInteger;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class IntegerValue extends PrimitiveValue {
+
+ /*
+ * The actual Integer value.
+ */
+ public Integer value;
+
+ public ValueSpecification specify() {
+ // Return a literal integer with the value of this integer value.
+ LiteralInteger literal = UMLFactory.eINSTANCE.createLiteralInteger();
+ literal.setType(this.type);
+ literal.setValue(this.value);
+ return literal;
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this integer value is equal to the otherValue.
+ // To be equal, the otherValue must have the same value as this integer
+ // value.
+ boolean isEqual = false;
+ if(otherValue instanceof IntegerValue) {
+ isEqual = ((IntegerValue)otherValue).value.equals(this.value); // CHANGED == to equals
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new integer value with the same value as this integer value.
+ IntegerValue newValue = (IntegerValue)(super.copy());
+ newValue.value = this.value;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new integer value with no value.
+ return new IntegerValue();
+ }
+
+ public String toString() {
+ String stringValue = "";
+ if(this.value == 0) {
+ stringValue = "0";
+ } else {
+ int positiveValue = this.value;
+ if(positiveValue < 0) {
+ positiveValue = -positiveValue;
+ }
+ do {
+ int digit = positiveValue % 10;
+ if(digit == 0) {
+ stringValue = "0" + stringValue;
+ } else if(digit == 1) {
+ stringValue = "1" + stringValue;
+ } else if(digit == 2) {
+ stringValue = "2" + stringValue;
+ } else if(digit == 3) {
+ stringValue = "3" + stringValue;
+ } else if(digit == 4) {
+ stringValue = "4" + stringValue;
+ } else if(digit == 5) {
+ stringValue = "5" + stringValue;
+ } else if(digit == 6) {
+ stringValue = "6" + stringValue;
+ } else if(digit == 7) {
+ stringValue = "7" + stringValue;
+ } else if(digit == 8) {
+ stringValue = "8" + stringValue;
+ } else if(digit == 9) {
+ stringValue = "9" + stringValue;
+ }
+ positiveValue = positiveValue / 10;
+ } while(positiveValue > 0);
+ if(this.value < 0) {
+ stringValue = "-" + stringValue;
+ }
+ }
+ return stringValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Link.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Link.java
new file mode 100644
index 00000000000..417d03a896f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Link.java
@@ -0,0 +1,141 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.Locus;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Property;
+
+public class Link extends ExtensionalValue {
+
+ /*
+ * The type of this link.
+ */
+ public Association type;
+
+ public void destroy() {
+ // Remove the type of this link and destroy it.
+ // Shift the positions of the feature values of any remaining links in
+ // the extent of the same association, for ends that are ordered.
+ Debug.println("[destroy] link = " + this.objectId());
+ List<Property> ends = this.type.getMemberEnds();
+ List<ExtensionalValue> extent = this.locus.getExtent(this.type);
+ for(int i = 0; i < extent.size(); i++) {
+ ExtensionalValue otherLink = extent.get(i);
+ for(int j = 0; j < ends.size(); j++) {
+ Property end = ends.get(j);
+ if(end.isOrdered()) {
+ FeatureValue featureValue = otherLink.getFeatureValue(end);
+ if(this.getFeatureValue(end).position < featureValue.position) {
+ featureValue.position = featureValue.position - 1;
+ }
+ }
+ }
+ }
+ this.type = null;
+ super.destroy();
+ }
+
+ public Value copy() {
+ // Create a new link with the same type, locus and feature values as
+ // this link.
+ Link newValue = (Link)(super.copy());
+ newValue.type = this.type;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new link with no type or properies.
+ return new Link();
+ }
+
+ public List<Classifier> getTypes() {
+ // Return the single type of this link (if any).
+ List<Classifier> types = null;
+ if(this.type == null) {
+ types = new ArrayList<Classifier>();
+ } else {
+ types = new ArrayList<Classifier>();
+ types.add(this.type);
+ }
+ return types;
+ }
+
+ public Boolean isMatchingLink(ExtensionalValue link, Property end) {
+ // Test whether the given link matches the values of this link on all
+ // ends other than the given end.
+ List<Property> ends = this.type.getMemberEnds();
+ boolean matches = true;
+ int i = 1;
+ while(matches & i <= ends.size()) {
+ Property otherEnd = ends.get(i - 1);
+ if(otherEnd != end & !this.getFeatureValue(otherEnd).values.get(0).equals(link.getFeatureValue(otherEnd).values.get(0))) {
+ matches = false;
+ }
+ i = i + 1;
+ }
+ return matches;
+ }
+
+ public List<FeatureValue> getOtherFeatureValues(List<ExtensionalValue> extent, Property end) {
+ // Return all feature values for the given end of links in the given
+ // extent whose other ends match this link.
+ List<FeatureValue> featureValues = new ArrayList<FeatureValue>();
+ for(int i = 0; i < extent.size(); i++) {
+ ExtensionalValue link = extent.get(i);
+ if(link != this) {
+ if(isMatchingLink(link, end)) {
+ featureValues.add(link.getFeatureValue(end));
+ }
+ }
+ }
+ return featureValues;
+ }
+
+ public void addTo(Locus locus) {
+ // Add this link to the extent of its association at the given locus.
+ // Shift the positions of ends of other links, as appropriate, for ends
+ // that are ordered.
+ Debug.println("[addTo] link = " + this.objectId());
+ List<Property> ends = this.type.getMemberEnds();
+ List<ExtensionalValue> extent = locus.getExtent(this.type);
+ for(int i = 0; i < ends.size(); i++) {
+ Property end = ends.get(i);
+ if(end.isOrdered()) {
+ FeatureValue featureValue = this.getFeatureValue(end);
+ List<FeatureValue> otherFeatureValues = this.getOtherFeatureValues(extent, end);
+ int n = otherFeatureValues.size();
+ if(featureValue.position < 0 | featureValue.position > n) {
+ featureValue.position = n + 1;
+ } else {
+ if(featureValue.position == 0) {
+ featureValue.position = 1;
+ }
+ for(int j = 0; j < otherFeatureValues.size(); j++) {
+ FeatureValue otherFeatureValue = otherFeatureValues.get(j);
+ if(featureValue.position <= otherFeatureValue.position) {
+ otherFeatureValue.position = otherFeatureValue.position + 1;
+ }
+ }
+ }
+ }
+ }
+ locus.add(this);
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralBooleanEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralBooleanEvaluation.java
new file mode 100644
index 00000000000..8b379bfd28f
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralBooleanEvaluation.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralBoolean;
+
+public class LiteralBooleanEvaluation extends LiteralEvaluation {
+
+ public Value evaluate() {
+ // Evaluate a literal boolean, producing a boolean value.
+ LiteralBoolean literal = (LiteralBoolean)specification;
+ BooleanValue booleanValue = new BooleanValue();
+ booleanValue.type = this.getType("Boolean");
+ booleanValue.value = literal.booleanValue();
+ return booleanValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralEvaluation.java
new file mode 100644
index 00000000000..3c5caa299a3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralEvaluation.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.PrimitiveType;
+
+public abstract class LiteralEvaluation extends Evaluation {
+
+ public PrimitiveType getType(String builtInTypeName) {
+ // Get the type of the specification. If that is null, then use the
+ // built-in type of the given name.
+ PrimitiveType type = (PrimitiveType)(this.specification.getType());
+ if(type == null) {
+ type = this.locus.factory.getBuiltInType(builtInTypeName);
+ }
+ return type;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralIntegerEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralIntegerEvaluation.java
new file mode 100644
index 00000000000..cf86d556cc3
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralIntegerEvaluation.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralInteger;
+
+public class LiteralIntegerEvaluation extends LiteralEvaluation {
+
+ public Value evaluate() {
+ // Evaluate a literal integer, producing an integer value.
+ LiteralInteger literal = (LiteralInteger)specification;
+ IntegerValue integerValue = new IntegerValue();
+ integerValue.type = this.getType("Integer");
+ integerValue.value = literal.integerValue();
+ return integerValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralNullEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralNullEvaluation.java
new file mode 100644
index 00000000000..e6d502c1322
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralNullEvaluation.java
@@ -0,0 +1,23 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+public class LiteralNullEvaluation extends LiteralEvaluation {
+
+ public Value evaluate() {
+ // Evaluate a literal null, returning nothing (since a null represents
+ // an "absence of any value").
+ return null;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralRealEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralRealEvaluation.java
new file mode 100644
index 00000000000..bd84f6167f7
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralRealEvaluation.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralReal;
+
+public class LiteralRealEvaluation extends LiteralEvaluation {
+
+ public Value evaluate() {
+ // Evaluate a real integer, producing a real value.
+ LiteralReal literal = (LiteralReal)specification;
+ RealValue realValue = new RealValue();
+ realValue.type = this.getType("Real");
+ realValue.value = literal.getValue();
+ return realValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralStringEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralStringEvaluation.java
new file mode 100644
index 00000000000..8b843030350
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralStringEvaluation.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralString;
+
+public class LiteralStringEvaluation extends LiteralEvaluation {
+
+ public Value evaluate() {
+ // Evaluate a literal string, producing a string value.
+ LiteralString literal = (LiteralString)specification;
+ StringValue stringValue = new StringValue();
+ stringValue.type = this.getType("String");
+ stringValue.value = literal.getValue();
+ return stringValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralUnlimitedNaturalEvaluation.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralUnlimitedNaturalEvaluation.java
new file mode 100644
index 00000000000..9106d2fa525
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/LiteralUnlimitedNaturalEvaluation.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralUnlimitedNatural;
+
+public class LiteralUnlimitedNaturalEvaluation extends LiteralEvaluation {
+
+ public Value evaluate() {
+ // Evaluate a literal unlimited natural producing an unlimited natural
+ // value.
+ LiteralUnlimitedNatural literal = (LiteralUnlimitedNatural)specification;
+ UnlimitedNaturalValue unlimitedNaturalValue = new UnlimitedNaturalValue();
+ unlimitedNaturalValue.type = this.getType("UnlimitedNatural");
+ unlimitedNaturalValue.value = literal.getValue();
+ return unlimitedNaturalValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Object_.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Object_.java
new file mode 100644
index 00000000000..73cab0a4cbe
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Object_.java
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.EventAccepter;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.ObjectActivation;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.SignalInstance;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Operation;
+
+public class Object_ extends ExtensionalValue {
+
+ /*
+ * The classes under which this object is currently classified. (A destroyed
+ * object has no types.)
+ */
+ public List<Class> types = new ArrayList<Class>();
+
+ /*
+ * The object activation handling the active behavior of this object.
+ */
+ public ObjectActivation objectActivation;
+
+ public void startBehavior(Class classifier, List<ParameterValue> inputs) {
+ // Create an object activation for this object (if one does not already
+ // exist) and start its behavior(s).
+ // Debug.println("[startBehavior] On object...");
+ if(this.objectActivation == null) {
+ this.objectActivation = new ObjectActivation();
+ this.objectActivation.object = this;
+ }
+ // Debug.println("[startBehavior] objectActivation = " +
+ // objectActivation);
+ this.objectActivation.startBehavior(classifier, inputs);
+ }
+
+ public Execution dispatch(Operation operation) {
+ // Dispatch the given operation to a method execution, using a dispatch
+ // strategy.
+ return ((DispatchStrategy)this.locus.factory.getStrategy("dispatch")).dispatch(this, operation);
+ }
+
+ public void send(SignalInstance signalInstance) {
+ // If the object is active, add the given signal instance to the event
+ // pool and signal that a new signal instance has arrived.
+ if(this.objectActivation != null) {
+ this.objectActivation.send(signalInstance);
+ }
+ }
+
+ public void destroy() {
+ // Stop the object activation (if any), clear all types and destroy the
+ // object as an extensional value.
+ Debug.println("[destroy] object = " + this.objectId());
+ if(this.objectActivation != null) {
+ this.objectActivation.stop();
+ this.objectActivation = null;
+ }
+ this.types.clear();
+ super.destroy();
+ }
+
+ public void register(EventAccepter accepter) {
+ // Register the given accept event accepter to wait for a dispatched
+ // signal event.
+ if(this.objectActivation != null) {
+ this.objectActivation.register(accepter);
+ }
+ }
+
+ public void unregister(EventAccepter accepter) {
+ // Remove the given event accepter for the list of waiting event
+ // accepters.
+ if(this.objectActivation != null) {
+ this.objectActivation.unregister(accepter);
+ }
+ }
+
+ public Value copy() {
+ // Create a new object that is a copy of this object at the same locus
+ // as this object.
+ // However, the new object will NOT have any object activation (i.e, its
+ // classifier behaviors will not be started).
+ Object_ newObject = (Object_)(super.copy());
+ List<Class> types = this.types;
+ for(int i = 0; i < types.size(); i++) {
+ Class type = types.get(i);
+ newObject.types.add(type);
+ }
+ return newObject;
+ }
+
+ public Value new_() {
+ // Create a new object with no type, feature values or locus.
+ return new Object_();
+ }
+
+ public List<Classifier> getTypes() {
+ // Return the types of this object.
+ List<Classifier> types = new ArrayList<Classifier>();
+ List<Class> myTypes = this.types;
+ for(int i = 0; i < myTypes.size(); i++) {
+ Class type = myTypes.get(i);
+ types.add(type);
+ }
+ return types;
+ }
+
+ public String toString() {
+ return this.objectId() ;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/PrimitiveValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/PrimitiveValue.java
new file mode 100644
index 00000000000..92b1a3e785c
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/PrimitiveValue.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.PrimitiveType;
+
+public abstract class PrimitiveValue extends Value {
+
+ public PrimitiveType type;
+
+ public Value copy() {
+ // Create a new value that is equal to this primitive value.
+ PrimitiveValue newValue = (PrimitiveValue)(super.copy());
+ newValue.type = this.type;
+ return newValue;
+ }
+
+ public List<Classifier> getTypes() {
+ // Return the single primitive type of this value.
+ List<Classifier> types = new ArrayList<Classifier>();
+ types.add(this.type);
+ return types;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RealValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RealValue.java
new file mode 100644
index 00000000000..77a0555c5a2
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RealValue.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralReal;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class RealValue extends PrimitiveValue {
+
+ /*
+ * The actual Real value.
+ */
+ public double value;
+
+ public ValueSpecification specify() {
+ // Return a literal real with the value of this real value.
+ LiteralReal literal = UMLFactory.eINSTANCE.createLiteralReal();
+ literal.setType(this.type);
+ literal.setValue(this.value);
+ return literal;
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this real value is equal to the otherValue.
+ // To be equal, the otherValue must have the same value as this real
+ // value.
+ boolean isEqual = false;
+ if(otherValue instanceof RealValue) {
+ isEqual = ((RealValue)otherValue).value == this.value;
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new real value with the same value as this real value.
+ RealValue newValue = (RealValue)(super.copy());
+ newValue.value = this.value;
+ return newValue;
+ }
+
+ public Value new_() {
+ return new RealValue();
+ }
+
+ public String toString() {
+ String stringValue = "";
+ if(this.value == 0) {
+ stringValue = "0";
+ } else {
+ double positiveValue = this.value;
+ if(positiveValue < 0) {
+ positiveValue = -positiveValue;
+ }
+ int exponent = 0;
+ if(positiveValue < .1) {
+ while(positiveValue < .1) {
+ positiveValue = positiveValue * 10;
+ exponent = exponent - 1;
+ }
+ } else if(positiveValue > 1) {
+ while(positiveValue > 1) {
+ positiveValue = positiveValue / 10;
+ exponent = exponent + 1;
+ }
+ }
+ // This gives 9 significant digits in the mantissa.
+ for(int i = 0; i < 9; i++) {
+ positiveValue = positiveValue * 10;
+ }
+ IntegerValue integerValue = new IntegerValue();
+ integerValue.value = (int)positiveValue;
+ stringValue = "0." + integerValue.toString();
+ integerValue.value = exponent;
+ stringValue = stringValue + "E" + integerValue.toString();
+ if(this.value < 0) {
+ stringValue = "-" + stringValue;
+ }
+ }
+ return stringValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RedefinitionBasedDispatchStrategy.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RedefinitionBasedDispatchStrategy.java
new file mode 100644
index 00000000000..25d2ea58991
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/RedefinitionBasedDispatchStrategy.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.List;
+
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Operation;
+
+public class RedefinitionBasedDispatchStrategy extends DispatchStrategy {
+
+ public Behavior getMethod(Object_ object, Operation operation) {
+ // Get the method that corresponds to the given operation for the given
+ // object.
+ // [If there is more than one type with a method for the operation, then
+ // the first one is arbitrarily chosen.]
+ Behavior method = null;
+ int i = 1;
+ while(method == null & i <= object.types.size()) {
+ Class type = object.types.get(i - 1);
+ List<NamedElement> members = type.getMembers();
+ int j = 1;
+ while(method == null & j <= members.size()) {
+ NamedElement member = members.get(j - 1);
+ if(member instanceof Operation) {
+ Operation memberOperation = (Operation)member;
+ if(this.operationsMatch(memberOperation, operation)) {
+ method = memberOperation.getMethods().get(0);
+ }
+ }
+ j = j + 1;
+ }
+ i = i + 1;
+ }
+ return method;
+ }
+
+ public Boolean operationsMatch(Operation ownedOperation, Operation baseOperation) {
+ // Check if the owned operation is equal to or a redefinition (directly
+ // or indirectly) of the base operation.
+ boolean matches = false;
+ if(ownedOperation == baseOperation) {
+ matches = true;
+ } else {
+ int i = 1;
+ while(!matches & i <= ownedOperation.getRedefinedOperations().size()) {
+ matches = this.operationsMatch(ownedOperation.getRedefinedOperations().get(i - 1), baseOperation);
+ i = i + 1;
+ }
+ }
+ return matches;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Reference.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Reference.java
new file mode 100644
index 00000000000..5b150d00d81
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Reference.java
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications.SignalInstance;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.StructuralFeature;
+
+public class Reference extends StructuredValue {
+
+ public Object_ referent;
+
+ public void startBehavior(Class classifier, List<ParameterValue> inputs) {
+ // Asynchronously start the behavior of the given classifier for the
+ // referent object.
+ this.referent.startBehavior(classifier, inputs);
+ }
+
+ public Execution dispatch(Operation operation) {
+ // Dispatch the given operation to the referent object.
+ return this.referent.dispatch(operation);
+ }
+
+ public void send(SignalInstance signalInstance) {
+ // Send the given signal instance to the referent object.
+ this.referent.send(signalInstance);
+ }
+
+ public void destroy() {
+ // Destroy the referent.
+ this.referent.destroy();
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this reference is equal to the otherValue.
+ // To be equal, the otherValue must also be a reference, with the same
+ // referent as this reference.
+ boolean isEqual = false;
+ if(otherValue instanceof Reference) {
+ isEqual = (((Reference)otherValue).referent == this.referent);
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new reference with the same referent as this reference.
+ Reference newValue = (Reference)(super.copy());
+ newValue.referent = this.referent;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new reference with no referent.
+ return new Reference();
+ }
+
+ public List<Classifier> getTypes() {
+ // Get the types of the referent object.
+ return this.referent.getTypes();
+ }
+
+ public FeatureValue getFeatureValue(StructuralFeature feature) {
+ // Get the feature value associated with the given feature in the
+ // referent object.
+ return this.referent.getFeatureValue(feature);
+ }
+
+ public void setFeatureValue(StructuralFeature feature, List<Value> values, Integer position) {
+ // Set the values associated with the given feature in the referent
+ // object.
+ this.referent.setFeatureValue(feature, values, position);
+ }
+
+ public List<FeatureValue> getFeatureValues() {
+ // Return the feature values of the referent.
+ return this.referent.getFeatureValues();
+ }
+
+ public String toString() {
+ return "Reference to " + this.referent.toString();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StringValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StringValue.java
new file mode 100644
index 00000000000..76ad22e56f4
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StringValue.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralString;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class StringValue extends PrimitiveValue {
+
+ public String value;
+
+ public ValueSpecification specify() {
+ // Return a literal string with the value of this string value.
+ LiteralString literal = UMLFactory.eINSTANCE.createLiteralString();
+ literal.setType(this.type);
+ literal.setValue(this.value);
+ return literal;
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this string value is equal to the otherValue.
+ // To be equal, the otherValue must have the same value as this string
+ // value.
+ boolean isEqual = false;
+ if(otherValue instanceof StringValue) {
+ isEqual = ((StringValue)otherValue).value.equals(this.value);
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new string value with the same value as this string value.
+ StringValue newValue = (StringValue)(super.copy());
+ newValue.value = this.value;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new string value with no value.
+ return new StringValue();
+ }
+
+ public String toString() {
+ return value;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StructuredValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StructuredValue.java
new file mode 100644
index 00000000000..3aafdb67095
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/StructuredValue.java
@@ -0,0 +1,95 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Slot;
+import org.eclipse.uml2.uml.StructuralFeature;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public abstract class StructuredValue extends Value {
+
+ public ValueSpecification specify() {
+ // Return an instance value that specifies this structured value.
+ // Debug.println("[specify] StructuredValue...");
+ InstanceValue instanceValue = UMLFactory.eINSTANCE.createInstanceValue();
+ InstanceSpecification instance = UMLFactory.eINSTANCE.createInstanceSpecification();
+ instanceValue.setType(null);
+ instanceValue.setInstance(instance);
+ instance.getClassifiers().addAll(this.getTypes());
+ List<FeatureValue> featureValues = this.getFeatureValues();
+ // Debug.println("[specify] " + featureValues.size() + " feature(s).");
+ for(int i = 0; i < featureValues.size(); i++) {
+ FeatureValue featureValue = featureValues.get(i);
+ Slot slot = UMLFactory.eINSTANCE.createSlot();
+ slot.setDefiningFeature(featureValue.feature);
+ // Debug.println("[specify] feature = " + featureValue.feature.name
+ // + ", " + featureValue.values.size() + " value(s).");
+ List<Value> values = featureValue.values;
+ for(int j = 0; j < values.size(); j++) {
+ Value value = values.get(j);
+ // Debug.println("[specify] value = " + value);
+ slot.getValues().add(value.specify());
+ }
+ instance.getSlots().add(slot);
+ }
+ return instanceValue;
+ }
+
+ public abstract FeatureValue getFeatureValue(StructuralFeature feature);
+
+ public abstract void setFeatureValue(StructuralFeature feature, List<Value> values, Integer position);
+
+ public abstract List<FeatureValue> getFeatureValues();
+
+ public void createFeatureValues() {
+ // Create empty feature values for all structural features, direct and
+ // inherited, of the types of this structured value.
+ List<Classifier> types = this.getTypes();
+ for(int i = 0; i < types.size(); i++) {
+ Classifier type = types.get(i);
+ this.createFeatureValuesFromType(type); // REPLACED body of loop
+ }
+ }
+
+ // ADDED
+ public void createFeatureValuesFromType(Classifier type) {
+ // Create empty feature values for all structural features from the
+ // given type and all its direct and indirect parents.
+ // [Note that this is necessary in order to set the feature values for
+ // private structural features of parent classifiers, since these are
+ // not actually inherited.]
+ List<NamedElement> ownedMembers = type.getOwnedMembers();
+ for(int i = 0; i < ownedMembers.size(); i++) {
+ NamedElement member = ownedMembers.get(i);
+ if(member instanceof StructuralFeature) {
+ this.setFeatureValue((StructuralFeature)member, new ArrayList<Value>(), 0);
+ }
+ }
+
+ List<Classifier> generals = type.getGenerals();
+ for (int i = 0; i < generals.size(); i++) {
+ Classifier general = generals.get(i);
+ this.createFeatureValuesFromType(general);
+ }
+ }
+ //
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/UnlimitedNaturalValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/UnlimitedNaturalValue.java
new file mode 100644
index 00000000000..4c375644aff
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/UnlimitedNaturalValue.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import org.eclipse.uml2.uml.LiteralUnlimitedNatural;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class UnlimitedNaturalValue extends PrimitiveValue {
+
+ /*
+ * The actual unlimited natural value.
+ */
+ public Integer value;
+
+ public ValueSpecification specify() {
+ // Return a literal unlimited natural with the value of this unlimited
+ // natural value.
+ LiteralUnlimitedNatural literal = UMLFactory.eINSTANCE.createLiteralUnlimitedNatural();
+ literal.setType(this.type);
+ literal.setValue(this.value);
+ return literal;
+ }
+
+ public Boolean equals(Value otherValue) {
+ // Test if this unlimited natural value is equal to the otherValue.
+ // To be equal, the otherValue must have the same value as this
+ // unlimited natural value.
+ boolean isEqual = false;
+ if(otherValue instanceof UnlimitedNaturalValue) {
+ isEqual = ((UnlimitedNaturalValue)otherValue).value.equals(this.value); // CHANGED == to equals
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new unlimited natural value with the same value as this
+ // value.
+ UnlimitedNaturalValue newValue = (UnlimitedNaturalValue)(super.copy());
+ newValue.value = this.value;
+ return newValue;
+ }
+
+ public Value new_() {
+ // Create a new unlimited natural value with no value.
+ return new UnlimitedNaturalValue();
+ }
+
+ public String toString() {
+ String stringValue = "*";
+ if(this.value >= 0) {
+ IntegerValue integerValue = new IntegerValue();
+ integerValue.value = this.value;
+ stringValue = integerValue.toString();
+ }
+ return stringValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Value.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Value.java
new file mode 100644
index 00000000000..6603dc3216c
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/Classes/Kernel/Value.java
@@ -0,0 +1,92 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Loci.LociL1.SemanticVisitor;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public abstract class Value extends SemanticVisitor {
+
+ public abstract ValueSpecification specify();
+
+ public Boolean equals(Value otherValue) {
+ // Test if this value is equal to otherValue. To be equal, this value
+ // must have the same type as otherValue.
+ // This operation must be overridden in Value subclasses to check for
+ // equality of properties defined in those subclasses.
+ List<Classifier> myTypes = this.getTypes();
+ List<Classifier> otherTypes = otherValue.getTypes();
+ boolean isEqual = true;
+ // Debug.println("[equals] Value...");
+ // Debug.println("[equals] this has " + myTypes.size() +
+ // "types, other has " + otherTypes.size() + ".");
+ if(myTypes.size() != otherTypes.size()) {
+ isEqual = false;
+ } else {
+ // Debug.println("[equals] " + myTypes.size() + " type(s).");
+ int i = 1;
+ while(isEqual & i <= myTypes.size()) {
+ // Debug.println("[equals] this type = " +
+ // myTypes.get(i-1).name);
+ boolean matched = false;
+ int j = 1;
+ while(!matched & j <= otherTypes.size()) {
+ // Debug.println("[equals] other type = " +
+ // otherTypes.get(j-1).name);
+ matched = (otherTypes.get(j - 1) == myTypes.get(i - 1));
+ j = j + 1;
+ }
+ isEqual = matched;
+ i = i + 1;
+ }
+ }
+ return isEqual;
+ }
+
+ public Value copy() {
+ // Create a new value that is equal to this value.
+ // By default, this operation simply creates a new value with empty
+ // properties.
+ // It must be overridden in each Value subclass to do the superclass
+ // copy and then appropriately set properties defined in the subclass.
+ return this.new_();
+ }
+
+ public abstract Value new_();
+
+ public abstract List<Classifier> getTypes();
+
+ public Boolean hasType(Classifier type) {
+ // Check if this object has the given classifier as a type.
+ List<Classifier> types = this.getTypes();
+ boolean found = false;
+ int i = 1;
+ while(!found & i <= types.size()) {
+ found = (types.get(i - 1) == type);
+ i = i + 1;
+ }
+ return found;
+ }
+
+ public abstract String toString();
+
+ public String objectId() {
+ // Return an identifier for this object.
+ // [Non-normative.]
+ return super.toString();
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/Execution.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/Execution.java
new file mode 100644
index 00000000000..8495fe44af0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/Execution.java
@@ -0,0 +1,114 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+
+public abstract class Execution extends Object_ {
+
+ /*
+ * The object that provides the context for this execution. The type of the
+ * context of the execution must be the context of the type (behavior) of
+ * the execution.
+ */
+ public Object_ context;
+
+ /*
+ * The parameterValues for this execution. All parameterValues must have a
+ * parameter that is a parameter of the type of this execution. The values
+ * of all input (in and in-out) parameters must be set before the execution
+ * is executed.
+ */
+ public List<ParameterValue> parameterValues = new ArrayList<ParameterValue>();
+
+ public abstract void execute();
+
+ public void terminate() {
+ // Terminate an ongoing execution. By default, do nothing.
+ return;
+ }
+
+ public Value copy() {
+ // Create a new execution that has the same behavior and parameterValues
+ // as this execution.
+ // Debug.println("[Copy] execution = " + this);
+ Execution newValue = (Execution)(super.copy());
+ newValue.context = this.context;
+ List<ParameterValue> parameterValues = this.parameterValues;
+ for(int i = 0; i < parameterValues.size(); i++) {
+ ParameterValue parameterValue = parameterValues.get(i);
+ newValue.parameterValues.add(parameterValue.copy());
+ }
+ // Debug.println("[Copy] Done.");
+ return newValue;
+ }
+
+ public abstract Value new_();
+
+ public void setParameterValue(ParameterValue parameterValue) {
+ // Set the given parameter value for this execution.
+ // If a parameter value already existed for the parameter of the given
+ // parameter value, then replace its value.
+ // Debug.println("[setParameterValue] parameter = " +
+ // parameterValue.parameter.name + " with " +
+ // parameterValue.values.size() + " values");
+ ParameterValue existingParameterValue = this.getParameterValue(parameterValue.parameter);
+ if(existingParameterValue == null) {
+ this.parameterValues.add(parameterValue);
+ } else {
+ existingParameterValue.values = parameterValue.values;
+ }
+ }
+
+ public ParameterValue getParameterValue(Parameter parameter) {
+ // Get the parameter value of this execution corresponding to the given
+ // parameter (if any).
+ ParameterValue parameterValue = null;
+ int i = 1;
+ while(parameterValue == null & i <= this.parameterValues.size()) {
+ if(this.parameterValues.get(i - 1).parameter == parameter) {
+ parameterValue = this.parameterValues.get(i - 1);
+ }
+ i = i + 1;
+ }
+ return parameterValue;
+ }
+
+ public List<ParameterValue> getOutputParameterValues() {
+ // Return the parameter values for output (in-out, out and return)
+ // parameters.
+ List<ParameterValue> outputs = new ArrayList<ParameterValue>();
+ List<ParameterValue> parameterValues = this.parameterValues;
+ for(int i = 0; i < parameterValues.size(); i++) {
+ ParameterValue parameterValue = parameterValues.get(i);
+ Parameter parameter = parameterValue.parameter;
+ if((parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.OUT_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL)) {
+ outputs.add(parameterValue);
+ }
+ }
+ return outputs;
+ }
+
+ public Behavior getBehavior() {
+ // Get the behavior that is the type of this execution.
+ return (Behavior)(this.getTypes().get(0));
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/OpaqueBehaviorExecution.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/OpaqueBehaviorExecution.java
new file mode 100644
index 00000000000..62097cb60cb
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/OpaqueBehaviorExecution.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.debug.Debug;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+
+public abstract class OpaqueBehaviorExecution extends Execution {
+
+ public void execute() {
+ // Execute the body of the opaque behavior.
+ Debug.println("[execute] Opaque behavior " + this.getBehavior().getName() + "...");
+ List<Parameter> parameters = this.getBehavior().getOwnedParameters();
+ List<ParameterValue> inputs = new ArrayList<ParameterValue>();
+ List<ParameterValue> outputs = new ArrayList<ParameterValue>();
+ for(int i = 0; i < parameters.size(); i++) {
+ Parameter parameter = parameters.get(i);
+ if((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) {
+ inputs.add(this.getParameterValue(parameter));
+ }
+ if((parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.OUT_LITERAL) | (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL)) {
+ ParameterValue parameterValue = new ParameterValue();
+ parameterValue.parameter = parameter;
+ this.setParameterValue(parameterValue);
+ outputs.add(parameterValue);
+ }
+ }
+ this.doBody(inputs, outputs);
+ }
+
+ public abstract void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters);
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/ParameterValue.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/ParameterValue.java
new file mode 100644
index 00000000000..a05b5c23a51
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/BasicBehaviors/ParameterValue.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.uml2.uml.Parameter;
+
+public class ParameterValue {
+
+ public Parameter parameter;
+
+ /*
+ * The values of for the parameter. Zero or more values are possible, as
+ * constrained by the multiplicity of the parameter.
+ */
+ public List<Value> values = new ArrayList<Value>();
+
+ public ParameterValue copy() {
+ // Create a new parameter value for the same parameter as this parameter
+ // value, but with copies of the values of this parameter value.
+ ParameterValue newValue = new ParameterValue();
+ newValue.parameter = this.parameter;
+ List<Value> values = this.values;
+ for(int i = 0; i < values.size(); i++) {
+ Value value = values.get(i);
+ newValue.values.add(value.copy());
+ }
+ return newValue;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ArrivalSignal.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ArrivalSignal.java
new file mode 100644
index 00000000000..98b8e27113b
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ArrivalSignal.java
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications;
+
+public class ArrivalSignal {
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ClassifierBehaviorExecution.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ClassifierBehaviorExecution.java
new file mode 100644
index 00000000000..da4e71474a0
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/ClassifierBehaviorExecution.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications;
+
+import java.util.List;
+
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Object_;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.Execution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Class;
+
+public class ClassifierBehaviorExecution {
+
+ /*
+ * The execution of the associated classifier behavior for a certain object.
+ */
+ public Execution execution;
+
+ /*
+ * The classifier whose behavior is being executed. (This must be an active
+ * class.)
+ */
+ public Class classifier;
+
+ /*
+ * The object activation that owns this classifier behavior execution.
+ */
+ public ObjectActivation objectActivation;
+
+ public void execute(Class classifier, List<ParameterValue> inputs) {
+ // Set the classifier for this classifier behavior execution to the
+ // given class.
+ // If the given class is a behavior, set the execution to be the object
+ // of the object activation of the classifier behavior execution.
+ // Otherwise the class must be an active class, so get an execution
+ // object for the classifier behavior for the class.
+ // Set the input parameters for the execution to the given values.
+ // Then start the active behavior of this ClassifierBehaviorExecution
+ // object, which will execute the execution object on a separate thread
+ // of control.
+ // Debug.println("[execute] Executing behavior for " + classifier.name +
+ // "...");
+ this.classifier = classifier;
+ Object_ object = this.objectActivation.object;
+ if(classifier instanceof Behavior) {
+ this.execution = (Execution)object;
+ } else {
+ this.execution = object.locus.factory.createExecution(classifier.getClassifierBehavior(), object);
+ }
+ if(inputs != null) {
+ for(int i = 0; i < inputs.size(); i++) {
+ ParameterValue input = inputs.get(i);
+ this.execution.setParameterValue(input);
+ }
+ }
+ _startObjectBehavior();
+ }
+
+ public void _startObjectBehavior() {
+ this.execution.execute();
+ }
+
+ public void terminate() {
+ // Terminate the associated execution.
+ // If the execution is not itself the object of the object activation,
+ // then destroy it.
+ // Debug.println("[terminate] Terminating behavior for " +
+ // classifier.name + "...");
+ this.execution.terminate();
+ if(this.execution != this.objectActivation.object) {
+ this.execution.destroy();
+ }
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/EventAccepter.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/EventAccepter.java
new file mode 100644
index 00000000000..7b8d9979e82
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/EventAccepter.java
@@ -0,0 +1,21 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications;
+
+public abstract class EventAccepter {
+
+ public abstract void accept(SignalInstance signalInstance);
+
+ public abstract Boolean match(SignalInstance signalInstance);
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/FIFOGetNextEventStrategy.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/FIFOGetNextEventStrategy.java
new file mode 100644
index 00000000000..b7df045e6c6
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/FIFOGetNextEventStrategy.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.Communications;
+
+public class FIFOGetNextEventStrategy extends GetNextEventStrategy {
+
+ public SignalInstance getNextEvent(ObjectActivation objectActivation) {
+ // Get the first event from the given event pool. The event is removed
+ // from the pool.
+ SignalInstance signalInstance = objectActivation.eventPool.get(0);
+ objectActivation.eventPool.remove(0);
+ return signalInstance;
+ }
+}
diff --git a/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/GetNextEventStrategy.java b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/GetNextEventStrategy.java
new file mode 100644
index 00000000000..938c02d901e
--- /dev/null
+++ b/sandbox/Moka/org.eclipse.papyrus.moka.fuml/generated/org/eclipse/papyrus/moka/fuml/Semantics/CommonBehaviors/Communications/GetNextEventStrategy.java
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public Licens