Skip to Content

Code corrections for the BPMN 2.0 article

In my technical article about the BPMN 2.0 Metamodel Implementation for Eclipse there was a little mistake in the sample code (section “Code on it” on page 11).

Reason is that we planned to rename everything containing “Bpmn2” in the name to “Bpmn”. As this didn’t happen, the source code looks a little different. Here is the correct version, also containing the required import statements:


package org.eclipse.bpmn.sample;


import org.eclipse.bpmn2.Bpmn2Factory;
import org.eclipse.bpmn2.Definitions;
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.util.Bpmn2ResourceFactoryImpl;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;

public class Sample1 {

    public static void main(String[] args) throws IOException {
        Bpmn2Factory factory = Bpmn2Factory.eINSTANCE;

        Definitions definitions = new Bpmn2ResourceFactoryImpl().createAndInitResource(URI.createFileURI(“c:/temp/sample.bpmn2”));
        Process simpleProcess = factory.createProcess();

        ResourceSet resourceSet = new ResourceSetImpl();
        Resource resource = definitions.eResource();

You must be Logged on to comment or reply to a post.
    • Hi Guillermo,
      thanks for trying.
      Could you please first check if you can reach URL with a browser.
      If yes, please check the network/proxy settings of Eclipse. Go to Window->Preferences->General->Network Connections.
      E.g. in SAP inhouse network, we need “Active Provider” set to “Manual” and have proxy server and port defined for HTTP and HTTPS protocoll, but NOT for SOCKS.
      You might need other settings, depending on your network.


  • Hi,
    thanks for your great bpmn2 implementation.
    Now I am looking for a visual 2d editor to display the created bpmn2 files. I’ve already tried to build an editor with the gm framework, but it seems to be later an administrative overhead. Thus I am searching a third party component, which supports your bpmn2 files, currently I am testing a Signavio product, but there are several problems during the import.

    Any suggestions?