Giter Club home page Giter Club logo

pnmlframework's People

Contributors

abelgomez avatar codacy-badger avatar dependabot[bot] avatar lhillah avatar yanntm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pnmlframework's Issues

Instructions for building a redistributable Update Site

I searched through the repository, and I couldn't find any instructions to build PNML Framework as a redistributable Update Site.

Could you give me some insights on how to do it or add a small how-to to the Update Site module?

PNML file encoding

Hi

Does the framework support saving of a PNML file in a specific encoding? For example utf-8?

When I store a pnml file, all non-ascii characters are replaced by question marks.

Both hlpn and pthlpng plugins register a package for 'http:///hlpn.integers.ecore'

Both fr.lip6.pnml.framework.hlpn and fr.lip6.pnml.framework.pthlpng plugins register a package for http:///hlpn.integers.ecore.

This initially causes a warning from EMF, and later, if the EMF package registry is processed by other tools (such as the QVTo engine), causes a ClassCastException (java.lang.ClassCastException: fr.lip6.move.pnml.pthlpng.integers.impl.IntegersFactoryImpl cannot be cast to fr.lip6.move.pnml.hlpn.integers.IntegersFactory).

!SESSION 2016-06-27 17:12:55.285 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_ES
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data C:\Eclipse\eclipse-SDK-4.6-win32-x86_64-Papyrus\eclipse\workspace/../runtime-EclipseApplication -dev file:C:/Eclipse/eclipse-SDK-4.6-win32-x86_64-Papyrus/eclipse/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.emf.ecore 2 0 2016-06-27 17:13:00.667
!MESSAGE Both 'fr.lip6.pnml.framework.hlpn' and 'fr.lip6.pnml.framework.pthlpng' register a package for 'http:///hlpn.integers.ecore'

!ENTRY org.eclipse.egit.ui 2 0 2016-06-27 17:13:10.474
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\agomez'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.emf.ecore 2 0 2016-06-27 17:13:15.326
!MESSAGE fr.lip6.move.pnml.pthlpng.integers.impl.IntegersFactoryImpl cannot be cast to fr.lip6.move.pnml.hlpn.integers.IntegersFactory
!STACK 0
java.lang.ClassCastException: fr.lip6.move.pnml.pthlpng.integers.impl.IntegersFactoryImpl cannot be cast to fr.lip6.move.pnml.hlpn.integers.IntegersFactory
    at fr.lip6.move.pnml.hlpn.integers.impl.IntegersFactoryImpl.init(IntegersFactoryImpl.java:71)
    at fr.lip6.move.pnml.hlpn.integers.IntegersFactory.<clinit>(IntegersFactory.java:51)
    at fr.lip6.move.pnml.hlpn.integers.impl.IntegersPackageImpl.<init>(IntegersPackageImpl.java:212)
    at fr.lip6.move.pnml.hlpn.integers.impl.IntegersPackageImpl.init(IntegersPackageImpl.java:240)
    at fr.lip6.move.pnml.hlpn.integers.IntegersPackage.<clinit>(IntegersPackage.java:87)
    at fr.lip6.move.pnml.hlpn.finiteIntRanges.impl.FiniteIntRangesPackageImpl.init(FiniteIntRangesPackageImpl.java:201)
    at fr.lip6.move.pnml.hlpn.finiteIntRanges.FiniteIntRangesPackage.<clinit>(FiniteIntRangesPackage.java:87)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at fr.lip6.move.pnml.hlpn.finiteEnumerations.impl.FiniteEnumerationsPackageImpl.init(FiniteEnumerationsPackageImpl.java:152)
    at fr.lip6.move.pnml.hlpn.finiteEnumerations.FiniteEnumerationsPackage.<clinit>(FiniteEnumerationsPackage.java:87)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at fr.lip6.move.pnml.hlpn.dots.impl.DotsPackageImpl.init(DotsPackageImpl.java:147)
    at fr.lip6.move.pnml.hlpn.dots.DotsPackage.<clinit>(DotsPackage.java:85)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at fr.lip6.move.pnml.hlpn.cyclicEnumerations.impl.CyclicEnumerationsPackageImpl.init(CyclicEnumerationsPackageImpl.java:163)
    at fr.lip6.move.pnml.hlpn.cyclicEnumerations.CyclicEnumerationsPackage.<clinit>(CyclicEnumerationsPackage.java:87)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at fr.lip6.move.pnml.hlpn.booleans.impl.BooleansPackageImpl.init(BooleansPackageImpl.java:200)
    at fr.lip6.move.pnml.hlpn.booleans.BooleansPackage.<clinit>(BooleansPackage.java:86)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at fr.lip6.move.pnml.hlpn.arbitrarydeclarations.impl.ArbitrarydeclarationsPackageImpl.init(ArbitrarydeclarationsPackageImpl.java:157)
    at fr.lip6.move.pnml.hlpn.arbitrarydeclarations.ArbitrarydeclarationsPackage.<clinit>(ArbitrarydeclarationsPackage.java:87)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at fr.lip6.move.pnml.hlpn.hlcorestructure.impl.HlcorestructurePackageImpl.init(HlcorestructurePackageImpl.java:511)
    at fr.lip6.move.pnml.hlpn.hlcorestructure.HlcorestructurePackage.<clinit>(HlcorestructurePackage.java:87)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:275)
    at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
    at org.eclipse.m2m.internal.qvt.oml.blackbox.java.JavaModuleLoader.resolvePackages(JavaModuleLoader.java:156)
    at org.eclipse.m2m.internal.qvt.oml.blackbox.java.JavaModuleLoader.loadModule(JavaModuleLoader.java:88)
    at org.eclipse.m2m.internal.qvt.oml.blackbox.java.JavaBlackboxProvider.loadCompilationUnit(JavaBlackboxProvider.java:89)
    at org.eclipse.m2m.internal.qvt.oml.blackbox.BlackboxRegistry.loadCompilationUnit(BlackboxRegistry.java:68)
    at org.eclipse.m2m.internal.qvt.oml.compiler.BlackboxUnitResolver$BBoxUnitContents.loadElements(BlackboxUnitResolver.java:131)
    at org.eclipse.m2m.internal.qvt.oml.compiler.QVTOCompiler.loadBlackboxUnit(QVTOCompiler.java:563)
    at org.eclipse.m2m.internal.qvt.oml.compiler.QVTOCompiler.doCompile(QVTOCompiler.java:354)
    at org.eclipse.m2m.internal.qvt.oml.compiler.QVTOCompiler.doCompile(QVTOCompiler.java:410)
    at org.eclipse.m2m.internal.qvt.oml.compiler.QVTOCompiler.compileSingleFile(QVTOCompiler.java:318)
    at org.eclipse.m2m.internal.qvt.oml.compiler.QVTOCompiler.compile(QVTOCompiler.java:205)
    at org.eclipse.m2m.internal.qvt.oml.compiler.QVTOCompiler.compile(QVTOCompiler.java:218)
    at org.eclipse.m2m.internal.qvt.oml.editor.ui.QvtCompilerFacade.compile(QvtCompilerFacade.java:79)
    at org.eclipse.m2m.internal.qvt.oml.editor.ui.QvtReconcilingStrategy.getCompilationResult(QvtReconcilingStrategy.java:90)
    at org.eclipse.m2m.internal.qvt.oml.editor.ui.QvtReconcilingStrategy.reconcileInternal(QvtReconcilingStrategy.java:74)
    at org.eclipse.m2m.internal.qvt.oml.editor.ui.QvtReconcilingStrategy.initialReconcile(QvtReconcilingStrategy.java:62)
    at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:95)
    at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:174)


Wrong class name on PnmlExport.exportObject

On line 188 of PnmlExport, in the method void fr.lip6.move.pnml.framework.general.PnmlExport.exportObject(EObject object, String filepath) throws ... the following statement is used to get the "native class canonical name":

final String classname = object.getClass().getCanonicalName();

However, when this statement is executed on an instance of, for example fr.lip6.move.pnml.pnmlcoremodel.PetriNetDoc, it returns the implementation class (i.e. fr.lip6.move.pnml.pnmlcoremodel.impl.PetriNetDocImpl).

Thus, the next instruction (OfficialPNMLFileType.getByNativeClassName(classname)) fails, since it seems to expect the interface name (fr.lip6.move.pnml.pnmlcoremodel.PetriNetDoc) instead of the implementation name (fr.lip6.move.pnml.pnmlcoremodel.impl.PetriNetDocImpl).

The enumeration OfficialPNMLFileType stores the interface name as the native class name.

To get the right class name so that the instruction OfficialPNMLFileType.getByNativeClassName(classname) can find the official PNML type, the following instruction should be used instead:

final String classname = object.eClass().getInstanceClassName();

Errors with jar file

Hello,
I tried to use the tool to validate pnml files and I got the following error :

        at fr.lip6.move.pnml.validation.impl.CheckPnmlFileImpl.checkPnmlFile(CheckPnmlFileImpl.java:194)
        at fr.lip6.move.pnml.validation.ValidationMain.standalone(ValidationMain.java:268)
        at fr.lip6.move.pnml.validation.ValidationMain.parseArgs(ValidationMain.java:165)
        at fr.lip6.move.pnml.validation.ValidationMain.main(ValidationMain.java:130)
Caused by: java.lang.ClassNotFoundException: javax.activation.MimetypesFileTypeMap
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 4 more

I tried several jar file which are available here : http://pnml.lip6.fr/pnmlvalidation/download.html

Best,
Mathilde

Add versioning to published Update Sites

Eclipse bundles for PNML framework are usually published in http://pnml.lip6.fr/pnmlframework/updatesite/ as an Update Site.

However, only two update sites are available: "updatesite" and "updatesite-previous", whose contents may vary each time a new version is published.

Currently we have some tools that rely on PNML Framework (specifically 2.2.9), and the target platform specification expects to have PNML plugins published in an inmutable site. Could it be possible to give each version also a version-specific update site? Or at least, keep multiple versions (including the previous versions) in the same update?

Those update sites maybe published in the current external site, such as http://pnml.lip6.fr/pnmlframework/updatesite/2.2.9/, or better, using the gh-pages branch of this same GitHub repository (e.g.: http://lhillah.github.io/pnmlframework/updates/2.2.9/).

Some generated methods lack of proper @generated annotations

Some automatically generated methods lack of proper @generated annotations. Thus, in order to apply model changes existing java files must be deleted so that a full generation is done, and no in-place update is possible.

See an example of the issue in the template https://github.com/lip6/pnmlframework/blob/master/pnmlFw-Low_Level_API_Generation/templates-2.2.0/ToPNML/ToPNMLNIO.javajet which generates the toPNML(FileChannel fc) method in all domain classes.

For an example of generated code, see:

A properly generated toPNML(FileChannel fc) should look like:

	/**
	 * Return the string containing the pnml output
	 * @generated
	 */
	@Override
	public void toPNML(FileChannel fc) {
		//id 0
		//idref 0
		//attributes 0
		//sons 1

		final int bufferSizeKB = 8;
		final int bufferSize = bufferSizeKB * 1024;
		...
		...

This is only a small example. Inspect generation templates for other cases. On a quick look, I see other methods such as toPNML (without args), fromPNML, idRefHang, validateOCL, etc.

DOM based parser has scaling issues for large PT nets

because the PT parser is DOM based it is very greedy in both memory and time; a basic stack based approach can build a large PNML model in the fraction of the time the default DOM parser takes.

We should import the code from plugins :

https://github.com/lip6/ITSTools/tree/master/pnml/fr.lip6.move.gal.pnml.saxparse

and possibly (for tool specific) :

https://github.com/lip6/ITSTools/tree/master/pnml/fr.lip6.move.gal.nupn

of ITS-tools that provide fast and memory efficient solutions to this issue.

To regain parse of both HLPN and normal nets, the following exception wrapper can be used :
https://github.com/lip6/ITSTools/blob/master/pnml/fr.lip6.move.gal.pnml.togal/src/fr/lip6/move/gal/pnml/togal/PnmlToGalTransformer.java#L46-L73

The CI does not rebuild all generated files from source

travis-ci currently does not regenerate all the classes i.e. replay the EMFgen part.

This means we have generated files in the git codebase which should not be the case, as we don't align correctly to new releases of the code generator and it makes issues like #10 a problem when they should be straightforward.

So, we should use the proper EMFgen/JET plugins for tycho/mvn that do exist now in standard places and use them to have a richer mvn scenario that actually rebuilds from manually edited artifacts only, and discard from source versioning the (literally hundreds) of generated files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.