Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Child references
Child references [message #479209] Mon, 10 August 2009 09:45 Go to next message
Swapnil  is currently offline Swapnil Friend
Messages: 19
Registered: July 2009
Junior Member
I have a model

Role <-- Contract --> Role

Over here Roles are of type node

& Contract is a link between two Roles.


Now if the link is of complex type 'Contract' in XML schema & 'Contract'
has it's own sub-elements of complex type. e.g.

<Contract>
<Term />
<Clauses />
</Contract>


Can this be represented using GMF? I mean can a link has child references
as nodes? If not how this can be modeled?



Cheers,

Swapnil
Re: Child references [message #479222 is a reply to message #479209] Mon, 10 August 2009 10:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Swapnil,

It's also best not to cross post the same question to multiple
newsgroups with separate posts.


Swapnil wrote:
> I have a model
>
> Role <-- Contract --> Role
>
> Over here Roles are of type node
>
> & Contract is a link between two Roles.
>
>
> Now if the link is of complex type 'Contract' in XML schema &
> 'Contract' has it's own sub-elements of complex type. e.g.
>
> <Contract>
> <Term />
> <Clauses />
> </Contract>
>
>
> Can this be represented using GMF? I mean can a link has child
> references as nodes? If not how this can be modeled?
>
>
>
> Cheers,
>
> Swapnil
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Child references [message #479452 is a reply to message #479209] Tue, 11 August 2009 07:32 Go to previous messageGo to next message
Tobias Lingemann is currently offline Tobias LingemannFriend
Messages: 11
Registered: July 2009
Junior Member
Hi,

I hope, I understand your problem correctly.

I think you only need to have a class for the contract in your meta-model.
So your ecore would look like this:

Role
> outgoingContracts : Contract (0 to * containment)
>> EOpposite would be source
> incommingContracts : Contract (0 to * reference)
>> EOpposite would be target

Contract
> source : Role (1 to 1 reference)
> target : Role (1 to 1 reference)
> terms : Term (0 to * containment)
> clauses : Clause (0 to * containment)

The rest should be set automatically.

Best regards,
Tobias


Swapnil wrote:

> I have a model

> Role <-- Contract --> Role

> Over here Roles are of type node

> & Contract is a link between two Roles.


> Now if the link is of complex type 'Contract' in XML schema & 'Contract'
> has it's own sub-elements of complex type. e.g.

> <Contract>
> <Term />
> <Clauses />
> </Contract>


> Can this be represented using GMF? I mean can a link has child references
> as nodes? If not how this can be modeled?



> Cheers,

> Swapnil
Re: Child references [message #479463 is a reply to message #479452] Tue, 11 August 2009 08:22 Go to previous messageGo to next message
Swapnil  is currently offline Swapnil Friend
Messages: 19
Registered: July 2009
Junior Member
Hi Tobias,

Thanks for the reply.

I tried that, but it gives errors when i generate the diagram editor code.

The method add(Contract) in the type List<Contract> is not applicable for
the arguments
(TermType) TermTypeCreateCommand.java /TEST.diagram/src/Smc11/diagram/edit/commands line
61 Java Problem

The method getTerm() is undefined for the type
SMCType Smc11DiagramUpdater.java /TEST.diagram/src/Smc11/diagram/part line
51 Java Problem


I think as i don't have Contract as a Top reference node its not allowing
Term's containment feature set as a Contract.

In my case Contract is of type link.


Please provide me some help on this.




Regards,

Swapnil
Re: Child references [message #479467 is a reply to message #479463] Tue, 11 August 2009 08:59 Go to previous messageGo to next message
Tobias Lingemann is currently offline Tobias LingemannFriend
Messages: 11
Registered: July 2009
Junior Member
Hi,

did you regenerate the *.genmodel and the model/edit-code?

I'm not so sure how you can dynamically add and delete elements to the
connection. I only used an enum-type initialized with the "Feature Seq
Initializer".
The enum in my case is no Top-Level-Node and changeable using the
properties tab (has to be set in the *.genmodel attributes to
'changeable').
If you have a more complex object that is attribut of you connection, you
might have to use diagram partitioning
(http://www.jevon.org/wiki/GMF_Diagram_Partitioning) or adopt the
properties tab.

Maybe you also can represent your attributes with a "Feature Label
Mapping" in the "Link Mapping".
Never the less, when I set the source- and target-features of my
Connections to changeable I get a list with all nodes, where I can change
the references.

I hope this helps.

Best regards,
Tobias
Re: Child references [message #480545 is a reply to message #479209] Mon, 17 August 2009 15:10 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Swapnil,

Technically domain model element associated with link can contain child elements,
so if you don'd need to show there child elements somehow on a diagram it
can be done.

-----------------
Alex Shatalin
Previous Topic:Traingle Figure
Next Topic:Obtain EditPart from View model od domain model element
Goto Forum:
  


Current Time: Wed Sep 25 06:08:41 GMT 2024

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

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

Back to the top