|
@@ -0,0 +1,62 @@
|
|
|
+SimpleClassDiagrams Environment_PW{
|
|
|
+ SimpleAttribute Integer{
|
|
|
+ constraint = $
|
|
|
+ String function constraint(model : Element, name : String):
|
|
|
+ if (is_physical_int(model["model"][name])):
|
|
|
+ return "OK"!
|
|
|
+ else:
|
|
|
+ return "Integer has non-integer value"!
|
|
|
+ }
|
|
|
+
|
|
|
+ SimpleAttribute Natural{
|
|
|
+ constraint = $
|
|
|
+ String function constraint(model : Element, name : String):
|
|
|
+ if (is_physical_int(model["model"][name])):
|
|
|
+ if (integer_gte(model["model"][name], 0)):
|
|
|
+ return "OK"!
|
|
|
+ else:
|
|
|
+ return "Natural has negative value"!
|
|
|
+ else:
|
|
|
+ return "Natural has non-integer value"!
|
|
|
+ }
|
|
|
+
|
|
|
+ SimpleAttribute String{
|
|
|
+ constraint = $
|
|
|
+ String function constraint(model : Element, name : String):
|
|
|
+ if (is_physical_string(model["model"][name])):
|
|
|
+ return "OK"!
|
|
|
+ else:
|
|
|
+ return "String has non-string value"!
|
|
|
+ $
|
|
|
+ }
|
|
|
+
|
|
|
+ Class Named {
|
|
|
+ name : String
|
|
|
+ }
|
|
|
+
|
|
|
+ Class Positionable {
|
|
|
+ x : Integer
|
|
|
+ y : Integer
|
|
|
+ }
|
|
|
+
|
|
|
+ Class Port : Named, Positionable {}
|
|
|
+ Class Boundary : Named, Positionable {}
|
|
|
+ Class Activity : Named, Positionable {}
|
|
|
+ Class CommunicationSequence : Activity {}
|
|
|
+ Class TopActivity : Activity {}
|
|
|
+ Class Parallel : TopActivity {}
|
|
|
+ Class Sequence : TopActivity {}
|
|
|
+ Class Alternative : TopActivity {}
|
|
|
+ Class Input : Event {}
|
|
|
+ Class Output : Event {
|
|
|
+ duration : Natural
|
|
|
+ }
|
|
|
+
|
|
|
+ Association Has1 (Boundary, TopActivity) {}
|
|
|
+ Association Has2 (Boundary, Event) {}
|
|
|
+ Association Has3 (Boundary, Port) {}
|
|
|
+ Association HasActivity (TopActivity, Activity) {}
|
|
|
+ Association HasEventSequence (CommunicationSequence, Event) {}
|
|
|
+ Association NextEvent (Event, Event) {}
|
|
|
+ Association PortEvent (Port, Event) {}
|
|
|
+}
|