Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how to make GMF able to see the difference between association and aggregation from xsd.
how to make GMF able to see the difference between association and aggregation from xsd. [message #208378] Sun, 12 October 2008 09:49
Eclipse UserFriend
Originally posted by: mattia.lambertini.studio.unibo.it

Hi,

first of all: sorry for my not good english, I am tryng to improve it.

I have an XSD that rappresent my domain model for a new process modeling
language EPML( here you can find a technical report:
http://www.cs.unibo.it/pub/TR/UBLCS/ABSTRACTS/2007.bib?ncstr l.cabernet//BOLOGNA-UBLCS-2007-22
).

I have to use that schema for building an eclipse GMF plugin.

My problem is that the association are rappresented as aggregation when
i generate the EMF model from that schema ad so i can't create link.

I saw the document XMLSchemaToEcoreMapping.pdf and the code of the XSD
about mindmap tutorial. But I don't understand how to use
ecore:reference and ecore:opposite in my context. And if it is possible.

The TEdge class rappresent's links.

thanks for help!

this is my schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">


<xs:element name="map" type="Map"/>

<xs:complexType name="Map">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="processor"
type="TProcessor"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="activity"
type="TActivity"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="subprocess"
type="TSubProcess"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="MainEgde"
type="TEdge"/>
</xs:sequence>
</xs:complexType>


<xs:element name="specification">
<xs:complexType>
<xs:sequence>
<xs:element name="metadata">
<xs:complexType>
<xs:all>
<xs:element name="creator" type="xs:string" />
<xs:element name="description"
type="xs:string" />
<xs:element name="version" type="xs:string" />
</xs:all>
</xs:complexType>
</xs:element>
<!-- un file puo' descrivere un solo processo (main=true) piu' i
suoi sotto processi -->
<xs:element name="process" type="TProcess"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>

<xs:complexType name="TProcess">
<xs:sequence>
<!-- l'elemento nodes puo' non essere presente nel caso in cui
il processo e' gia' stato dichiarato (es. processo ricorsivo) -->
<xs:element name="nodes" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:choice minOccurs="2" maxOccurs="unbounded">
<xs:element name = "processor" type =
"TProcessor"/>
<xs:element name = "activity" type =
"TActivity"/>
<xs:element name = "subprocess" type = "TSubProcess"/>
</xs:choice>
</xs:complexType>
</xs:element>
<!--al piu' puo' uscire un edge da un sottoprocesso-->
<xs:element name="edge" type="TEdge" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="id" type="xs:ID"/>
<!-- vale true solo nel caso del processo principale, per i
sottoprocessi puo' essere omesso -->
<xs:attribute name="main" type="xs:boolean"/>
</xs:complexType>

<xs:complexType name="TProcessor">
<xs:sequence>
<xs:element name="edge" type="TEdge" minOccurs="0"
maxOccurs="unbounded" />
<xs:element name="exceptionEdge" type="TEdge" minOccurs="0"
maxOccurs="1"/>
<xs:element name="cancellationArea"
type="TCancellationArea" minOccurs="0" />
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="TProcessorType" />
<!-- la proces logic descrive il comportamento del processo -->
<xs:attribute name="processLogic" type="xs:string" />
<xs:attribute name="id" type="xs:ID"/>
<!-- indica la threshold (l'attributo e' presente solo se si
tratta di un JoinWT) -->
<xs:attribute name="th" type="xs:integer"/>
<!-- l'attributo e' presente solo se di tratta di un And -->
<xs:attribute name="sourceAndEdgeId" type="xs:IDREF"/>
<xs:attribute name="supportedEvents" type="TEventType"/>

</xs:complexType>

<xs:complexType name="TEdge">
<xs:attribute name="destinationId" type="xs:IDREF"/>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="min" type="xs:integer" />
<xs:attribute name="max" type="xs:integer" />
</xs:complexType>

<xs:complexType name="TCancellationArea">
<xs:sequence>
<xs:element name="node" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="nodeId" type="xs:IDREF"/>
</xs:complexType>
</xs:element>
<xs:element name="edge" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:IDREF"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<!-- depth=0 vengono rimossi tutti i token appartenenti ad una certa
istanza
di processo -->
<xs:attribute name="depth" type="xs:integer"/>
</xs:complexType>

<xs:simpleType name="TProcessorType">
<xs:restriction base="xs:string">
<xs:enumeration value="Start"/>
<xs:enumeration value="Simple"/>
<xs:enumeration value="Par"/>
<xs:enumeration value="Join"/>
<xs:enumeration value="JoinWT"/>
<xs:enumeration value="And"/>
<xs:enumeration value="JoinPar"/>
<xs:enumeration value="JoinWTPar"/>
<xs:enumeration value="AndPar"/>
<xs:enumeration value="SimplePar"/>
<xs:enumeration value="JoinSimplePar"/>
<xs:enumeration value="JoinWTSimplePar"/>
<xs:enumeration value="AndSimplePar"/>
<xs:enumeration value="And"/>
<xs:enumeration value="Incoming"/>
<xs:enumeration value="End"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="TActivity">
<xs:sequence>
<xs:element name="edge" type="TEdge" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="exceptionEdge" type="TEdge" minOccurs="0"
maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="classname" type="xs:string"/>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="maxInstances" type="xs:integer"/>
<xs:attribute name="timeout" type="xs:long"/>
</xs:complexType>

<xs:complexType name="TSubProcess">
<xs:sequence>
<xs:element name="edge" type="TEdge" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="id" type="xs:ID"/>
<!--si usa per fare riferimento ad un sottoprocesso gia' definito da
quache altra parte-->
<xs:attribute name="idRef" type="xs:IDREF"/>
<xs:attribute name="maxInstances" type="xs:integer"/>
<xs:attribute name="supportedEvents" type="TEventType"/>
</xs:complexType>

<xs:simpleType name="TEventType">
<xs:restriction base="xs:string">
<xs:enumeration value="Transient"/>
<xs:enumeration value="Permanent"/>
<xs:enumeration value="TransientPermanent"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>





regards,

Mattia
Previous Topic:How to get default size of a node
Next Topic:About BorderItemSelectionEditPolicy
Goto Forum:
  


Current Time: Thu Apr 25 15:07:17 GMT 2024

Powered by FUDForum. Page generated in 0.02771 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top