Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BPMN Modeler » Adding a Pool using the BPMNVisual2ProcessGenerator
Adding a Pool using the BPMNVisual2ProcessGenerator [message #669536] Tue, 10 May 2011 15:51
richard.mrasek is currently offline richard.mrasekFriend
Messages: 2
Registered: May 2011
Junior Member

I try to load my .bpmn_diagram file and add a new Pool to it. My Program throws a java.lang.NullPointerException in BPMNProcessGenerator.addPool method. I think the problem is how I read the file.

thank you for Reading.

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.stp.bpmn.BpmnPackage;
import org.eclipse.stp.bpmn.diagram.generation.impl.BPMNVisual2ProcessGenerator;

public class TestingGenerator {
	private String Path = "src/bpmnDia.bpmn";
	public static void main(String[] args) {
		TestingGenerator tg = new TestingGenerator();
		Diagram graphicalModel = (Diagram) tg.load_BpmnDiagram(tg.Path+"_diagram");
		BPMNVisual2ProcessGenerator generator = new BPMNVisual2ProcessGenerator(graphicalModel);
	private EObject load_BpmnDiagram(String FilePath){
		File bpmnFile = new File(FilePath);
		ResourceSet rs = new ResourceSetImpl();
		rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn_diagram", new XMIResourceFactoryImpl());
		URI uri = URI.createFileURI(bpmnFile.getAbsolutePath());
		Resource resource = rs.getResource(uri, true);
		return resource.getContents().get(0);

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.stp.bpmn.diagram.generation.impl.BPMNProcessGenerator.addPool(
	at TestingGenerator.main(
Previous Topic:How to enable the Save button once a tabbed propertySections is modified
Next Topic:Run BPMN Modeler
Goto Forum:

Current Time: Sun Aug 09 01:10:07 GMT 2020

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

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

Back to the top