12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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 Activity : Named {
- duration : Natural
- }
- Class CommunicationSequence : Activity {}
- Class Parallel : Activity {}
- Class Sequence : Activity {}
- Class Alternative : Activity {}
- Class Event : Activity {}
- Association Contains (Activity, Activity) {}
- Association Next (Activity, Activity) {}
- }
|