It’s well known that process flows created in Pega don’t conform to any open standard, despite looking rather BPMN-like. Folks who are looking to jump start their migration from Pega to Camunda are stuck having to manually redraw processes in Modeler. But manually redrawing process flows is tedious and time consuming, especially if there are many or complex processes to convert. In this tutorial we’ll step you through a utility that can help you generate a BPMN compliant process that can serve as a starting point for your Pega to Camunda conversion.
Pega XML to BPMN converter tutorial
The Camunda Consulting team has created a set of freely available tools for migrating process flows. The tools for migrating Pega process flows can be found here. You’ll quickly notice it is a Maven project which can be opened in just about any integrated development environment. Eclipse and Intellij are two of the more popular IDEs. But first you’ll need to clone or download the migration tools repository - you can do that here.
For this tutorial we’ll use Eclipse as our IDE.
- Once you’ve cloned or downloaded the Git repository, copy the contents of the Pega converter tool repository into a fresh workspace. If, for example, your Git repository is at C:\gitRepos then you’ll find the Pega converter at C:\gitRepos\migrate-to-camunda-tools\Pega\create BPMN from Pega XML
- Copy the entire folder to the workspace of your choice.
- Next, start Eclipse and select the workspace you just copied the contents into. Once Eclipse has started, navigate to File > Import > General > Projects from Folder or Archive.
- Click on Next.
- In the dialog box that appears click on Directory and navigate to the folder you just copied into your workspace. Your screen should look something like this (see below)
- Click on Finish.
The project will be imported into your workspace. You may want to update any Java compiler differences between the provided code and your environment, but it should work as is.
Next we’ll create a Run configuration to allow you to run the converter in Eclipse:
- Right click on the root project folder and select Run As > Run Configurations…
- In the dialog box that appears click on Java Application to create a new configuration. The project name should already be filled out in the dialog box. You can give this configuration a new name if you want.
- Next, you’ll need to select a main class. Click on the Search button and be sure to select - BPMNGenFromPega - org.camunda.bpmn.generator. Select it and click on OK.
- Your screen should look something like this:
Now you’ll need to provide two arguments, the first one being the XML export from Pega and the second being the name of the converted file. Enter the path and file names in the Program arguments section of the Arguments tab enclosed by quotation marks, just in case. There is a provided sample Pega xml file to get you started. To use this sample enter the following for the input and output files:
Your screen should look something like this:
Click on Run. A console window should open and you should see the following in the console:
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 it will look like this:
Using Camunda Modeler, open ConvertedProcessFromPega.bpmn and it should look something like this:
Creating a jar file
If you’d like to simply create a jar file of the utility, you have some options:
- Either right click on the pom.xml file and select Run As > Maven install.
- Or right click on the root folder and select Show in Local Terminal and issue the following Maven command: mvn clean package install.
In either case (or using your own preferred method) you should get a jar file in your /target folder. Copy that jar wherever you’d like and issue the following command in a terminal:
java -jar yourGeneratedJarFile.jar “your input file” “your output file”