<general_metatype_properties> =
{
  # RWI specific properties

  $shapeType = "ShapeType";
  $name = "Name";
  $fullName = "Full name";
  $doc = "Documentation";
  $hyperlink = "Hyperlinks to Elements";
  $extends = "Extends";
  $implements = "Implements";
  $throw = "Throws";
  $parameter = "Parameter";
  $returnType = "Return type";

  $native = "native", boolean;
  $synchronized = "synchronized", boolean;
  $final = "final", boolean;
  $static = "static", boolean;
  $abstract = "abstract", boolean;
  $private = "private", boolean;
  $protected = "protected", boolean;
  $public = "public", boolean;

  $const = "const", boolean;
  $inline = "inline", boolean;
  $type = "Type";
  $associates = "Associates";
  $transient = "transient", boolean;
  $volatile = "volatile", boolean;


  visibility = "Visibility";

  # properties processed by GenDoc

  %decl = "Declaration";
  %param_signature = "Parameters signature";
  %package = "Containing package";
  %src_shape_type = "ShapeType of link source";
  %src_name = "Name of link source";
  %src_full_name = "FullName of link source";
  %dest_shape_type = "ShapeType of link destination";
  %dest_name = "Name of link destination";
  %dest_full_name = "FullName of link destination";
  %annotation = "Annotation";
  %extClassName = "Extended class name"; # the same as "$name" but for inner classes 
                                         # it's leaded by the owning class name prefix

  # Documentation tags

  author = "Author";
  url = "Hyperlinks to URL";
  deprecated = "Deprecated";
  param = "Parameter doc"
  return = "Return doc";
  exception = "Exception doc";
  see = "See Also";
  since = "Since";
  version = "Version";
  persistent = "persistent", boolean;

  # Other

  type = "Type";
  stereotype = "Stereotype";
  alias = "Alias";
  label = "Label";
  clientRole = "Client Role";
  clientCardinality = "Client Cardinality";
  clientQualifier = "Client Qualifier";
  supplierRole = "Supplier Role";
  supplierCardinality = "Supplier Cardinality";
  supplierQualifier = "Supplier Qualifier";

  # Object's properties

  $instantiates = "Instantiates";
  persistence = "Persistence";
  concurent = "concurent", boolean;
  active = "active", boolean;
  multipleInstance = "multiple instances", boolean;
  state = "State";
  stereotype = "Stereotype";

  # State diagram specific

  event = "Event";
  eventArguments = "Event arguments";
  condition = "Condition";
  action = "Action";
  sendClause = "Send clause";
  sendTime = "Send time";
  receiveTime = "Receive time";
  constraint = "Constraint";

  # ER diagram specific

  physicalName="Physical Name";
}

#--------------------------------------------------------------------
# RWI Generic Metatypes
#--------------------------------------------------------------------

<metatype>
  name=MODEL_META_TYPE
  rwi_entity=model
  contained_metatypes = { PACKAGE;
                          CLASS;
                          INTERFACE;
                          CLASS_DIAGRAM;
                          STATE_DIAGRAM;
                          INTERACTION_DIAGRAM;
                          ACTIVITY_DIAGRAM;
                          COMPONENT_DIAGRAM;
                          DEPLOYMENT_DIAGRAM;
                          USECASE_DIAGRAM;
                          BUSINESS_PROCESS_DIAGRAM;
                          ER_DIAGRAM }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ELEMENT
  rwi_entity=element
  full_name="Element (generic)"
  properties = { $shapeType;
                 $name; 
                 $doc;
                 %annotation;
                 $hyperlink;
                 url }
  excluded_properties = { $shapeType; 
                          $name }
  contained_metatypes = { HYPERLINK_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=PACKAGE
  extends=ELEMENT
  rwi_entity=package
  full_name="Package"
  properties = { $fullName;
                 %package;
                 stereotype;
                 alias }
  contained_metatypes = { PACKAGE;
                          CLASS;
                          INTERFACE;
                          ASSOCIATION_LINK;
                          DEPENDENCY_LINK;
                          CLASS_DIAGRAM;
                          STATE_DIAGRAM;
                          INTERACTION_DIAGRAM;
                          ACTIVITY_DIAGRAM;
                          COMPONENT_DIAGRAM;
                          DEPLOYMENT_DIAGRAM;
                          USECASE_DIAGRAM;
                          BUSINESS_PROCESS_DIAGRAM;
                          ER_DIAGRAM }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DIAGRAM
  extends=ELEMENT
  rwi_entity=diagram
  full_name="Diagram (generic)"
  properties = { %package;
                 stereotype; 
                 alias }
  contained_metatypes = { DIAGRAM_REFERENCE; NODE; LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DIAGRAM_REFERENCE
  extends=ELEMENT
  rwi_entity=diagram_reference
  full_name="Diagram reference"
  properties = { %package; 
                 stereotype; 
                 alias }
  contained_metatypes = { LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=NODE
  extends=ELEMENT
  rwi_entity=node
  full_name="Node (generic)"
  properties = { %package }
  contained_metatypes = { NODE; MEMBER; LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=MEMBER
  extends=ELEMENT
  rwi_entity=member
  full_name="Member (generic)"
  contained_metatypes = { LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=LINK
  rwi_entity=link
  full_name="Link (generic)"
  properties = { $shapeType;
                 $doc;
                 %annotation;
                 %src_shape_type;
                 %src_name;
                 %src_full_name;
                 %dest_shape_type;
                 %dest_name;
                 %dest_full_name }
  excluded_properties = { $shapeType; 
                          $name;
                          $label }
</metatype>

#--------------------------------------------------------------------
# Commonly used Metatypes
#--------------------------------------------------------------------

<metatype>
  name=OBJECT
  extends=NODE
  full_name="Object (generic)"
  metatype_filter='hasPropertyValue("$shapeType","Object")'
  properties = { $instantiates;
                 persistence;
                 concurent;
                 active;
                 multipleInstance;
                 state;
                 stereotype }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=STATE
  extends=NODE
  full_name="State (generic)"
  metatype_filter='hasPropertyValue("$shapeType","StartState") ||'
                  'hasPropertyValue("$shapeType","EndState") ||'
                  'hasPropertyValue("$shapeType","State") ||'
                  'hasPropertyValue("$shapeType","SyncBar") ||'
                  'hasPropertyValue("$shapeType","History")'
  contained_metatypes = { TRANSITION_LINK;
                          INTERNAL_TRANSITION;
                          DEFERRED_EVENT }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=INTERNAL_TRANSITION
  extends=MEMBER
  full_name="Internal Transition"
  metatype_filter='hasPropertyValue("$shapeType","InternalTransition")'
  properties = { eventArguments;
                 condition;
                 action }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DEFERRED_EVENT
  extends=MEMBER
  full_name="Deferred event"
  metatype_filter='hasPropertyValue("$shapeType","DeferredEvent")'
  properties = { eventArguments;
                 condition }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=COMPONENT
  extends=NODE
  full_name="Component (generic)"
  metatype_filter='hasPropertyValue("$shapeType","Component")'
  properties = { type;
                 stereotype }
  contained_metatypes = { SUPPORTS_LINK;
                          DEPENDENCY_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ASSOCIATION_LINK
  extends=LINK
  full_name="Association link"
  metatype_filter='hasPropertyValue("$shapeType","AssociationLink")'
  properties = { label;
                 associationAsClass="Association Class";
                 clientRole;
                 clientCardinality;
                 clientQualifier;
                 supplierRole;
                 supplierCardinality;
                 supplierQualifier;
                 $directed="Directed";
                 $type="Type" }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ASSOCIATES_LINK
  extends=LINK
  full_name="Associates link"
  metatype_filter='hasPropertyValue("$shapeType","AssociatesLink")'
  properties = { label;
                 clientRole;
                 clientCardinality;
                 supplierRole;
                 supplierCardinality }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=AGGREGATES_LINK
  extends=LINK
  full_name="Aggregates link"
  metatype_filter='hasPropertyValue("$shapeType","AggregatesLink")'
  properties = { label;
                 supplierCardinality }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=GENERALIZATION_LINK
  extends=LINK
  full_name="Generalization link"
  metatype_filter='hasPropertyValue("$shapeType","GeneralizationLink")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=IMPLEMENTATION_LINK
  extends=LINK
  full_name="Implementation link"
  metatype_filter='hasPropertyValue("$shapeType","ImplementationLink")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=COMMUNICATES_LINK
  extends=LINK
  full_name="Communicates Link"
  metatype_filter='hasPropertyValue("$shapeType","CommunicatesLink")'
  properties = { label;
                 clientRole;
                 clientCardinality;
                 supplierRole;
                 supplierCardinality }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=EXTENDS_LINK
  extends=LINK
  full_name="Extends Link"
  metatype_filter='hasPropertyValue("$shapeType","ExtendsLink")'
  properties = { label }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=INCLUDES_LINK
  extends=LINK
  full_name="Includes Link"
  metatype_filter='hasPropertyValue("$shapeType","IncludesLink")'
  properties = { label }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=TRANSITION_LINK
  extends=LINK
  full_name="Transition Link"
  metatype_filter='hasPropertyValue("$shapeType","TransitionLink")'
  properties = { event;
                 eventArguments;
                 condition;
                 action;
                 sendClause;
                 sendTime;
                 receiveTime;
                 constraint }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DEPENDENCY_LINK
  extends=LINK
  full_name="Dependency Link"
  metatype_filter='hasPropertyValue("$shapeType","DependencyLink")'
  properties = { label; stereotype; clientRole; supplierRole }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SUPPORTS_LINK
  extends=LINK
  full_name="Supports Link"
  metatype_filter='hasPropertyValue("$shapeType","SupportsLink")'
  properties = { label }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SUBSCRIBES_LINK
  extends=LINK
  full_name="Subscribes Link"
  metatype_filter='hasPropertyValue("$shapeType","SubscribesLink")'
  properties = { label; condition }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=HYPERLINK_LINK
  extends=LINK
  full_name="Hyperlink"
  metatype_filter='hasPropertyValue("$shapeType","Hyperlink")'
</metatype>

#--------------------------------------------------------------------
# Class Diagram
#--------------------------------------------------------------------

<metatype>
  name=CLASS_DIAGRAM
  extends=DIAGRAM
  full_name="Class Diagram"
  metatype_filter='hasPropertyValue("$shapeType","ClassDiagram")'
  contained_metatypes = { PACKAGE_REFERENCE;
                          CLASS;
                          INTERFACE;
                          CLASSD_OBJECT;
                          ACTOR;
                          USECASE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=PACKAGE_REFERENCE
  extends=DIAGRAM_REFERENCE
  full_name="Package reference"
  metatype_filter='hasPropertyValue("$shapeType","ClassDiagram") && hasProperty("$physicalPackage")'
  properties = { $fullName;
                 stereotype;
                 alias }
  contained_metatypes = { GENERALIZATION_LINK;
                          DEPENDENCY_LINK;
                          ASSOCIATION_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=GENERIC_CLASS
  extends=NODE
  full_name="Class (generic)"
  metatype_filter='hasPropertyValue("$shapeType","Class")'
  properties = { $fullName;
                 %extClassName;
                 %decl;
                 $extends;
                 $implements;
                 $public;
                 visibility;
                 $static;
                 $final; 
                 $abstract;
                 stereotype;
                 alias;
                 $relativeFile = "File";
                 invariants = "Invariants";
                 see;
                 version; 
                 author;
                 exception;
                 deprecated;
                 since;
                 persistent }
  contained_metatypes = { CLASS;
                          INTERFACE;
                          OPERATION;
                          CONSTRUCTOR;
                          DESTRUCTOR;
                          ATTRIBUTE;
                          GENERALIZATION_LINK;
                          IMPLEMENTATION_LINK;
                          DEPENDENCY_LINK;
                          ASSOCIATION_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=CLASS
  extends=GENERIC_CLASS
  full_name="Class"
  metatype_filter='! hasProperty("$interface")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=INTERFACE
  extends=GENERIC_CLASS
  full_name="Interface"
  metatype_filter='hasProperty("$interface")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=GENERIC_OPERATION
  extends=MEMBER
  full_name="Operation (generic)"
  metatype_filter='hasPropertyValue("$shapeType","Operation")'
  properties = { $fullName;
                 $parameter;
                 $returnType;
                 $throw;
                 $native;
                 $synchronized;
                 $final;
                 $static;
                 $abstract;
                 $private;
                 $protected;
                 $public;
                 $const;
                 $inline;
                 %decl;
                 %param_signature;
                 param; 
                 return; 
                 exception; 
                 stereotype;
                 alias; 
                 see;
                 version;
                 author;
                 deprecated;
                 since;
                 input = "Input";
                 output = "Output";
                 time = "Time";
                 preconditions = "Preconditions";
                 postconditions = "Postconditions";
                 semantics = "Semantics" }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=OPERATION
  extends=GENERIC_OPERATION
  full_name="Operation"
  metatype_filter='! hasProperty("$constructor") && ! hasProperty("$destructor")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=CONSTRUCTOR
  extends=GENERIC_OPERATION
  full_name="Constructor"
  metatype_filter='hasProperty("$constructor")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DESTRUCTOR
  extends=GENERIC_OPERATION
  full_name="Destructor"
  metatype_filter='hasProperty("$destructor")'
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ATTRIBUTE
  extends=MEMBER
  full_name="Attribute"
  metatype_filter='hasPropertyValue("$shapeType","Attribute")'
  properties = { $fullName;
                 %decl;
                 stereotype;
                 alias;
                 $type;
                 $associates;
                 $initialValue = "Initial Value";
                 $volatile;
                 $transient;
                 $static;
                 $final;
                 $private;
                 $protected;
                 $public;
                 see;
                 version;
                 author;
                 deprecated; 
                 since }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=CLASSD_OBJECT
  extends=OBJECT
  full_name="Object (of Class Diagram)"
  contained_metatypes = { DEPENDENCY_LINK;
                          ASSOCIATION_LINK }
</metatype>

#--------------------------------------------------------------------
# State Diagram
#--------------------------------------------------------------------

<metatype>
  name=STATE_DIAGRAM
  extends=DIAGRAM
  full_name="State Diagram"
  metatype_filter='hasPropertyValue("$shapeType","StateDiagram")'
  contained_metatypes = { STD_STATE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=STD_STATE
  extends=STATE
  full_name="State (of State Diagram)"
  contained_metatypes = { STD_STATE }
</metatype>

#--------------------------------------------------------------------
# Interaction Diagram
#--------------------------------------------------------------------

<metatype>
  name=INTERACTION_DIAGRAM
  extends=DIAGRAM
  full_name="Interaction Diagram"
  metatype_filter='hasPropertyValue("$shapeType","SequenceDiagram")'
  contained_metatypes = { INTRD_OBJECT }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=INTRD_OBJECT
  extends=OBJECT
  full_name="Object (of Interaction Diagram)"
  contained_metatypes = { MESSAGE_LINK;
                          ASSOCIATES_LINK;
                          AGGREGATES_LINK;
                          DEPENDENCY_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=MESSAGE_LINK
  extends=LINK
  full_name="Message Link"
  metatype_filter='hasPropertyValue("$shapeType","MessageLink")'
  properties = { label = "Name";
                 $sequenceNumber = "Number";
                 operation = "Operation", reference;
                 arguments = "Arguments";
                 return = "Return";
                 condition;
                 iteration = "Iteration";
                 $creationMessage = "creation message", boolean;
                 $destructionMessage = "destruction message", boolean;
                 $controlFlowType = "Synchronization";
                 $nonAtomicDelivery = "non-atomic delivery", boolean;
                 sendTime;
                 receiveTime;
                 constraint;
                 showReturnArrow = "return arrow", boolean }
</metatype>

#--------------------------------------------------------------------
# Activity Diagram
#--------------------------------------------------------------------

<metatype>
  name=ACTIVITY_DIAGRAM
  extends=DIAGRAM
  full_name="Activity Diagram"
  metatype_filter='hasPropertyValue("$shapeType","ActivityDiagram")'
  contained_metatypes = { SWIMLANE;
                          ACTIVITY;
                          DECISION;
                          SIGNAL_SENDING;
                          SIGNAL_RECEIPT;
                          ACTD_OBJECT;
                          ACTD_STATE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SWIMLANE
  extends=NODE
  full_name="SwimLane"
  metatype_filter='hasPropertyValue("$shapeType","SwimLane")'
  contained_metatypes = { ACTIVITY;
                          DECISION;
                          SIGNAL_SENDING;
                          SIGNAL_RECEIPT;
                          ACTD_OBJECT;
                          ACTD_STATE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ACTIVITY
  extends=NODE
  full_name="Activity"
  metatype_filter='hasPropertyValue("$shapeType","Activity")'
  contained_metatypes = { TRANSITION_LINK;
                          OBJECT_FLOW_LINK;
                          INTERNAL_TRANSITION;
                          DEFERRED_EVENT }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DECISION
  extends=NODE
  full_name="Decision"
  metatype_filter='hasPropertyValue("$shapeType","Decision")'
  contained_metatypes = { TRANSITION_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SIGNAL_SENDING
  extends=NODE
  full_name="Signal Sending"
  metatype_filter='hasPropertyValue("$shapeType","SignalSending")'
  properties = { $name="Signal signature" }
  contained_metatypes = { TRANSITION_LINK;
                          OBJECT_FLOW_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SIGNAL_RECEIPT
  extends=NODE
  full_name="Signal Receipt"
  metatype_filter='hasPropertyValue("$shapeType","SignalReceipt")'
  properties = { $name="Signal signature" }
  contained_metatypes = { TRANSITION_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ACTD_STATE
  extends=STATE
  full_name="State (of Activity Diagram)"
  contained_metatypes = { ACTIVITY;
                          DECISION;
                          SIGNAL_SENDING;
                          SIGNAL_RECEIPT;
                          ACTD_OBJECT;
                          ACTD_STATE;
                          OBJECT_FLOW_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ACTD_OBJECT
  extends=OBJECT
  full_name="Object (of Activity Diagram)"
  contained_metatypes = { OBJECT_FLOW_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=OBJECT_FLOW_LINK
  extends=LINK
  full_name="Object Flow Link"
  metatype_filter='hasPropertyValue("$shapeType","ObjectFlowLink")'
  properties = { $label="Name" }
</metatype>

#--------------------------------------------------------------------
# Component Diagram
#--------------------------------------------------------------------

<metatype>
  name=COMPONENT_DIAGRAM
  extends=DIAGRAM
  full_name="Component Diagram"
  metatype_filter='hasPropertyValue("$shapeType","ComponentDiagram")'
  contained_metatypes = { SUBSYSTEM;
                          COMPD_COMPONENT;
                          COMPD_DEPLD_INTERFACE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SUBSYSTEM
  extends=NODE
  full_name="Subsystem"
  metatype_filter='hasPropertyValue("$shapeType","Subsystem")'
  contained_metatypes = { DEPENDENCY_LINK;
                          SUBSYSTEM;
                          COMPD_COMPONENT;
                          COMPD_DEPLD_INTERFACE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=COMPD_COMPONENT
  extends=COMPONENT
  full_name="Component (of Component Diagram)"
  contained_metatypes = { COMPD_COMPONENT;
                          SUBSYSTEM;
                          COMPD_DEPLD_INTERFACE }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=COMPD_DEPLD_INTERFACE
  extends=NODE
  full_name="Interface (of Component/Deployment Diagram)"
  metatype_filter='hasPropertyValue("$shapeType","Interface")'
  properties = { stereotype }
  contained_metatypes = { SUPPORTS_LINK;
                          DEPENDENCY_LINK;
                          ASSOCIATES_LINK }
</metatype>

#--------------------------------------------------------------------
# Deployment Diagram
#--------------------------------------------------------------------

<metatype>
  name=DEPLOYMENT_DIAGRAM
  extends=DIAGRAM
  full_name="Deployment Diagram"
  metatype_filter='hasPropertyValue("$shapeType","DeploymentDiagram")'
  contained_metatypes = { DEPLD_NODE;
                          DEPLD_COMPONENT;
                          COMPD_DEPLD_INTERFACE;
                          DEPLD_OBJECT }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DEPLD_NODE
  extends=NODE
  full_name="Node (of Deployment Diagram)"
  metatype_filter='hasPropertyValue("$shapeType","Node")'
  properties = { type }
  contained_metatypes = { ASSOCIATES_LINK;
                          AGGREGATES_LINK;
                          DEPENDENCY_LINK;
                          DEPLD_NODE;
                          DEPLD_COMPONENT;
                          COMPD_DEPLD_INTERFACE;
                          DEPLD_OBJECT }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DEPLD_COMPONENT
  extends=COMPONENT
  full_name="Component (of Deployment Diagram)"
  contained_metatypes = { ASSOCIATES_LINK;
                          AGGREGATES_LINK;
                          DEPLD_COMPONENT;
                          COMPD_DEPLD_INTERFACE;
                          DEPLD_OBJECT }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=DEPLD_OBJECT
  extends=OBJECT
  full_name="Object (of Deployment Diagram)"
  contained_metatypes = { SUPPORTS_LINK;
                          DEPENDENCY_LINK;
                          ASSOCIATES_LINK;
                          AGGREGATES_LINK }
</metatype>

#--------------------------------------------------------------------
# UseCase Diagram
#--------------------------------------------------------------------

<metatype>
  name=USECASE_DIAGRAM
  extends=DIAGRAM
  full_name="UseCase Diagram"
  metatype_filter='hasPropertyValue("$shapeType","UseCaseDiagram")'
  contained_metatypes = { ACTOR; USECASE; SYSTEM_BOUNDARY }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ACTOR
  extends=NODE
  full_name="Actor"
  metatype_filter='hasPropertyValue("$shapeType","Actor")'
  properties = { stereotype }
  contained_metatypes = { COMMUNICATES_LINK;
                          GENERALIZATION_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=USECASE
  extends=NODE
  full_name="UseCase"
  metatype_filter='hasPropertyValue("$shapeType","UseCase")'
  properties = { stereotype;
                 rank="Rank";
                 abstract = "abstract", boolean; }
  contained_metatypes = { COMMUNICATES_LINK;
                          EXTENDS_LINK;
                          INCLUDES_LINK;
                          GENERALIZATION_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=SYSTEM_BOUNDARY
  extends=NODE
  full_name="System Boundary"
  metatype_filter='hasPropertyValue("$shapeType","SystemBoundary")'
  contained_metatypes = { USECASE;
                          GENERALIZATION_LINK }
</metatype>

#--------------------------------------------------------------------
# Business Process Diagram
#--------------------------------------------------------------------

<metatype>
  name=BUSINESS_PROCESS_DIAGRAM
  extends=DIAGRAM
  full_name="Business Process Diagram"
  metatype_filter='hasPropertyValue("$shapeType","BusinessProcessDiagram")'
  contained_metatypes = { BPD_ACTOR;
                          USECASE;
                          BUSINESS_WORKER;
                          BUSINESS_ENTITY;
                          BPD_SYSTEM_BOUNDARY }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=BPD_ACTOR
  extends=ACTOR
  full_name="Actor (of BP Diagram)"
  contained_metatypes = { SUBSCRIBES_LINK; ASSOCIATES_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=BUSINESS_WORKER
  extends=NODE
  full_name="Business Worker"
  metatype_filter='hasPropertyValue("$shapeType","BusinessWorker")'
  properties = { stereotype }
  contained_metatypes = { COMMUNICATES_LINK;
                          AGGREGATES_LINK;
                          GENERALIZATION_LINK;
                          ASSOCIATES_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=BUSINESS_ENTITY
  extends=NODE
  full_name="Business Entity"
  metatype_filter='hasPropertyValue("$shapeType","BusinessEntity")'
  contained_metatypes = { SUBSCRIBES_LINK;
                          AGGREGATES_LINK;
                          GENERALIZATION_LINK;
                          ASSOCIATES_LINK }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=BPD_SYSTEM_BOUNDARY
  extends=SYSTEM_BOUNDARY
  full_name="System Boundary (of BP Diagram)"
  contained_metatypes = { BUSINESS_WORKER;
                          BUSINESS_ENTITY;
                          ASSOCIATES_LINK; }
</metatype>

#--------------------------------------------------------------------
# ER-Diagram
#--------------------------------------------------------------------

<metatype>
  name=ER_DIAGRAM
  extends=DIAGRAM
  full_name="ER-Diagram"
  metatype_filter='hasPropertyValue("$shapeType","ERDiagram")'
  contained_metatypes = { ER_ENTITY }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ER_ENTITY
  extends=NODE
  full_name="ER-Entity"
  metatype_filter='hasPropertyValue("$shapeType","erEntity")'
  properties = { $name = "Logical name";
                 rdbPhysicalName = "Physical name";
                 rdbPhysicalPrimaryKeyName = "Primary Key Name"; }

  contained_metatypes = { ER_ATTRIBUTE;
                          ER_RELATIONSHIP }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ER_ATTRIBUTE
  extends=MEMBER
  full_name="ER-Attribute"
  metatype_filter='hasPropertyValue("$shapeType","erAttribute")'
  properties = { $name = "Logical/Role name";
                 rdbPhysicalName = "Physical name";
                 rdbPrimaryKey = "Primary Key", boolean;
                 rdbNotNull = "NOT NULL", boolean;
                 rdbLogicalType = "Generic jdbc name of correspondent column type";
                 rdbSize = "Size part of type information";
                 rdbDigits = "Precision part of type information";
                 rdbPhysicalType = "Server-specific name of correspondent column type";
                 referencedAttribute = "Referenced Attribute", reference;
                 foreignLink = "Foreign Link", reference; }
</metatype>

#--------------------------------------------------------------------
<metatype>
  name=ER_RELATIONSHIP
  extends=LINK
  full_name="ER-Relationship"
  metatype_filter='hasPropertyValue("$shapeType","erRelationship")'
  properties = { $name = "Verb phrase";
                 rdbPhysicalName = "Constraint name";
                 rdbIdentifying = "Identifying", boolean;
                 rdbOptional = "Optional", boolean;
                 erCardinality = "Cardinality"; } 
</metatype>

#--------------------------------------------------------------------
