Flowable Spring Boot Starters - flowable-spring-boot-starter-process-rest

In my application I am using the flowable-spring-boot-starter-process-rest (contains the dependencies for booting the Process Engine in Standalone mode and starts its REST API):

    ...

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-boot-starter-process-rest</artifactId>
      <version>${flowable.version}</version>
    </dependency>

And, I have noticed that it doesn’t auto deploy the resources contained in a BAR file placed in the /apps folder.

Do I need to preform some additional configuration or include an additional Spring Boot Starter?

If I use the flowable-spring-boot-starter-rest (contains the dependencies for booting all Flowable Engines (Process, CMMN, DMN, Form, Content and IDM) and their respective REST API):

    ...

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-boot-starter-rest</artifactId>
      <version>${flowable.version}</version>
    </dependency>

The resources contained in a BAR file placed in the /apps folder are successfully deployed.

Also see: Flowable Documentation - Auto-configuration classes and Flowable Starters not rendering correctly

1 Like

Hey @Robinyo,

When you use flowable-spring-boot-starter-process-rest then you only have the process engine available. Which means that auto deployment works only for resources in /processes. If you want to deploy bar files you need to add the flowable-spring-boot-starter-app(-rest) module as well.

Cheers,
Filip

Hey @filiphr

I just updated the pom:


    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-boot-starter-app</artifactId>
      <version>${flowable.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-boot-starter-process-rest</artifactId>
      <version>${flowable.version}</version>
    </dependency>

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-ldap</artifactId>
      <version>${flowable.version}</version>
    </dependency>

And, when I ‘mvn clean install spring-boot:repackage’ I receive the following error:

[INFO] Scanning for projects...
[INFO] 
[INFO] -------------< org.serendipity:serendipity-rest-api-core >--------------
[INFO] Building Serendipity REST API 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ serendipity-rest-api-core ---
[INFO] Deleting /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/target
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ serendipity-rest-api-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 70 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ serendipity-rest-api-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 65 source files to /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ serendipity-rest-api-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ serendipity-rest-api-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ serendipity-rest-api-core ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.serendipity.restapi.SerendipityRestApiApplicationTests

08:46:42.887 [main] DEBUG org.springframework.core.env.StandardEnvironment - Activating profiles [test]
08:46:42.890 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}
2020-08-09 08:46:43.270  INFO 18861 --- [           main] o.s.r.SerendipityRestApiApplicationTests : Starting SerendipityRestApiApplicationTests on Robs-MBP with PID 18861 (started by robferguson in /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server)
2020-08-09 08:46:43.272  INFO 18861 --- [           main] o.s.r.SerendipityRestApiApplicationTests : The following profiles are active: test
2020-08-09 08:46:44.123 ERROR 18861 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Error processing condition on org.flowable.spring.boot.ProcessEngineAutoConfiguration$ProcessEngineAppConfiguration.processEngineConfigurator

...

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.754 s <<< FAILURE! - in org.serendipity.restapi.SerendipityRestApiApplicationTests
[ERROR] contextLoads  Time elapsed: 0.002 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: java.lang.IllegalStateException: Error processing condition on org.flowable.spring.boot.ProcessEngineAutoConfiguration$ProcessEngineAppConfiguration.processEngineConfigurator
Caused by: java.lang.IllegalStateException: @ConditionalOnMissingBean did not specify a bean using type, name or annotation and the attempt to deduce the bean's type failed
Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for org.flowable.spring.boot.ProcessEngineAutoConfiguration$ProcessEngineAppConfiguration.processEngineConfigurator
Caused by: java.lang.ClassNotFoundException: org.flowable.engine.configurator.ProcessEngineConfigurator

Hey @Robinyo,

You also need to add

<dependency>
    <groupId>org.flowable</groupId>
    <artifactId>flowable-spring-configurator</artifactId>
</dependency>

Hey @filiphr

I did:

    <!-- Add Flowable dependencies -->

    <!-- https://flowable.com/open-source/docs/bpmn/ch05a-Spring-Boot/#flowable-starters -->
    <!-- https://flowable.com/open-source/docs/bpmn/ch05a-Spring-Boot/#flowable-auto-configuration-classes -->

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-boot-starter-app</artifactId>
      <version>${flowable.version}</version>
    </dependency>

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-configurator</artifactId>
      <version>${flowable.version}</version>
    </dependency>

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-spring-boot-starter-process-rest</artifactId>
      <version>${flowable.version}</version>
    </dependency>

    <dependency>
      <groupId>org.flowable</groupId>
      <artifactId>flowable-ldap</artifactId>
      <version>${flowable.version}</version>
    </dependency>

And, when I ‘mvn clean install spring-boot:repackage’ it builds successfully:

[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ serendipity-rest-api-core ---
[INFO] Building jar: /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/target/serendipity-rest-api-core-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.3.0.RELEASE:repackage (repackage) @ serendipity-rest-api-core ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.3.0.RELEASE:repackage (default) @ serendipity-rest-api-core ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ serendipity-rest-api-core ---
[INFO] Installing /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/target/serendipity-rest-api-core-0.0.1-SNAPSHOT.jar to /Users/robferguson/.m2/repository/org/serendipity/serendipity-rest-api-core/0.0.1-SNAPSHOT/serendipity-rest-api-core-0.0.1-SNAPSHOT.jar
[INFO] Installing /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/server/pom.xml to /Users/robferguson/.m2/repository/org/serendipity/serendipity-rest-api-core/0.0.1-SNAPSHOT/serendipity-rest-api-core-0.0.1-SNAPSHOT.pom
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.3.0.RELEASE:repackage (default-cli) @ serendipity-rest-api-core ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.962 s
[INFO] Finished at: 2020-08-10T17:18:41+10:00
[INFO] ------------------------------------------------------------------------

However, the BAR file includes process definitions and forms and only the processes are being deployed:

2020-08-10 07:22:30.682  INFO 1 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService
2020-08-10 07:22:30.715  INFO 1 --- [           main] o.f.a.engine.impl.deployer.AppDeployer   : Processing app resource hr-app.app
2020-08-10 07:22:30.904  INFO 1 --- [           main] o.f.e.c.impl.deployer.BpmnDeployer       : BpmnDeployer: processing resource leave-application-process.bpmn
2020-08-10 07:22:32.742  INFO 1 --- [           main] o.f.j.s.i.a.AbstractAsyncExecutor        : Starting up the async job executor [org.flowable.spring.job.service.SpringAsyncExecutor].

And:

wars $ java -jar flowable-task.war
2020-08-10 17:24:12.304  INFO 21548 --- [           main] o.f.u.t.a.FlowableTaskApplication        : Starting FlowableTaskApplication v6.5.0 on Robs-MBP with PID 21548 (/Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/flowable/flowable-6.5.0/wars/flowable-task.war started by robferguson in /Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/flowable/flowable-6.5.0/wars)
2020-08-10 17:24:12.315  INFO 21548 --- [           main] o.f.u.t.a.FlowableTaskApplication        : No active profile set, falling back to default profiles: default
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (jar:file:/Users/robferguson/workspace/Robinyo/serendipity-api/projects/spring-boot/flowable/flowable-6.5.0/wars/flowable-task.war!/WEB-INF/lib/groovy-2.5.8.jar!/) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-08-10 17:24:15.834  INFO 21548 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

...

2020-08-10 17:25:42.042  INFO 21548 --- [nio-9999-exec-5] o.f.a.e.i.d.AppDeployer                  : Processing app resource hr-app.app
2020-08-10 17:26:02.275 ERROR 21548 --- [nio-9999-exec-3] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/flowable-task] threw exception [Request processing failed; nested exception is org.flowable.common.engine.api.FlowableObjectNotFoundException: No form definition found for key 'leave-application-form' for parent deployment id 4071d951-dada-11ea-baaf-0242c0a81007] with root cause

org.flowable.common.engine.api.FlowableObjectNotFoundException: No form definition found for key 'leave-application-form' for parent deployment id 4071d951-dada-11ea-baaf-0242c0a81007

Don’t we need to enable the FormDeployer?

Hey @Robinyo,

Yes the form engine should also be configured.

You’ll need to add

<dependency>
    <groupId>org.flowable</groupId>
    <artifactId>flowable-form-spring-configurator</artifactId>
</dependency>

Have a look at the flowable-spring-boot-starter pom.xml to see what is all added to it.

Hey @filiphr

Thanks :slight_smile: