Over a million developers have joined DZone.

Integrate Camunda BPMN With MySQL

DZone 's Guide to

Integrate Camunda BPMN With MySQL

In this quick post, we take a look at all the XML code and terminal commands you need to integrate these two interesting technologies.

· Integration Zone ·
Free Resource

Steps to Install and Setup Camunda on a Wildfly Server:

We'll be using Camunda version:7.8 and Wildfly server:10.1.0 in this tutorial.

  • Install Java and set environment variables.

  • Connect to your VM using putty and run the below commands.

#JDK installation ----------------------              

sudo apt-get install -y openjdk-8-jdk

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/

export PATH=$PATH:/usr/lib/jvm/java-8-openjdk-amd64/bin
  • Download camunda-bpm-wildfly10-7.8.0.zip/camunda-bpm-wildfly10-7.8.0.tar file.
  • Navigate to /opt/camunda/server/wildfly-10.1.0.Final/standalone/deployments and add the war file.
  • Run start-camunda.sh in/opt/camunda directory.
  • To run Camunda as a background process: ./start-camunda.sh 
  • By default, Camunda will use in-memory H2 DB for storing the process details.
  • Steps to Connect to MySQL DB:

    • Run the scripts present in below directory by selecting the files related to MySQL.
    • Once the tables are created, navigate to the /opt/camunda/server/wildfly-10.1.0.Final/standalone/configuration/standalone.xml file.
    • Add the Ccamunda subsystem as an extension:
    <server xmlns="urn:jboss:domain:1.1">
              <extension module="org.camunda.bpm.wildfly.camunda-wildfly-subsystem"/>
    • Create a data source to connect to MySQL under the data sources section
    <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
    <datasource jta="true" jndi-name="java:jboss/datasources/ProcessEngine" pool-name="ProcessEngine" enabled="true" use-java-context="true" use-ccm="true">
        <connection-url> jdbc:mysql://*hostname*/*dbname*</connection-url>
            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker" />
            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter" />
    • Under drivers add a MySQL driver.
    <driver name="mysql" module="com.sql.mysql">
  • Navigate to /opt/camunda/server/wildfly-10.1.0.Final/modules/com/mysql/driver/main and add mysql-connector-java-5.1.45-bin.jar and module.xml
  • In module.xml, add the below content.
  • <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.1" name="com.sql.mysql">
            <resource-root path="mysql-connector-java-5.1.45-bin.jar" />
            <module name="javax.api" />
            <module name="javax.transaction.api" />
    • Change the subsystem IP to point to the VM's internal IP.

    • And also change the management interface's IP to point to the internal IP.   

      <interface name="management">        
        <inet-address value="${jboss.bind.address.management:*IP*}" />    
      <interface name="public">     
        <inet-address value="${jboss.bind.address:*IP*}" />   
    camunda ,integration ,mysql ,xml

    Opinions expressed by DZone contributors are their own.

    {{ parent.title || parent.header.title}}

    {{ parent.tldr }}

    {{ parent.urlSource.name }}