Aniket
Aniket

Reputation: 57

Spring boot integration with JBPM 7.23.0

I am new to the jBPM. I want to use the jBPM 7.23.0 with the Spring boot. As per my understanding there are two ways to integrate it.

  1. JBPM as a service
  2. jBPM project embedded in Spring boot application

I am trying to understand how to embed jBPM 7.23.0 with Spring boot.

  1. Do I need to create and build the jBPM project separately using either Business Central or Eclipse plugin and use the kjar in spring boot application ? or
  2. Can I use the jBPM project files (like .BPNM , .drl etc files) directly in spring boot application and build the spring boot application directly?

I am reading the jBPM documentation from https://www.jbpm.org/

I also got few sample project links as well from document. I tried to install and run the sample project but its not helping to clear the integration concept.

Upvotes: 5

Views: 8190

Answers (2)

zhrist
zhrist

Reputation: 1558

As I understand, you need confirmation for the first 3 questions and answer to the fourth one.

It seems the options are right for the first 3, and beside first 2 I would say you have more flexibility and options than just those 2.

Can I use the jBPM project files (like .BPNM , .drl etc files) directly in spring boot application and build the spring boot application directly?

You can do this in this ways: Your spring boot application have the kie-server.jar library. You then start a Deployment service, if you need the bpmn/drl files to be in a deployment or you can directly start a Runtime manager and a KieBase to which you then addResuorce bpmn and drl and then build. This will make those definitions ready to start and instance and execute.

I hope this is clear enough, or you can ask for further clarification

Upvotes: 0

K.Nicholas
K.Nicholas

Reputation: 11551

I am working on a tutoral on this at Integrated jBPM and on github at business-application. It works with the jBPM starter applications from jBPM - Build your business application expanded to demonstrate more complete examples.

  • original-business-application-kjar: A kjar project. The kjar project holds the process flows, business rules, optimization and other information needed to implement and run in the jBPM runtime engine. The default starter kjar only has a default configuration files.

  • original-business-application-model: A simple java project to be used as an external data model for business processes. The default contains an empty POJO at com.company.model.Model.

  • original-business-application-service: The default springboot jBPM service.

The default server state is defined in business-application-service.xml in the project's root directory. This configuration file defines a deployed and running container with the same GAV value as the business-application-kjar. he will build as is out of the box and installs with GAV of com.company:business-application-kjar:1.0-SNAPSHOT. The pom.xml that comes out of the box will cause issues with eclipse m2e. You can add entry to fix the warnings from m2e.

If you run the server it will initially fail with a java runtime exception java.lang.RuntimeException: Cannot find KieModule: com.company:business-application-kjar:1.0-SNAPSHOT. To fix this you must install the kjar into the local maven repository with mvn install from the kjar project.

Once the springboot jBPM service is started it is running on localhost port 8090. The jBPM REST endpoint can be found at http://localhost:8090/rest/server and is access restricted. The Authorization is configured in the DefaultWebSecurityConfig.java class of the project.

Upvotes: 3

Related Questions