1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- include "primitives.alh"
- SimpleClassDiagrams Environment_PW{
- SimpleAttribute Natural{
- constraint = $
- String function constraint_Natural(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_String(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 {
- }
- Class Port : Named, Positionable {}
- Class Boundary : Named, Positionable {}
- Class Activity : Named, Positionable {}
- Class CommunicationSequence : Activity {
- actor : String
- }
- Class TopActivity : Activity {}
- Class Parallel : TopActivity {}
- Class Sequence : TopActivity {}
- Class Alternative : TopActivity {}
- Class Event : Named {}
- 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 NextActivity (Activity, Activity) {}
- Association PortEvent (Port, Event) {}
- }
|