Deployment of Process and Java class


I am looking for a way to deploy BPMN process definition along with relevant Java classes (javaDelegate). How it may be done via REST API and/or Cockpit?

Thank you

Java classes cannot be deployed through the Rest API.
You cannot deploy BPMN through the Cockpit.

Could deploy Groovy files and call the groovy files as external resource scripts?

Groovy is not good right now for us. So, what is the right way to make Process deployment? Could you point me, please, to the relevant page?

The best way is to create a project in Eclipse (or whatever IDE you like) using either the maven archetypes or manually - using this guide.

Once you’ve done that you can use maven to package your project in a WAR and deploy it to the container that is running camunda.

1 Like

We are looking for dynamic solution - ability to upload Process definition in runtime without need for repackage and redeployment.

If you do an initial deployment with everything you need packaged you can then update/re-deploy just the changed BPMN model itself. Assuming no additional classes or artifacts are needed for the changed model deployment will work fairly dynamically.

Right, but I do need to make an additional deployments, including Java classes. What is the way to do it?

Once you have Camunda running within an application server, in my context I use JBoss/WildFly, new projects and/or updates will trigger Camunda to update its repository.

For example:

  1. Startup your application server hosting Camunda. This is the complete platform downloaded from Camunda (though you can also build this yourself).
    example on Linux: ./bin/ <<< from the WildFly directory

1a) Add an “admin” user for Wildfly/JBoss.
example: ./bin/ <<< it will ask a series of questions (let me know if you have any questions with this: for development… i keep it very simple)

  1. Add and configure JBoss Tools (eclipse plugin) within Eclipse. I use Eclipse neon. Make sure you match the ports to your running server.

  2. Add the server to the Eclipse “servers” view. Make sure you set to “Server lifecycle is externally managed” - this helps speed server resets and deployments up. For development, I may “halt” the server and I don’t want to wait for Eclipse - I go directly to the server and send a “kill” signal if it’s not responding (note: I use a Linux and Win7 combination)

  3. From the eclipse “servers” view, “add” your Camunda project and deploy. If anything changes in your camunda project, you can set the eclipse “server” adapter to automatically publish if anything changes in your eclipse project. This is an excellent feature! It helps me keep an eye on potential model issues.

NOTE: This approach also works with Tomcat. But, once you become familiar with Java’s CDI… you’ll get hooked on Camunda’s “camunda-archetype-ejb-war” archetype.

It is good practice when you do the develoment. However, we plan to run Camunda as a microservice and don’t want to make redeploy after each change or new Process.

Referring to Docker containers? Or, were you thinking about something like WildFly Swarm? Or, the new AWS Lambda - I don’t think Camunda can run within AWS Lambda since it’s (Lambda) is more geared towards discrete services.

In my opinion (others will differ here), the docker container is simply like a very small virtual machine. Same practice applies.

If you’re using something like Wildfly Swarm… it should also be able to follow the same approach. But, there’s a little more setup in that you need to configure the microservice with necessary features to accept and ingest model and code updates. I’ve only tested hot-deployment capabilities on a few microservice platforms… so, I’d need more details per your platform specifics.

It is running inside Kubernetis platform. However, the idea to redploy it on each change seems not really practical.

As long as your Kubernetis platform is setup to host your application container… in some form - it should work. Recommend some extra testing and verification here. Kubernetets illustrates the management of docker images. However, your docker-hosted Camunda images would need to somehow coordinate their participation (such as sharing the same DB - or, a more federated architectural approach).

Check the admin/deployment ports on your running service (i.e. using ncat to check/verify connections). If you find the server listening on one of these ports then “hot” deployments may work.

Given “microservices”, you’d also need to insure your long-running processes remain preserved until completion. So, if you push a complete deployment that includes a fresh Database (database maintains process instances), you’ll need to add an extra step for migrations.

May I recommend that you use microservices for your process-supporting services. In-other-words, or at least for your early phases in roll-out, deploy the bulk of your BPM task implementations services as microservices. These microservices then aren’t required to maintain the sort of long-running state as a full Camunda process instance. Camunda then calls on these services, as needed, during process execution.

Camunda then runs as a bigger image hosting all the extra features necessary for maintaining continuity between process versions, type, and state.

@StephenOTT, Is it possible to use Python scripts in Service tasks? If yes, where Python executable should be defined?

Read the top paragraph of this page:

Can use jpython but will need to add it to the classpath.

1 Like

OK, it may help, thank you.

Is it possible to hot-deploy such scripts? For example, when I call deployment/create in REST api, may I add an additional part(s) with relevant scripts? Will they be deployed along with the Process?

Yes you can deploy scripts along side your BPMN files with the Rest API as part of the single deployment. Look at:

1 Like

Dear Team,
Need some info on clustering.
We have developed spring boot application, which enables camunda suite. We planning to deploy on AWS, whenever we will scale up(create another instance of an application). How cockpit(Camunda suite) will work for each instance or will be maintaining single instance for both the instance.

Thanks and Regards,
Shashikumar K S