When using Spring Process Engine Configuration throws "deployment 1 doesn't contain any rules" error

I’m trying to invoke Drools rules from Flowable Business Rule Task in spring boot application. When I use StandaloneInMemProcessEngineConfiguration Process Engine Configuration, everything is working fine. But when I’m using SpringProcessEngineConfiguration Process Engine Configuration, it throws “deployment 1 doesn’t contain any rules” error.

<?xml version="1.0" encoding="UTF-8"?>`
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
			http://www.springframework.org/schema/beans/spring-beans.xsd">
			
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
    <property name="driverClass" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/simpleFlowableDrools?sslMode=DISABLED" />
    <property name="username" value="root" />
    <property name="password" value="password" />
</bean>

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
</bean>

<bean id="processEngineConfiguration"
	class="org.flowable.spring.SpringProcessEngineConfiguration">
	<!-- class="org.flowable.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration"> --> 
	<property name="dataSource" ref="dataSource" />
	<property name="transactionManager" ref="transactionManager" />
	<property name="databaseSchemaUpdate" value="true" />
	<property name="asyncExecutorActivate" value="true" />
	<property name="customPostDeployers">
		<list>
			<bean class="org.flowable.engine.impl.rules.RulesDeployer" />
		</list>
	</property>
</bean>
processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml")
    	    		   .buildProcessEngine();
repositoryService = processEngine.getRepositoryService();`

   repositoryService.createDeployment().addClasspathResource("diagrams/BusinessRuleLoanProcess.bpmn").addClasspathResource("diagrams/LoanRequestRules.drl").enableDuplicateFiltering()
    				.name("businessRuleLoanProcessSimple").deploy();

This is how I’m deploying Process Workflow.

Below are the dependencies I have added for the project.

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
    <groupId>org.flowable</groupId>
    <artifactId>flowable-spring-boot-starter-basic</artifactId>
    <version>6.6.0</version>
 </dependency>
 <dependency>
		<groupId>mysql</groupId>
		<artifactId>mysql-connector-java</artifactId>
		<scope>runtime</scope>
		<version>8.0.13</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
		<version>1.7.2</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-jdk14</artifactId>
		<version>1.7.2</version>
	</dependency>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<optional>true</optional>
	</dependency>
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.11</version>
	</dependency>
            <dependency>
		<groupId>org.kie</groupId>
		<artifactId>kie-ci</artifactId>
		<version>7.15.0.Final</version>
	</dependency>
	<dependency>
		<groupId>org.drools</groupId>
		<artifactId>drools-compiler</artifactId>
		<version>7.15.0.Final</version>
	</dependency>
	<dependency>
		<groupId>org.drools</groupId>
		<artifactId>drools-core</artifactId>
		<version>7.15.0.Final</version>
	</dependency>
	<dependency>
		<groupId>org.mvel</groupId>
	    <artifactId>mvel2</artifactId>
	    <version>2.4.12.Final</version>
	</dependency>
  1. What am I missing when I’m using SpringProcessEngineConfiguration?
  2. Or is there a way to map spring beans into service task when using StandaloneInMemProcessEngineConfiguration? The whole reason I’m using SpringProcessEngineConfiguration is for creating beans of JavaDelegate class and mapping them as Delegate expression to a service task.

Thanks in advance.

Hi,

could you share this in a unit test?

Yvo