Deploying Flowable as a Spring Boot application

Hi,

As of now I am deploying the war files(version used is 6.3.0) in the tomcat and using Flowable engine as a service and accessing flowable engine using REST APIs.

As we have decided to deploy the engine as Spring boot application.Is there an deployment instructions to do this. Please let us know how to configure the database and deploy the engine as a Spring boot application.

Regards,
Aradhya

Have your reviewed this? https://www.flowable.org/docs/userguide/index.html#springSpringBoot
Is there something additional that you need or find missing?

2 Likes

I was able to deploy Flowable as a Spring Boot application. Thank you for the help.

Only problem i faced is not able to get swagger ui even after using proper annotation(@EnableSwagger2) in my application.

Please let me know how to fix swagger.

This thread might help: Swagger with flowable-spring-boot-starter-rest-api

I am using below dependencies in my Spring boot and could not able to see REST APIs of flowable in Swagger but APIs are accessible through rest client.

<dependency>
  <groupId>org.flowable</groupId>
  <artifactId>flowable-spring-boot-starter</artifactId>
  <version>6.3.0</version>
</dependency>

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>
org.flowable flowable-rest 6.3.0 org.flowable flowable-spring-boot-starter-cmmn-rest 6.3.0
<dependency>
  <groupId>org.flowable</groupId>
  <artifactId>flowable-spring-boot-starter-dmn-rest</artifactId>
  <version>6.3.0</version>
</dependency>

<dependency>
  <groupId>org.flowable</groupId>
  <artifactId>flowable-form-rest</artifactId>
  <version>6.3.0</version>
  <exclusions>
    <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>org.flowable</groupId>
  <artifactId>flowable-content-rest</artifactId>
  <version>6.3.0</version>
  <exclusions>
    <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger2</artifactId>
  <version>2.6.1</version>
</dependency>

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger-ui</artifactId>
  <version>2.6.1</version>
</dependency>

<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>5.1.45</version>
</dependency>

is there any dependency i am missing.

I also have meet this problem.
I used flowable 6.3.1, and swagger 2.8.0

  1.  Gradle dependencies as following:
    

dependencies {
compile “org.flowable:flowable-spring-boot-starter-rest:6.3.1”
compile “com.h2database:h2:1.4.197”
compile “io.springfox:springfox-swagger2:2.8.0”
compile “io.springfox:springfox-swagger-ui:2.8.0”
}

  1.  SpringBootApplication as following:
    

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableSwagger2
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

@Bean
public Docket restfullApi() {
    Docket docket = new Docket(DocumentationType.SWAGGER_2);
    docket.apiInfo(new ApiInfoBuilder().title("flowable").version("6.3.1").build());
    docket.select().apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).build();
    return docket;
}

}

  1.  I add a RestController for test:
    

/**
*
*/
package com.example.demo.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**

  • @author Administrator

*/
@Api(tags = “Hello World”)
@RestController
public class MyRestController {
@ApiOperation(value = “hello world”)
@GetMapping(value = “/hello/world”)
public ResponseEntity startProcessInstance() {
return new ResponseEntity<>(“hello world”, HttpStatus.OK);
}
}

  1.  Add following config in application.properties:
    

flowable.process.servlet.loadOnStartup=1
flowable.app.servlet.loadOnStartup=1

====================================================
After startup the spring boot application, find the rest api in the log:


2018-06-08 17:12:52.509 INFO 23992 — [localhost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext

2018-06-08 17:12:53.342 INFO 23992 — [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped “{[/hello/world],methods=[GET]}” onto public org.springframework.http.ResponseEntity<java.lang.String> com.example.demo.controller.MyRestController.startProcessInstance()

2018-06-08 17:12:58.278 INFO 23992 — [main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2018-06-08 17:12:58.296 INFO 23992 — [main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2018-06-08 17:12:58.329 INFO 23992 — [main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2018-06-08 17:12:58.486 INFO 23992 — [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet ‘Flowable BPMN Rest API’
2018-06-08 17:12:58.486 INFO 23992 — [main] o.s.web.servlet.DispatcherServlet : FrameworkServlet ‘Flowable BPMN Rest API’: initialization started

2018-06-08 17:12:59.811 INFO 23992 — [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped “{[/query/historic-detail],methods=[POST],produces=[application/json]}” onto public org.flowable.common.rest.api.DataResponse<org.flowable.rest.service.api.history.HistoricDetailResponse> org.flowable.rest.service.api.history.HistoricDetailQueryResource.queryHistoricDetail(org.flowable.rest.service.api.history.HistoricDetailQueryRequest,java.util.Map<java.lang.String, java.lang.String>,javax.servlet.http.HttpServletRequest)
2018-06-08 17:12:59.813 INFO 23992 — [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped “{[/history/historic-process-instances/{processInstanceId}/comments/{commentId}],methods=[GET],produces=[application/json]}” onto public org.flowable.rest.service.api.engine.CommentResponse org.flowable.rest.service.api.history.HistoricProcessInstanceCommentResource.getComment(java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest)

2018-06-08 17:13:00.037 INFO 23992 — [main] o.s.web.servlet.DispatcherServlet : FrameworkServlet ‘Flowable BPMN Rest API’: initialization completed in 1551 ms
2018-06-08 17:13:00.038 INFO 23992 — [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet ‘Flowable App Rest API’
2018-06-08 17:13:00.038 INFO 23992 — [main] o.s.web.servlet.DispatcherServlet : FrameworkServlet ‘Flowable App Rest API’: initialization started
2018-06-08 17:13:00.038 INFO 23992 — [main] .s.AnnotationConfigWebApplicationContext : Refreshing WebApplicationContext for namespace ‘Flowable App Rest API-servlet’: startup date [Fri Jun 08 17:13:00 CST 2018]; parent: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2f6bbeb0
2018-06-08 17:13:00.039 INFO 23992 — [main] .s.AnnotationConfigWebApplicationContext : Registering annotated classes: [class org.flowable.spring.boot.app.AppEngineRestConfiguration]
2018-06-08 17:13:00.141 INFO 23992 — [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped “{[/app-repository/deployments/{deploymentId}/resources],methods=[GET],produces=[application/json]}” onto public java.util.List<org.flowable.app.rest.service.api.repository.AppDeploymentResourceResponse> org.flowable.app.rest.service.api.repository.AppDeploymentResourceCollectionResource.getDeploymentResources(java.lang.String,javax.servlet.http.HttpServletRequest)

2018-06-08 17:13:00.217 INFO 23992 — [main] o.s.web.servlet.DispatcherServlet : FrameworkServlet ‘Flowable App Rest API’: initialization completed in 179 ms
2018-06-08 17:13:00.219 INFO 23992 — [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘’
2018-06-08 17:13:00.221 INFO 23992 — [main] com.example.demo.Application : Started Application in 10.332 seconds (JVM running for 11.337)

but when I browse http://127.0.0.1:8080/swagger-ui.html, only display /hello/world api.
Flowable BPMN Rest API and Flowable App Rest API are not display.

The reason is /hello/world, Flowable BPMN Rest API and Flowable App Rest API are in different WebApplicationContext, and swagger configuration only scaned the ApiOperation which in a same WebApplicationContext whit DocumentationPluginsBootstrapper bean.

I want to know, how to config swagger to scan the WebApplicationContext of Flowable BPMN Rest API, Flowable App Rest API and so on which registerec in org.flowable.spring.boot.RestApiAutoConfiguration class by BaseRestApiConfiguration?

Hi,

Any solution for this issue ?

I seem to face the same problem.