Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » How to use DiffMerge/Patterns
How to use DiffMerge/Patterns [message #1705555] Mon, 17 August 2015 13:22 Go to next message
Jia zh is currently offline Jia zhFriend
Messages: 10
Registered: June 2015
Junior Member
Hi,

I have installed Diff/Merge, Patterns and UML Designer. But when I created my patterns, the *.patterns file can not be created.

There are no errors. What should I do to make it work?

BTW, can Patterns be used independently? For example, after I install Diff/Merge and Patterns in Eclipse, can Patterns be used for any models in any projects?

Thanks in advance.
Re: How to use DiffMerge/Patterns [message #1706250 is a reply to message #1705555] Tue, 25 August 2015 10:12 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Hello,

Let me answer your second question first. At this time Patterns can only be used within environments that are based on the Sirius technology, such as Capella or UML Designer. In general, it is necessary to develop a customization/integration feature of the Pattern technology for a given modeling environment. This is why the Capella integration of Patterns is currently more mature than the UML Designer integration.

Now, to answer your first question: The Capella integration feature is included in Capella itself, while the UML Designer integration feature is available on the Git repository of the Pattern technology within the "umldesigner" folder (see http://git.eclipse.org/c/diffmerge/org.eclipse.emf.diffmerge.patterns.git/tree/umldesigner/). It is not included in the Pattern technology build since it is specific to UML Designer. I assume that your problem comes from the fact that you installed the Pattern technology build but not the UML Designer integration feature for the Pattern technology.

To solve the problem, you can clone the Pattern repository (https://git.eclipse.org/r/#/admin/projects/diffmerge/org.eclipse.emf.diffmerge.patterns) then export the UML Designer feature (in /umldesigner/features) to your UML Designer environment.

Olivier
Re: How to use DiffMerge/Patterns [message #1706294 is a reply to message #1706250] Tue, 25 August 2015 13:32 Go to previous messageGo to next message
Jia zh is currently offline Jia zhFriend
Messages: 10
Registered: June 2015
Junior Member
Hi Olivier,

Thanks for your answers, now Patterns works in UML Designer.
I have two new questions:

1. User viewpoint:
The Patterns tool has many functions like "create template" and "create pattern". I am not so clear about how to use them (sometimes when I chose a function in Pattern menu, nothing happened). Is there any UserManual or other documentation about Pattern? I want to know what functions that Patterns provides and how to use these functions.

2. Developer viewpoint:
I am a student who is working on an assignment about Ecore meta-model patterns with a company. This company has developed several DSLs and has found some reusable elements in their Ecore meta-models. But the developers do not have mechanisms to reuse their Ecore models. The Patterns tool is quite useful in this case. According to your explanation, if I want to apply Patterns to Ecore meta-models, I need to create an integration feature for a Sirius-based environments (like Ecore Tools) , right?


Thanks in advance.
Jia


Re: How to use DiffMerge/Patterns [message #1706387 is a reply to message #1706294] Wed, 26 August 2015 13:32 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Glad the problem got solved. Smile

About your questions :

1. User viewpoint
Good news, we are almost in sync: we have worked on a first draft of a complete documentation. It has been almost ready for some time, we just needed some request like yours to give this task a high priority. I have logged bug #475916 to track that. I tried to push the documentation today but I ran into technical problems (it is ALWAYS the case when you come back from vacation, as if networks were living beings). It will be done tomorrow if we are lucky.

2. Developer viewpoint
I assume your need is not just to share metaclasses, otherwise you could use classical dependencies between Ecore files. Beware that every instance of a pattern duplicates the elements of the pattern, so patterns support "sharing" of modeling principles, but not "sharing" of model elements. I would suggest you give a try to patterns in Capella class diagrams in order to be sure that it corresponds to your needs.
If that is the case then you are right: you have to develop a customization for Ecore Tools. The thing is, it is likely to be a tricky, technical work in that case, because elements in EMF metamodels (instances of EClass, EReference, etc.) do not have unique identifiers, unlike UML or Capella elements. A consequence is that the customization will need to provide a means to uniquely identify those elements (preferably, a means that supports renaming and moving operations...). If you think that is the thing to do, then I would suggest to start with the UML Designer customization and try to adapt it to Ecore Tools.
Re: How to use DiffMerge/Patterns [message #1706478 is a reply to message #1706387] Thu, 27 August 2015 08:46 Go to previous messageGo to next message
Jia zh is currently offline Jia zhFriend
Messages: 10
Registered: June 2015
Junior Member
Thanks for your reply.

I have shown how Patterns works in Capella to the company. The developers there thought the functions provided by Patterns tool are more or less what they want, especially the traceability between patterns and their instances. This is why I want to get the documentation of Patterns such that I can match the functions of Patterns with our needs and figure out whether Patterns tool is the one we really need.

If the documentation is really, please let me know where I can find it.

As for the unique identifiers of UML, do you refer to the qualified name of a Named Element? I am still a beginner of MDE, can you give me more information about identifiers of UML/Capella elements (e.g. website and documentation)?

Many thanks Smile
Re: How to use DiffMerge/Patterns [message #1706492 is a reply to message #1706478] Thu, 27 August 2015 10:37 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
The documentation is now available on the Patterns repository! As mentioned in [1], it is located in /doc in the form of an Eclipse help.
To browse it, you can perform as you did with the UML Designer customization. The documentation will become visible as a root entry named "Modeling Patterns" in the "Help Contents" of your modeling environment.

Note that it is more of a reference manual for now, maybe a tutorial for beginners would be useful too. Anyway, any suggestion for improving the doc is of course welcome!

There are two sorts of identifiers for model elements: "intrinsic" and "extrinsic".
- intrinsic IDs are defined in metamodels, they correspond to an attribute, usually named "id" and of type String, whose Ecore property "isID" is true. This is the best way of identifying elements if you need, e.g., version control for your models. Capella uses intrinsic IDs.
- extrinsic IDs are assigned by the persistence layer for models, e.g. XMI, CDO, etc. A consequence is that if you physically move a model, e.g., from XMI to CDO, these IDs will be lost. Eclipse UML / UML Designer models use XMI IDs when stored in local files.

You may have a look at the official EMF book by Ed Merks et al. for more detailed (and probably better written) information.

Hope it helped. Smile

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=475916
Re: How to use DiffMerge/Patterns [message #1706800 is a reply to message #1706492] Mon, 31 August 2015 09:07 Go to previous messageGo to next message
Jia zh is currently offline Jia zhFriend
Messages: 10
Registered: June 2015
Junior Member
Great! I have seen the documentations, but some punctuations can not be displayed in the webpages. (see my attachment of a screenshot)

Now I am going to look into the source code of Patterns tool. I have imported all plug-ins of Patterns, but I do not know where to start. Can you explain a bit the structure of these plug-ins and give me some suggestions about how to start working with the code?

Also there are many errors reported when I imported the plug-ins of Patterns, it seems like that some "import" Java packages can not be found. Does Patterns depend on other projects that I did not import to my workspace? Where to find these packages?

Thanks in advance.



Re: How to use DiffMerge/Patterns [message #1707042 is a reply to message #1706800] Tue, 01 September 2015 17:44 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
- Punctuation in doc: Nice catch! This punctuation problem doe not show up on my computer. I've just fixed it (Bug #476351), it should be OK now if you pull.

- Compiling errors: The OCL Tools, although optional at runtime, are required to compile the Patterns plugins. You have to install them in your target Eclipse platform. To do that, click the "Install Modeling Components" button below the Eclipse menus then select "OCL Tools".

- Start working: I suggest you start with the UML Designer customization (2 plugins in /umldesigner/plugins on the repo), rename it, replace the dependencies to UML Designer to dependencies to EcoreTools, then check the places where compilation fails. These places will need adaptation. Then you can test if you get something working or not. If not, you will need to figure out what difference between UML Designer and EcoreTools is responsible for the failure and adapt the customization accordingly.
Keep in mind that the Patterns tool is still young and that much will need to be improved. Smile Good luck!
Previous Topic:MatchService ConcurrentModificationException
Next Topic:How do I force the merge of all attributes in a UML file?
Goto Forum:
  


Current Time: Fri Apr 19 18:56:59 GMT 2024

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

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

Back to the top