@namespace(uri="flowchart", prefix="f") package flowchart; abstract class NamedElement { attr String name; } class Flowchart extends NamedElement { val Node[*] nodes; val Transition[*] transitions; } abstract class Node extends NamedElement { ref Transition[*]#source outgoing; ref Transition[*]#target incoming; } class Transition extends NamedElement { ref Node#outgoing source; ref Node#incoming target; } class Action extends Node { } class Decision extends Node { } class Subflow extends Flowchart, Node { }