Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Problem when saving a model
Problem when saving a model [message #1787492] Sat, 26 May 2018 15:49 Go to next message
Gonzalo López is currently offline Gonzalo LópezFriend
Messages: 14
Registered: February 2018
Junior Member
Hello,

I write here because I'm not sure where the problem is.

I have a problem when saving a bpmn model after an ATL transformation.

Here is the link to the question I asked on the other forum:
https://www.eclipse.org/forums/index.php/t/1093430/

As I mentioned there, I also tried using Bpmn2ResourceFactoryImpl, but in that case I had problems when working with some elements (example of problem below)

<bpmn2:itemDefinition id="ItemDefinition_1" isCollection="false" structureRef="xs:string"/>

The itemDefinition has a structureRef whose value is "xs:string", there were problems with the namespace reference.


Re: Problem when saving a model [message #1787496 is a reply to message #1787492] Sun, 27 May 2018 07:21 Go to previous messageGo to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 192
Registered: July 2009
Senior Member
Hi,
can you try to report a Bug in Bugzilla.
I am really not sure if this is a BPMN problem. It sounds more that it is a problem with the ALT transformation. So I suggest to report the problem here: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MMT.ATL

Can you post a stacktrace. This would help to see where the problem comes from.

===
Ralph
Re: Problem when saving a model [message #1787603 is a reply to message #1787496] Tue, 29 May 2018 22:04 Go to previous message
Gonzalo López is currently offline Gonzalo LópezFriend
Messages: 14
Registered: February 2018
Junior Member
Hi, thanks for your answer. I'll report it.

Here is the log:

java.lang.NullPointerException
at org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl$Bpmn2ModelerXMLSave.addNamespaceDeclarations(Bpmn2ModelerResourceImpl.java:1062)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:607)
at org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl$Bpmn2ModelerXMLSave.traverse(Bpmn2ModelerResourceImpl.java:1493)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:389)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl.save(Bpmn2ModelerResourceImpl.java:296)
at org.eclipse.m2m.atl.core.emf.EMFExtractor.extract(EMFExtractor.java:65)
at org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:141)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:237)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

For what I saw when debugging, the addNamespaceDeclarations method calls the ModelUtil.getDefinitions method. The getDefinitions method goes through this code:
if (object instanceof Resource) {
			Resource resource = (Resource) object;
			if (resource!=null && !resource.getContents().isEmpty() && !resource.getContents().get(0).eContents().isEmpty()) {
				// The assumption was that Definitions would always be the first entry in Resource.contents...not necessarily!
				for (EObject c : resource.getContents()) {
					for (Object o : c.eContents()) {
						if (o instanceof Definitions)
							return (Definitions) o;
					}
				}
			}
		}

And in the end it returns null because the condition in the third line of code is not met (I guess its because of what I posted in the ATL forum).


I have another question related to what I'm trying to solve, maybe you can help me.

Are there many differences between a bpmn2 model (created as a BPMN2 MODEL) and a bpmn model (created as a Generic BPMN 2.0 Diagram)?

With this problems I have, I started testing and I learned that:
- if I use a bpmn2 model the resource factory is org.eclipse.bpmn2.util.Bpmn2ResourceFactoryImpl
- if I use a bpmn model the resource factory is org.eclipse.bpmn2.modeler.examples.customtask.MyModel.util.MyModelResourceFactoryImpl

I also saw that the bpmn model has this namespace xmlns:ext="http://org.eclipse.bpmn2/ext" and ext:style elements.

As I said in my first post, I have problems with both resource factories, if the model has no more differences than the ext element I guess that making any of them work will be enough.


Thank you
Previous Topic:problem with displaying large diagram
Next Topic:Other problems when saving BPMN models
Goto Forum:
  


Current Time: Thu Apr 25 14:28:51 GMT 2024

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

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

Back to the top