Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XMI Graphical Manipulation(<xmi:XMI> file edition - Graphical tool needed.)
XMI Graphical Manipulation [message #1770734] Wed, 16 August 2017 15:32 Go to next message
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 90
Registered: March 2015
Member
Hi folks,

I have two files (attached) which compose usual RoyalAndLoyalSchool case.
One is the metamodel, the other one an instance (valid).

I would like to edit that XMI instance (to make it conforms with OCL constraints) with a graphical tool AND save it in the same XMI style.

What tool would you recommand ?
I would like to visualize references between objects to follow OCL paths easily.

For now I'm using Notepad++ (so graphical :s) and a home made helper (textual, but very usefull).

Thanks,
Edouard

[Updated on: Wed, 16 August 2017 20:47]

Report message to a moderator

Re: XMI Graphical Manipulation [message #1770739 is a reply to message #1770734] Wed, 16 August 2017 15:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5845
Registered: July 2009
Senior Member
Hi

Sirius is able to provide a custom graphical editor for an Ecore metamodel. Once you're familiar with Sirius, a basic editor may only take an hour or two, so it's worth experiencing a bit of learning pain.

Within Sirius EValidator should work so OCL constraints should be checkable.

Sirius will show the instance paths, if that's what you want. If you really want the OCL instance paths or OCL class paths you will have to work harder. Not necessarily a good idea since graphics has traditionally failed for arbitrary expressions. However if your OCL is mostly patterns you could re-use / replicate the OCL to pattern approach of the QVTd transformation from textual QVTm to graphical QVTs. See http://www.eclipse.org/mmt/qvt/docs/ICMT2017/MicromappingMoC.pdf for some pictures.

Regards

Ed Willink
Re: XMI Graphical Manipulation [message #1770744 is a reply to message #1770739] Wed, 16 August 2017 16:40 Go to previous messageGo to next message
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 90
Registered: March 2015
Member
Hi Ed ! Thanks for your answer.
That is precisely what I meant : does Sirius production is worth learning ?! I'll try it.

It would be an idea to show the OCL path of firing rules on the graphical model, I have all information at hand. But I don't think I'll have time to do it.
If I may, on the matter, what do you mean by "[...] graphics has traditionally failed for arbitrary expressions." ?
The article looks interesting, I'll have a deeper look into it later. Litterature is always appreciated, thanks.
Re: XMI Graphical Manipulation [message #1770758 is a reply to message #1770744] Wed, 16 August 2017 20:22 Go to previous messageGo to next message
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 90
Registered: March 2015
Member
Ok. I'm gona get a be deeper.

My XMI (.xmi), if you take time to open it, is written as following:
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:RandL="http://de.tuhh.sts.octopus/octopus2emfatic/2006/RandL">
  <RandL:ProgramPartner name="" numberOfCustomers="72" deliveredServices="/5 /2" programs="/4"/>
  <RandL:Membership currentLevel="/7" card="/8" account="/9" programs="/4" participants="/6/@ref_RandL_Customer.0"/>
  <RandL:Service serviceNr="91" description="FDZa" pointsEarned="82" condition="true" pointsBurned="84" partner="/0" transactions="/3" level="/7"/>
  <RandL:Burning amount="0.15246516276275457" points="6" account="/9" generatedBy="/2" card="/8">
    <date year="65" month="48" day="50"/>
  </RandL:Burning>
  <RandL:LoyaltyProgram name="" partners="/0" levels="/7" participants="/6/@ref_RandL_Customer.3 /6/@ref_RandL_Customer.0 /6/@ref_RandL_Customer.1 /6/@ref_RandL_Customer.2 /6/@ref_RandL_Customer.4" memberships="/1"/>
  <RandL:Service serviceNr="67" description="" pointsEarned="47" condition="true" pointsBurned="10" partner="/0" level="/7"/>
  <RandL:Container_RandL>
    <ref_RandL_Customer gender="female" isMale="false" name="YiMK" title="m" age="11" programs="/4" memberships="/1">
      <dateOfBirth year="9" month="63" day="16"/>
    </ref_RandL_Customer>
    <ref_RandL_Customer gender="female" isMale="true" name="VAB2" title="FjO" age="25" programs="/4" memberships="/1"/>
    <ref_RandL_Customer gender="female" isMale="true" name="H" title="dGh" age="83" programs="/4" memberships="/1"/>
    <ref_RandL_Customer isMale="false" name="E1k" title="S" age="55" programs="/4" memberships="/1"/>
    <ref_RandL_Customer isMale="false" name="Y" title="iojK" age="24" programs="/4" cards="/8" memberships="/1"/>
  </RandL:Container_RandL>
  <RandL:ServiceLevel name="hz" program="/4" availableServices="/5 /2" Membership="/1"/>
  <RandL:CustomerCard valid="true" color="gold" owner="/6/@ref_RandL_Customer.4" Membership="/1" transactions="/3"/>
  <RandL:LoyaltyAccount points="13" number="41" Membership="/1" transactions="/3"/>
</xmi:XMI>


Sirius (the Eclipse run of RoyalAndLoyal Ecore modelling) generates (.randl) files in the form :
<?xml version="1.0" encoding="UTF-8"?>
<RandL:Container_RandL xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:RandL="http://de.tuhh.sts.octopus/octopus2emfatic/2006/RandL">
  <ref_RandL_Customer/>
  <ref_RandL_Customer/>
  <ref_RandL_CustomerCard/>
  <ref_RandL_LoyaltyProgram/>
  <ref_RandL_TransactionReport/>
  <ref_RandL_Burning/>
</RandL:Container_RandL>


There is a small difference. ANd Sirius does not like it.

I'll ask the same question again, with some emphasis:
I would like to edit that XMI instance (to make it conforms with OCL constraints) with a graphical tool AND save it in the same XMI style. I have many files in the same format I have to edit.
What tool would you recommand ?

Note that I open the instance programmatically afterward, via EMF jars (org.eclipse.emf.ecore and org.eclipse.emf.common - both v2.11) and they don't mind the xmi:XMI style.

[edit: I found that this is related : https://www.eclipse.org/forums/index.php/t/1077730/ ]

[Updated on: Wed, 16 August 2017 20:50]

Report message to a moderator

Re: XMI Graphical Manipulation [message #1770770 is a reply to message #1770758] Thu, 17 August 2017 03:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29331
Registered: July 2009
Senior Member
The first serialization you show is for a resource with multiple root objects. The second is for a resource with a single root object. EMF's generated editor is not helpful with regard to creating additional root objects (nor is the reflective editor), though it's happy to display them if they already exist in the resource. Probably most editors aren't helpful with regard to creating additional root objects (because any EObject is allowed, so an instance of any non-abstract EClass is permitted, though generally that's no so sensible to propose automatically). But editors can be specialized to support creating additional root objects from your more restricted domain. More typically models are designed with a focus on a single root "container", which you already appear to have, i.e., Container_RandL.
Re: XMI Graphical Manipulation [message #1771072 is a reply to message #1770770] Mon, 21 August 2017 16:51 Go to previous message
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 90
Registered: March 2015
Member
That is a well definition of the problem.
But specializing Sirius looks -very- complicated..

On the other hand, transforming multi root models into a single root is not easy either : All references must be adapted and I don't see an automated way to do that.
I will see with my boss what he'd reckon.

Thanks again for your insight.
Edouard


Previous Topic:[RESOLVED] Get platform package instead of registered package
Next Topic:Reference ecore model from another ecore model
Goto Forum:
  


Current Time: Fri Apr 27 08:42:11 GMT 2018

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

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