(Quick Reference)

6 Deployment Guide - Reference Documentation

Authors: Martin Schimak

Version: 0.5.0

6 Deployment Guide

Before deploying your application to a servlet container, you should make up your mind about a few things.

6.1 Consider your deployment scenario

Does your application work with an 'embedded' or a 'shared' process engine?

Do you either want to use the engine just behind the scenes of your own custom grails application with your own forms, controllers, services etc? Then go for the embedded engine. Or do you want to use the camunda BPM platform 'tasklist' with embedded forms and implement a grails based process application for it? Then go for the shared engine. In that case you will still want to use an embedded engine for testing your application.

Now, configure your deployment scenario accordingly! Then move on with deploying your application according to your scenario.

6.2 Scenario 'shared' process engine

(1) Download a camunda BPM Tomcat distribution. Make sure that the version of your camunda BPM container matches the version you use in your grails application. If necessary change the camunda BPM version used by the grails application.

(2) Make sure you declared the shared engine for those grails environments with which you prepare your container deployment war, e.g. 'production':

environments {
    production {
        camunda.deployment.scenario = "shared"
    }
}

(3) camunda BPM comes bundled with a dependency to the 'org.codehaus.groovy:groovy-all' library, which causes failure when deploying groovy/grails based applications bundled with their own version of that library. Therefore the plugin prevents the bundling of the 'org.codehaus.groovy:groovy-all' library bundled with grails and instead assumes that this library is already provided by the container. When preparing the camunda BPM container for a production environment, you should check that the 'org.codehaus.groovy:groovy-all' library version bundled in the container matches the version you need for your grails application and eventually replace it with the version you need.

You might want to check how to configure and finetune the dependencies provided by a camunda BPM container for a shared engine in greater detail.

Finally, build your 'war' file ...

grails war

...and deploy it to your camunda BPM containers 'webapp' folder. Open http://localhost:8080/camunda-welcome and browse to camunda cockpit or tasklist application.

6.3 Scenario 'embedded' process engine

Download and start a vanilla servlet container, e.g. Tomcat. Furthermore, you will need to add some explicit configuration, as the plugin doesn't interfere with default camunda configuration values for production environments. To get started with a basic configuration for your embedded engine 'production' environment, this might look like

environments {
    production {
        camunda {
            deployment.scenario = 'embedded'
            engine {
                configuration {
                    databaseSchemaUpdate = true
                    deploymentResources = ['classpath:/**/*.bpmn']
                    jobExecutorActivate = true
                }
            }
        }
    }
}

Finally, build your 'war' file ...

grails war

...and deploy it to your servlet container, e.g. by placing it into tomcats 'webapp' folder.

Optionally, you might want to download camunda BPM standalone webapp, deploy it alongside your grails' webapp and point it to the database of your embedded engine. You can then use camunda BPM cockpit to monitor and manage your processes. You can also use tasklist and work with 'generated' and/or 'external' forms, 'embedded' forms however will just work in the 'shared' process engine scenario.