Integrates Camunda BPM with the Grails framework.
Groovy CSS Batchfile JavaScript

Camunda Grails Plugin

This plugin integrates Camunda BPM (all versions) with the Grails 2 web application framework. Build Status

ℹ️ A Grails 3 version is currently under development.

Camunda BPM is a flexible framework for workflow and process automation. It's core is a native BPMN 2.0 process engine that runs inside the Java Virtual Machine. It is a perfect match for the Spring Framework - and therefore for Grails, too.

Camunda and grails logo

Currently the plugin comes bundled with a dependency to the release 7.3.0 of Camunda BPM. However you can use it with all other versions, too.

## Deploy your first Camunda Grails App in 3 minutes
1> grails create-app camunda-on-grails # and add a plugin dependency: compile ':camunda:0.5.0'
2> grails create-process my.own.camunda.GrailsProcess
3> grails war # and deploy it in the Camunda BPM tomcat container

Then open http://localhost:8080/camunda-on-grails-0.1/camunda, browse to Camunda tasklist and work with your own Camunda GrailsProcess. But if you are new to Camunda BPM and/or Grails, you might want to read the long story:

### 1. Create a fresh Grails App and install Camunda Grails Plugin

Download and install grails, then on your command line, type

grails create-app camunda-on-grails

In your camunda-on-grails/grails-app/conf/BuildConfig.groovy, add to the plugins section

plugins {
    compile ":camunda:0.5.0"

and back in your camunda-on-grails project folder execute

grails refresh-dependencies
### 2. Create a fresh Camunda BPM process definition

Still in your camunda-on-grails project folder, type

grails create-process my.own.camunda.GrailsProcess # or any other package and name of your choice

You should see the following two files generated by Grails:

| Created file grails-app/processes/my/own/camunda/GrailsProcess.bpmn
| Created file test/integration/org/my/own/camunda/GrailsProcess.groovy

It's a minimal process, to get you started and build upon (plus a small spec to check that it works). If you'd look at it with Camunda modeler, it would look like

Camunda BPM modeler

You will now already be able to use Camunda BPM as internal process engine for your grails application. Maybe you want to grails test-app and have a look at the spock specification executed by that command. However, if you want to see Camunda BPM tasklist in action, you will want to move on and ...

### 3. Download Camunda BPM and deploy your Grails WAR file

Download Camunda BPM Tomcat and expand it to a folder, let's call it $CAMUNDA_HOME.

⚠️ For the combination of Grails >= 2.5 and Camunda <= 7.3, you must replace the groovy-all-2.3.0.jar in Camunda BPM's tomcat lib folder with a current groovy-all-2.4.x.jar!

Start Camunda BPM Tomcat by executing:


Back in your camunda-on-grails project folder, excecute

grails war
cp target/camunda-on-grails-0.1.war $CAMUNDA_HOME/server/apache-tomcat-7.0.50/webapps

Now open http://localhost:8080/camunda-on-grails-0.1/camunda. But don't browse to the invoice sample, instead directly select the tasklist application, login with username demo password demo and start your GrailsProcess by clicking on that button in the top right corner:

Camunda BPM tasklist

The start form you will now see is delivered by your grails application:

Camunda BPM tasklist

Make a selection in the required dropdown field and actually start your process. Then move to the tasks assigned to you and find the Sample UserTask. Select the "Diagram" Pane and see the simple process you just created by issueing grails create-process:

Camunda BPM tasklist

The process execution is waiting at the user task, which wants to be completed via our grails form presented in the form pane.

Pretty cool, right? What's even cooler is that there is not much 'magic' happening behind the scenes. You just created a bpmn process definition (plus a corresponding 'spock' test specification) and use now a sample gsp form provided by the plugin. When reading the extensive Camunda Grails Plugin documentation, you will learn that the plugin sets very few sensible defaults for you to get started quickly, but everything remains under your full control.

Congratulations! You are now "in driver's seat" of a rapid process application development framework, for both 'data' as well as 'process': your 'Sample Service Task' calls a Grails Service and in your embedded Task Form you can leverage server side gsp as well as client side js rendering and present all the context domain data necessary for the user to complete the task at hand.

To obtain your driver's license for that racing car, you might now want to...

## Get in touch with Camunda BPM and Grails!

If you don't yet know either Camunda or grails - it's very much worth a look! Go straight to the extensive Camunda Grails Plugin Guide! But in particular check out to get started with Camunda BPM and to learn Grails in 5 easy steps.

## Resources

Want to contribute? Need help? You are very welcome! Please contact me directly via eMail.

## Maintainer

Martin Schimak - eMail - GitHub - Blog

## License

Apache License, Version 2.0 Build Status