control_PW.mvc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. SimpleClassDiagram Control_PW{
  2. SimpleAttribute Integer{
  3. constraint = $
  4. String function constraint(model : Element, name : String):
  5. if (is_physical_int(model["model"][name])):
  6. return "OK"!
  7. else:
  8. return "Integer has non-integer value"!
  9. }
  10. SimpleAttribute String{
  11. constraint = $
  12. String function constraint(model : Element, name : String):
  13. if (is_physical_string(model["model"][name])):
  14. return "OK"!
  15. else:
  16. return "String has non-string value"!
  17. $
  18. }
  19. Class Named {
  20. name : String
  21. }
  22. Class Positionable {
  23. x : Integer
  24. y : Integer
  25. }
  26. Class Boundary : Named, Positionable {}
  27. Class Port : Named, Positionable {}
  28. Class Transition : Named, Positionable {}
  29. Class State : Named, Positionable {}
  30. Association Has1 (Boundary, State) {}
  31. Association Has2 (Boundary, Port) {}
  32. Association Has3 (Boundary, Transition) {}
  33. Association PortTransition (Port, Transition) {}
  34. Association From (State, Transition) {}
  35. Association To (Transition, State) {}
  36. Association PortState (Port, State) {}
  37. }