Timer intermediate event doesn’t fire

I’m have a spring boot application running on my local machine. If I include dependency to flowable-spring-boot-starter-rest v.7.1.0 in my project pom.xml, the timer intermediate event doesn’t fire any more. I need rest api to monitor the process instance state, executions, variables, etc.

What kind of a dependency do you have before adding the flowable-spring-boot-starter-rest? Or is it only when you update to 7.1.0?

Can you provide a minimal example showing the problem?

Cheers,
Filip

I have used the example from this post: Timer Boundary and Catching Event usage from Java code - #9 by japelleg - DelayDiagram.bpmn + DelayTask.java. Without dependency from flowable-spring-boot-starter-rest the timers are functioning. My initial version was 7.1.0.

flowable.database-schema-update=true
flowable.rest.enabled=enabled

The important part is the entire engine creation. Are you using flowable-spring-boot-starter or you are creating the engine on your own?

This has a huge impact on things. If you have your own custom configuration and then add the Flowable Spring Boot auto configurations not everything might work as expected. That’s why I am asking for a minimal example that we can look at and try.

Cheers,
Filip

application.properties:

# H2 Database settings (Persistent)
spring.datasource.url=jdbc:h2:file:./db/demo
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.sql.init.platform=h2

flowable.process.definition-location-prefix=classpath:/processes/
flowable.database-schema-update=true

dependencies:

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

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

		<!---->
		<dependency>
			<groupId>org.flowable</groupId>
			<artifactId>flowable-spring-boot-starter-rest</artifactId>
			<version>7.1.0</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
			<version>6.4.2</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
			<version>6.4.2</version>
		</dependency>

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

I can send a sample project if I have a proper email address.

I think that you can send me a direct message here with a project that works and that it doesn’t

Here is the demo project. It can be build with commented dependency – then timers are functioning. When the dependeny is uncommented and the project is build – the timers are not functioning

org.flowable flowable-spring-boot-starter-rest 7.1.0

(Attachment demo.7z is missing)

Perhaps the forum blocks this. Can you perhaps create a project on GitHub and share that?

Link to test project: GitHub - TihomirTrifonov/flowable_demo: test project demonstrating an issue with flowable timer events

Thanks for sharing that @trifonovt. The problem is not in the dependency. I could see the same problem even without that.

The problem is the fact that you are doing

    public FlowableService(ProcessEngineConfiguration processEngineConfiguration) {
        this.processEngineConfiguration = processEngineConfiguration;
        this.processEngine = processEngineConfiguration.buildProcessEngine();
        this.runtimeService = processEngine.getRuntimeService();
    }

i.e. you are calling the buildProcessEngine(), this would create a dedicated ProcessEngine which would be different then the one exposed in the Spring Application Context which takes care of the async executors.

If I change the constructor to something like:

    public FlowableService(RuntimeService runtimeService) {
        this.runtimeService = runtimeService;
    }

i.e. inject the service, then everything works as expected.

Hope this helps.

Cheers,
Filip