Getting error while executing Decision task inside a Process model Spring Boot Camel Flowable

I have a decision task that needs to be executed as part of a process. The Flowable process gets invoked from a Camel router. i.e. (Spring Boot)Camel Router -> Flowable Process Start -> Task 1(Java Delegate) -> Task 2 (decision task). If I do any other tasks, it executes without any issues.

I could find the root cause to be as below, throws below error in Spring Boot logs…

Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectLatestDecisionTableByKeyAndParentDeploymentId

Somehow to mapper is not being loaded it seems, org.flowable.dmn.engine.impl.persistence.entity.DecisionTableEntityImpl

Here is my configuration, am I missing anything ? Note, I am deploying the process as an app.

`

.to("flowable:My-Process)

@Autowired
protected PlatformTransactionManager transactionManager;

@Autowired
protected DataSource dataSource;

@Autowired
protected SpringProcessEngineConfiguration springProcessEngineConfiguration;	

@Autowired
protected SpringDmnEngineConfiguration springDmnEngineConfiguration;	

@Bean
public RepositoryService repositoryService() {
	return processEngine().getRepositoryService();
}

@Bean
public SpringDmnEngineConfiguration dmnEngineConfigure() {
	SpringDmnEngineConfiguration sdec = new SpringDmnEngineConfiguration();
	sdec.setDataSource(dataSource);
	sdec.setTransactionManager(transactionManager);
	sdec.setDatabaseSchemaUpdate("true");
	sdec.setDeploymentMode("single-resource");
	return sdec;
}

@Bean
public DmnEngineConfigurator dmnEngineConfigurator() {
	DmnEngineConfigurator dec = new DmnEngineConfigurator();
	dec.setDmnEngineConfiguration(dmnEngineConfigure());
	return dec;
}

@Bean
public DmnEngine getDmnEngine(SpringDmnEngineConfiguration sdec) {
	return sdec.buildDmnEngine();
}


@Bean(name = "processEngineFactoryBean")
public ProcessEngineFactoryBean processEngineFactoryBean() {
	ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
	List<EngineConfigurator> configurators = new ArrayList<EngineConfigurator>();
	configurators.add(dmnEngineConfigurator());
	springProcessEngineConfiguration.setConfigurators(configurators);
	factoryBean.setProcessEngineConfiguration(springProcessEngineConfiguration);
	return factoryBean;
}

@Bean(name = "processEngine")
public ProcessEngine processEngine() {
	try {
		return processEngineFactoryBean().getObject();
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}

`

Adding the dmnEngineConfigurator should be enough, this will add the mappings that now fail.

You’re mentioning you’re using Spring Boot, are you using the starters? Can you share your setup so we can try to reproduce?

	<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>1.5.9.RELEASE</version>
</parent>

<properties>
	<flowable.version>6.2.1</flowable.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
		<groupId>org.apache.camel</groupId>
		<artifactId>camel-spring-boot</artifactId>
		<version>2.15.0</version>
	</dependency>
	<dependency>
		<groupId>org.apache.camel</groupId>
		<artifactId>camel-rabbitmq</artifactId>
		<version>2.12.0</version>
		<exclusions>
			<exclusion>  <!-- declare the exclusion here -->
				<groupId>com.rabbitmq</groupId>
				<artifactId>amqp-client</artifactId>
			</exclusion>
		</exclusions>
		<!-- use the same version as your Camel core version -->
	</dependency>
	<dependency>
		<groupId>org.apache.camel</groupId>
		<artifactId>camel-core</artifactId>
		<version>2.15.0</version>
	</dependency>

	<dependency>
		<groupId>org.apache.camel</groupId>
		<artifactId>camel-stream</artifactId>
		<version>2.9.2</version>
	</dependency>

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

	<!-- https://mvnrepository.com/artifact/org.flowable/flowable-camel -->
	<dependency>
		<groupId>org.flowable</groupId>
		<artifactId>flowable-camel</artifactId>
		<version>${flowable.version}</version>
	</dependency>


	<dependency>
		<groupId>org.apache.httpcomponents</groupId>
		<artifactId>httpclient</artifactId>
		<version>4.5.4</version>
	</dependency>



	<dependency>
		<groupId>com.h2database</groupId>
		<artifactId>h2</artifactId>
	</dependency>

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

	<!-- https://mvnrepository.com/artifact/org.springframework.amqp/spring-amqp -->
	<dependency>
		<groupId>org.springframework.amqp</groupId>
		<artifactId>spring-amqp</artifactId>
		<version>2.0.1.RELEASE</version>
	</dependency>

	<dependency>
		<groupId>org.springframework.amqp</groupId>
		<artifactId>spring-rabbit</artifactId>
		<version>2.0.1.RELEASE</version>
	</dependency>

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

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

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

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

	<dependency>
		<groupId>org.mybatis</groupId>
		<artifactId>mybatis</artifactId>
		<version>3.4.5</version>
	</dependency>

	<dependency>
		<groupId>org.mybatis</groupId>
		<artifactId>mybatis-spring</artifactId>
		<version>1.3.1</version>
	</dependency>


</dependencies>

I solved it by loading DMN mappers through Custom mapper, but this is patch work. I will still wait for the ideal solution from you…

Here is what I did to resolve that.

Copied all the DMN mapping files into my project resources folder. Added below to my application.properties file

flowable.customMybatisXMLMappers[0] = mappers/CustomMybatisXmlMapper.xml
flowable.customMybatisXMLMappers[1] = org/flowable/dmn/db/mapping/common.xml
flowable.customMybatisXMLMappers[2] = org/flowable/dmn/db/mapping/entity/DecisionTable.xml
flowable.customMybatisXMLMappers[3] = org/flowable/dmn/db/mapping/entity/Deployment.xml
flowable.customMybatisXMLMappers[4] =org/flowable/dmn/db/mapping/entity/HistoricDecisionExecution.xml
flowable.customMybatisXMLMappers[5] = org/flowable/dmn/db/mapping/entity/Resource.xml
flowable.customMybatisXMLMappers[6] = org/flowable/dmn/db/mapping/entity/TableData.xml

We’re currently working on a starter for Spring Boot that will solve this. Stay tuned.