Bug 535355 - Fails when extracting the output model of a bpmn transformation
Summary: Fails when extracting the output model of a bpmn transformation
Status: UNCONFIRMED
Alias: None
Product: MMT.ATL
Classification: Modeling
Component: emfvm (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: mmt-atl.toolkit-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-30 20:03 EDT by Gonzalo López CLA
Modified: 2018-05-30 20:03 EDT (History)
0 users

See Also:


Attachments
IN model (2.06 KB, application/octet-stream)
2018-05-30 20:03 EDT, Gonzalo López CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gonzalo López CLA 2018-05-30 20:03:57 EDT
Created attachment 274270 [details]
IN model

I'm trying to do a simple transformation of a bpmn model.
The transformation seems to be working correctly but it fails when extracting the newly created model.

Here are some links of posts I made on forums, related to this issue:
ATL forum: https://www.eclipse.org/forums/index.php/t/1093430/
BPMN 2.0 Modeler forum: https://www.eclipse.org/forums/index.php/t/1093432/

I attach the IN model (created as a Generic BPMN 2.0 Diagram with the ecliplse bpmn2 modeler).

I cant attach 2 files so the transformation is written here:

-- @nsURI bpmn=http://www.omg.org/spec/BPMN/20100524/MODEL

module transformation;
create OUT : bpmn from IN : bpmn;

rule copyStartEvent {
	from
		startEvent: bpmn!StartEvent 
	to
		seOut: bpmn!StartEvent (
			name <- startEvent.name,
			outgoing <- startEvent.outgoing,
			id <- startEvent.id
			
		)do {
		startEvent.debug('startEvent > '); 
	}
}


rule copySequenceFlow {
	from
		sequenceFlow: bpmn!SequenceFlow 
	to
		sfOut: bpmn!SequenceFlow (
			name <- sequenceFlow.name,
			sourceRef <- sequenceFlow.sourceRef,
			targetRef <- sequenceFlow.targetRef,
			id <- sequenceFlow.id
			
		)do {
		sequenceFlow.debug('sequenceFlow > '); 
	}
}

rule copyEndEvent {
	from
		endEvent: bpmn!EndEvent 
	to
		eeOut: bpmn!EndEvent (
			name <- endEvent.name,
			incoming <- endEvent.incoming,
			eventDefinitions <- endEvent.eventDefinitions,
			dataInputs <- endEvent.dataInputs,
			dataInputAssociation <- endEvent.dataInputAssociation,
			inputSet <- endEvent.inputSet,
			id <- endEvent.id
			
		)do {
		endEvent.debug('end event > '); 
	}
}

rule copyProcess {
	from
		process: bpmn!Process
	to
		prOut: bpmn!Process (
			id <- process.id,
			name <- process.name,
			flowElements <- process.flowElements
		)do {
		process.debug('process > '); 
	}
}

rule copyDefinitions {
	from
		definition: bpmn!Definitions
	to
		defiOut: bpmn!Definitions (
			name <- definition.name,
			exporter <- definition.exporter,
			exporterVersion <- definition.exporterVersion,
			expressionLanguage <- definition.expressionLanguage,
			targetNamespace <- definition.targetNamespace,
			typeLanguage <- definition.typeLanguage,
			id <- definition.id,
			rootElements <- definition.rootElements
		)do {
		definition.debug('definition > '); 
	}
}



This 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)