Bug 531840 - [SysML 1.4] Where is SysMLResourcesUtil.init
Summary: [SysML 1.4] Where is SysMLResourcesUtil.init
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: SysML (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Benoit Maggi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-01 04:15 EST by Ed Willink CLA
Modified: 2018-03-26 11:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2018-03-01 04:15:36 EST
Use of UML in a standalone environment used to be a nightmare. Then UMLResourcesUtil.init changed the situation and it became comparatively easy.

SysML users, particularly those using other tools such as Acceleo are encountering a very similar nightmare.

There should be a SysMLResourcesUtil.init emulating Eclipse UML2, or possibly a SysMLStandaloneSetup.doSetup emulating Xtext that makes initialization trivial.
Comment 1 Ed Willink CLA 2018-03-22 09:13:17 EDT
Irritated by yet another user falling foul of this, I thought I'd take a shot at it, but as usual as a casual SysML user I'm defeated when I try to install SysML.

There is no SysML in the SimRel repo and Papyrus doesn't install it.

Googling gives http://download.eclipse.org/modeling/mdt/papyrus/components/sysml14/ but that refuses to install with my Photon version of Papyrus...

Please ensure that SysML is easily installable from SimRel. If SysML is not bundled within Papyrus, I expect to find it by typing SysML as the filter text for an uncategorised listing of http://download.eclipse.org/releases/photon which is where I find Papyrus.

(I give up on trying to develop a SysMLResourcesUtil.init.)
Comment 2 Benoit Maggi CLA 2018-03-26 09:05:51 EDT
Hi Ed,

SysML 1.4 was extracted from the Papyrus contribution to simrel
(the main reasons were to provide release outside the train and the many regular api breaks in Papyrus core)

You may install it from the Eclipse Market Place on Oxygen 3.3.0
(you may also install it on an oxygen package from update site but it won't install on photon due to api break)

I guess that, this discussion is coming from https://www.eclipse.org/forums/index.php/t/1091946/
With this github repo as example https://github.com/pipsoft/AcceleoIssueWithInvalids

Adding a SysMLResourcesUtil.init seems a good idea.

I tried to setup an example with acceleo using
https://wiki.eclipse.org/Acceleo/Maven#Maven_Tycho_build
 with a template using SysML 1.4, but I got this exception in the build

Caused by: java.lang.ExceptionInInitializerError
    at org.eclipse.papyrus.sysml14.modelelements.internal.impl.ModelelementsPackageImpl.init (ModelelementsPackageImpl.java:188)
    at org.eclipse.papyrus.sysml14.modelelements.ModelelementsPackage.<clinit> (ModelelementsPackage.java:69)
    at org.eclipse.papyrus.sysml14.portsandflows.internal.impl.PortsandflowsPackageImpl.init (PortsandflowsPackageImpl.java:218)
    at org.eclipse.papyrus.sysml14.portsandflows.PortsandflowsPackage.<clinit> (PortsandflowsPackage.java:72)
    at org.eclipse.papyrus.sysml14.deprecatedelements.internal.impl.DeprecatedelementsPackageImpl.init (DeprecatedelementsPackageImpl.java:138)
    at org.eclipse.papyrus.sysml14.deprecatedelements.DeprecatedelementsPackage.<clinit> (DeprecatedelementsPackage.java:69)
    at org.eclipse.papyrus.sysml14.constraintblocks.internal.impl.ConstraintblocksPackageImpl.init (ConstraintblocksPackageImpl.java:125)
    at org.eclipse.papyrus.sysml14.constraintblocks.ConstraintblocksPackage.<clinit> (ConstraintblocksPackage.java:69)
    at org.eclipse.papyrus.sysml14.blocks.internal.impl.BlocksPackageImpl.init (BlocksPackageImpl.java:232)
    at org.eclipse.papyrus.sysml14.blocks.BlocksPackage.<clinit> (BlocksPackage.java:69)
    at org.eclipse.papyrus.sysml14.allocations.internal.impl.AllocationsPackageImpl.init (AllocationsPackageImpl.java:132)
    at org.eclipse.papyrus.sysml14.allocations.AllocationsPackage.<clinit> (AllocationsPackage.java:70)
    at org.eclipse.papyrus.sysml14.activities.internal.impl.ActivitiesPackageImpl.init (ActivitiesPackageImpl.java:178)
    at org.eclipse.papyrus.sysml14.activities.ActivitiesPackage.<clinit> (ActivitiesPackage.java:67)
    at org.eclipse.papyrus.sysml14.impl.sysmlPackageImpl.init (sysmlPackageImpl.java:123)
    at org.eclipse.papyrus.sysml14.sysmlPackage.<clinit> (sysmlPackage.java:66)

So I guess there is something fishy in initialization, I will look into it.
Comment 3 Ed Willink CLA 2018-03-26 11:31:54 EDT
(I needed the Photon version)

The exceptions look familiar. If packages are initialized in the wrong order bad things can happen. GenModel tries to create inter package dependencies but these can loop. Even EMF can get itself in a mess all by itself, and so EMF has a very judiciously placed self initialization. SysMLResourcesUtil.init should carefully sequence from most primitive to most complex.

I was thinking about the UMLResourcesUtil.init/SysMLResourcesUtil.init analogy and decided it is dangerous. UML is fairly stable, the core is very stable, so the UML2 project has successfully created a family of load-converters from UML X to Y where Y > X but not vice-versa.

SysML appears to be much less stable and so pretending that there is only one SysML may be a mistake. I suggest being very explicit about each SysML distribution being independent (and able to co-exist) until at least two sub-versions after 2.0. 

There is therefore no need for SysMLResourcesUtil.init to have contentType magic for 1.3/1.4/2.0; let the user invoke ....sysml14/utilities/SysMLResourcesUtil.init.

Conversion between 1.3/1.4/2.0 can be performed by genuine M2M's even if the coding is pure Java.