12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 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 {
- duration : Natural
- }
- Class CommunicationSequence : Activity {
- actor : String
- }
- Class Parallel : Activity {}
- Class Sequence : Activity {}
- Class Alternative : Activity {}
- Class Event : Activity {}
- Association Contains (Activity, Activity) {}
- Association HasActivity (Boundary, Activity) {
- target_lower_cardinality = 1
- target_upper_cardinality = 1
- }
- Association HasPort (Boundary, Port) {}
- Association HasActivity (TopActivity, Activity) {}
- Association HasEventSequence (CommunicationSequence, Event) {}
- Association Next (Activity, Activity) {}
- Association PortEvent (Port, Event) {}
- }
|