Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Activity diagram: manipulation with Eclipse(Activity diagram: manipulation with Eclipse)
Activity diagram: manipulation with Eclipse [message #819411] Mon, 12 March 2012 22:16 Go to next message
mariem haoues is currently offline mariem haouesFriend
Messages: 2
Registered: March 2012
Junior Member
Hello,
Can I handle UML diagrams with Eclipse?
I credit my UML activity diagram, and I noticed that Eclipse has converted it to xml.I tried to manipulate the xml code with a java class. For that I install JDOM API that allows me to manipulate XML data. Until now all is well. Is my approach correct, and is there another way to manipulate the UML diagram?
Any comments will be very interesting for me because this is the first time I use Eclipse.
Thank you.
Re: Activity diagram: manipulation with Eclipse [message #820088 is a reply to message #819411] Tue, 13 March 2012 18:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

No. Your approach is completely wrong.

All models are XML files, or rather XMI files.

The Eclipse Modeling Prpject is all about tools that process these
models effectively.

A couple that you could play with are:
select your file and Open With->Sample Ecore Model Editor
select your file and Open With->UML Model Editor

Papyrus can edit your diagrams. Tx tools can change them.

Regards

Ed Willink



On 12/03/2012 22:16, mariem haoues wrote:
> Hello,
> Can I handle UML diagrams with Eclipse? I credit my UML activity
> diagram, and I noticed that Eclipse has converted it to xml.I tried to
> manipulate the xml code with a java class. For that I install JDOM API
> that allows me to manipulate XML data. Until now all is well. Is my
> approach correct, and is there another way to manipulate the UML
> diagram? Any comments will be very interesting for me because this is
> the first time I use Eclipse.
> Thank you.
Re: Activity diagram: manipulation with Eclipse [message #831888 is a reply to message #820088] Thu, 29 March 2012 13:41 Go to previous messageGo to next message
mariem haoues is currently offline mariem haouesFriend
Messages: 2
Registered: March 2012
Junior Member
Hello,
First of all, thank you for your replay.
I create my activity diagram using Papyrus.
And then I select it and open it with UML Model Editor.
But i don't understand what i can do with it.
I can explain more my problem: i want to manipulate my diagram programmatically , means par example to know how many Action has the diagram.
Hope I could explain my problem properly.
Thank you.
Best Wishes.

Re: Activity diagram: manipulation with Eclipse [message #831973 is a reply to message #831888] Thu, 29 March 2012 15:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You could for instance write a Model transformation that at some point
perhaps

Action.allInstances()->size()

You could invoke the above in the OCL Console.

You could load your UML model as a Resource and write Java or Xtend code
to process it.

Regards

Ed Willink

On 29/03/2012 09:41, mariem haoues wrote:
> Hello, First of all, thank you for your replay. I create my activity
> diagram using Papyrus. And then I select it and open it with UML Model
> Editor.
> But i don't understand what i can do with it. I can explain more my
> problem: i want to manipulate my diagram programmatically , means par
> example to know how many Action has the diagram. Hope I could explain
> my problem properly.
> Thank you.
> Best Wishes.
>
Re: Activity diagram: manipulation with Eclipse [message #881830 is a reply to message #831973] Tue, 05 June 2012 10:27 Go to previous messageGo to next message
Alfredo Motta is currently offline Alfredo MottaFriend
Messages: 41
Registered: June 2012
Member
Hello Ed,

I am interested in solving the same problem.

Edward Willink wrote on Thu, 29 March 2012 11:35
Hi
You could load your UML model as a Resource and write Java or Xtend code
to process it.


To what documentation I should refer to achieve this task?

Edward Willink wrote on Thu, 29 March 2012 11:35
Hi
You could for instance write a Model transformation that at some point
perhaps


What is the difference between the previous approach (load the UML as a resource and working in Java) and a model transformation approach? (like the ones provided by xtext, epsilon, acceleo?)

Thank you for your help
Best,
Alfredo
Re: Activity diagram: manipulation with Eclipse [message #881840 is a reply to message #881830] Tue, 05 June 2012 10:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The UML2 project priovides documentation.
There are many Java books and tutorials.
The Xtend project provides documentation.

A model transformation differs because
a) your models are loaded and saved for you
b) the programming language is optimised for models and so is more
compact and better checked.

Xtext does many good things but model transformation is normally model
to something, so Xtext's text to model is not usually regarded as model
transformation.

Regards

Ed Willink

On 05/06/2012 11:27, Alfredo Motta wrote:
> Hello Ed,
>
> I am interested in solving the same problem.
>
> Edward Willink wrote on Thu, 29 March 2012 11:35
>> Hi
>> You could load your UML model as a Resource and write Java or Xtend
>> code to process it.
>
>
> To what documentation I should refer to achieve this task?
>
> Edward Willink wrote on Thu, 29 March 2012 11:35
>> Hi
>> You could for instance write a Model transformation that at some
>> point perhaps
>
>
> What is the difference between the previous approach (load the UML as
> a resource and working in Java) and a model transformation approach?
> (like the ones provided by xtext, epsilon, acceleo?)
>
> Thank you for your help
> Best,
> Alfredo
>
Re: Activity diagram: manipulation with Eclipse [message #882418 is a reply to message #881840] Wed, 06 June 2012 12:39 Go to previous messageGo to next message
Alfredo Motta is currently offline Alfredo MottaFriend
Messages: 41
Registered: June 2012
Member
Edward Willink wrote on Tue, 05 June 2012 06:44

>> You could load your UML model as a Resource and write Java or Xtend
>> code to process it.

The UML2 project priovides documentation.
There are many Java books and tutorials.
The Xtend project provides documentation.


Thank you.
Right now I have only found one example in the FAQs of the UML2 wiki to load a uml resource in a stand alone application (sorry the forum is stopping me to post the link)

and a section in this book
EMF: Eclipse Modeling Framework, 2nd Edition

if you have other pointers (more code examples?) this is really helpful for me.
Most of the other tutorials that I have found are about code generation which is not
my focus.

Edward Willink wrote on Tue, 05 June 2012 06:44

A model transformation differs because
a) your models are loaded and saved for you
b) the programming language is optimised for models and so is more
compact and better checked.

Xtext does many good things but model transformation is normally model
to something, so Xtext's text to model is not usually regarded as model
transformation.


Now is clear, thank you
Re: Activity diagram: manipulation with Eclipse [message #882426 is a reply to message #882418] Wed, 06 June 2012 12:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

Have you looked at the Getting started in the built-in UML documentation.

Regards

Ed Willink


On 06/06/2012 13:39, Alfredo Motta wrote:
> Edward Willink wrote on Tue, 05 June 2012 06:44
>> >> You could load your UML model as a Resource and write Java or
>> Xtend >> code to process it.
>>
>> The UML2 project priovides documentation.
>> There are many Java books and tutorials.
>> The Xtend project provides documentation.
>
>
> Thank you. Right now I have only found one example in the FAQs of the
> UML2 wiki to load a uml resource in a stand alone application (sorry
> the forum is stopping me to post the link)
>
> and a section in this book EMF: Eclipse Modeling Framework, 2nd Edition
>
> if you have other pointers (more code examples?) this is really
> helpful for me. Most of the other tutorials that I have found are
> about code generation which is not
> my focus.
>
> Edward Willink wrote on Tue, 05 June 2012 06:44
>> A model transformation differs because
>> a) your models are loaded and saved for you
>> b) the programming language is optimised for models and so is more
>> compact and better checked.
>>
>> Xtext does many good things but model transformation is normally
>> model to something, so Xtext's text to model is not usually regarded
>> as model transformation.
>
>
> Now is clear, thank you
Re: Activity diagram: manipulation with Eclipse [message #882441 is a reply to message #882426] Wed, 06 June 2012 13:19 Go to previous message
Alfredo Motta is currently offline Alfredo MottaFriend
Messages: 41
Registered: June 2012
Member
Edward Willink wrote on Wed, 06 June 2012 08:51
HI
Have you looked at the Getting started in the built-in UML documentation.


Found. However to my understanding in the Getting Started it only covers the generation of class diagrams using Java. There are examples with other diagrams? I am interested in state diagrams, activity diagrams and sequence diagrams. I did not found them in the built-in help

Thank you again for your quick replies and help
Previous Topic:Papyrus and manipulation
Next Topic:NoSuchMethodError while trying to get Resource
Goto Forum:
  


Current Time: Fri Apr 19 12:39:13 GMT 2024

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

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

Back to the top