It is known that process flows created in Pega do not conform to any open standard, even though they appear somewhat like BPMN samples. People who want to switch begin their migration from Pega to Camunda by manually redrawing processes in the Modeler. However, manually redrawing process flows is tedious and time-consuming, especially if there are many or if the processes needing conversion are complex. In this lesson, we will explore a utility that can help you generate a BPMN-compliant process, which will serve as a starting point for the transition from Pega to Camunda.
Pega XML to BPMN Converter Tutorial
Camunda Consulting has created a set of freely available tools for migrating technological flows. Tools for migrating Pega technological flows can be found . You will immediately notice that this is a Maven project, which can be opened in virtually any integrated development environment. Eclipse and Intellij are two of the most popular IDEs. But first, you will need to clone or download the migration tools repository — this can be done .
For this guide, we will use Eclipse as our IDE.
- After cloning or downloading the Git repository, copy the contents of the Pega converter tools repository to a fresh workspace. For example, if your Git repository is located at C:gitRepos, you will find the Pega converter at C:gitReposmigrate-to-camunda-toolsPegacreate BPMN from Pega XML.
- Copy the entire folder to your chosen workspace.
- Then launch Eclipse and select the workspace where you just copied the contents. Once Eclipse is up, go to File > Import > General > Projects from Folder or Archive.
- Click the button Next.
- In the dialog that appears, click on Directory and navigate to the folder you just copied to your workspace. Your screen should look something like this (see below).
- Click Finish.

The project will be imported into your workspace. You may want to reconcile any differences in the Java compiler between the provided code and your environment, but it should work as is.
Next, we will create a Run configuration that will allow you to launch the converter in Eclipse:
- Right-click on the root folder of the project and select Run As > Run Configurations…
- In the dialog that appears, click on Java Application to create a new configuration. The project name should already be filled in this dialogue. If desired, you can give this configuration a new name.
- Next, you need to select the main class. Click the Search button and be sure to choose — BPMNGenFromPega — org.camunda.bpmn.generator. Select it and click OK.
- Your screen should look something like this:

Now you need to provide two arguments, the first is the XML export from Pega, and the second is the name of the converted file. Just in case, enter the paths and filenames in the Program arguments tab Arguments, enclosed in quotes. To start, you will be provided with an example Pega xml file. To use this example, enter the following data for the input and output files:
”.\/src\/main\/resources\/SamplePegaProcess.xml” “.\/src\/main\/resources\/ConvertedProcessFromPega.bpmn”
Your screen should look something like this:

Click on Run. A console window should open where you will see the following:
Diagram .\/src\/main\/resources\/SamplePegaProcess.xml converted from Pega and can be found at .\/src\/main\/resources\/ConvertedProcessFrom Pega.bpmn
The resources folder contains a PNG file (samplePegaProcessDiagram.png) of the original process in Pega and should look like this:

Using Camunda Modeler, open ConvertedProcessFromPega.bpmn and it should look something like this:

Creating a jar file
If you simply want to create a utility jar file, you have several options:
- Either right-click on the file pom.xml and select Run As > Maven install.
- Or right-click on the root folder and select Show in Local Terminal and run the following Maven command: mvn clean package install.
In any case (or using the method you prefer), you should get a jar file in the folder /target. Copy this jar anywhere and issue the following command in the terminal:
java -jar yourGeneratedJarFile.jar “your input file” “your output file”
That's it! Please feel free to leave feedback on our and for additional converters as they become available.
Source: habr.com
