# Flowable 6.3.0 Spring Boot Auto Deployment

**URL:** <https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918>\
**Category:** Flowable Engine\
**Created:** [April 20, 2018, 5:42am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918 "2018-04-20T05:42:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lijinting01](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/lijinting01/32/658_2.png) [@lijinting01](https://forum.flowable.org/u/lijinting01)\
**Post date:** [April 20, 2018, 5:42am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918/1 "2018-04-20T05:42:19Z")

</div>

Hi everyone,

A problem was found after I upgraded flowable engine from 6.2.1 to 6.3.0.

In 6.2.1, the source code below prints a list of Deployments, while returns a empty list after the engine version upgraded.

```
@Bean
public InitializingBean initializingBean(RepositoryService repositoryService) {
  return () -> {
    List<Deployment> list = repositoryService.createDeploymentQuery().list();
    log.info("Deployment size: {}", list.size());
  };
}

```

The only change is in the pom.xml

Before upgrade:  
\<dependency\>  
\<groupId\>org.flowable\</groupId\>  
\<artifactId\>flowable-spring-boot-starter-basic\</artifactId\>  
\<version\>6.2.1\</version\>  
\</dependency\>

Logging:  
2018-04-20 13:26:08.055 INFO 10356 — [main] i.d.h.DemoApplication : Deployment size: 1

After Upgrade:  
\<dependency\>  
\<groupId\>org.flowable\</groupId\>  
\<artifactId\>flowable-spring-boot-starter-process\</artifactId\>  
\<version\>6.3.0\</version\>  
\</dependency\>

Logging:  
2018-04-20 13:32:23.914 INFO 9248 — [main] i.d.h.DemoApplication : Deployment size: 0

Sounds like a bug~ i guess.

Environment  
jdk-9.0.4  
Windows 7 with SP1

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [April 20, 2018, 5:47am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918/2 "2018-04-20T05:47:29Z")

</div>

That’s strange. We have tests for this exact case with Spring Boot. Can you share an example project so we can have a look at?

---

<div class="post-metadata">

**Author:** ![lijinting01](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/lijinting01/32/658_2.png) [@lijinting01](https://forum.flowable.org/u/lijinting01)\
**Post date:** [April 20, 2018, 6:16am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918/3 "2018-04-20T06:16:05Z")

</div>

Here is the sample project to indicate this issue.

The first commit is based on 6.2.1, which works fine.  
The second commit is based on 6.3.0, which has the problem I memtioned before.  
The third commit showcases that it works fine in unit testing.

`git clone https://gitee.com/lijinting01/flowable-issue.git`

[https://gitee.com/lijinting01/flowable-issue.git](https://gitee.com/lijinting01/flowable-issue.git)

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [April 20, 2018, 6:30am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918/4 "2018-04-20T06:30:11Z")

</div>

I know what the issue is. It’s not a bug.

Now the deployment is happening after the context is done initialising. After all beans are ready. This means at the time of your bean the context is not ready yet.

For your use case the best would be to use the Spring Boot `CommandLineRunner` as that one runs after the entire context is ready.

You need something like:

```auto
@Bean
public CommandLineRunner commandLineRunner(RepositoryService repositoryService) {
  return args -> {
    List<Deployment> list = repositoryService.createDeploymentQuery().list();
    log.info("Deployment size: {}", list.size());
  };
}

```

---

<div class="post-metadata">

**Author:** ![lijinting01](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/lijinting01/32/658_2.png) [@lijinting01](https://forum.flowable.org/u/lijinting01)\
**Post date:** [April 20, 2018, 6:39am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918/5 "2018-04-20T06:39:17Z")

</div>

Thanks, it works fine now. 🙂

Just for my curiosity, why it works fine in 6.2.1? Has the lifecycle changed 6.3.0?

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [April 20, 2018, 6:42am UTC](https://forum.flowable.org/t/flowable-6-3-0-spring-boot-auto-deployment/1918/6 "2018-04-20T06:42:16Z")

</div>

In 6.2.1 the deployment was happening during the creation of the `ProcessEngineConfiguration`. However, we added auto deployment for DMN, CMMN and Forms in the Spring Boot starters which showed us that the ordering was wrong, due to not everything being ready. Therefore we changed this to happen after the whole context is ready (when we can be sure that all engines have fully initialised)
