Multi-step form rendering with Thymeleaf + Spring Boot

Hi,

I am new to Camunda and identifying how it can be used in my Spring boot application. Thymeleaf is the technology we use for UI rendering.

Till now, I am able to create a simple spring boot application with a process that is started from the main application.

We have a 4 step process (each having a separate form ) where the user enters details and once everything filled correctly all the details will be stored in DB.

What I could not understand is, how I can use Thymeleaf for UI rendering with the help of Camunda where the entire process is defined in the BPMN file?
I do not want to use the Tasklist application here.

Thanks In Advance.

Hi @Shweta,

I think what you’re describing is an External Task Form. You can read how to create them here: https://docs.camunda.org/manual/7.12/user-guide/task-forms/#external-task-forms

Additionally, there’s a forum topic related to your problem, that I think it will help you:

Have you managed to solve your problem with the above information?

Best,
Nikola

Hi @nikola.koevski,

Thanks for the prompt reply.

Yes, I have gone through above mentioned post and tried the solution as well.
It basically provides option in Tasklist application to open an external form.

I do not intend to use Tasklist application. I want all the UI rendering to happen though my application. I cant understand how Thymeleaf UI rendering can be combined with Camunda BPMN engine through java code (Spring boot).

Regards,
Shweta P

Hi @Shweta,

Can you explain how your project is set up? Are you using the Camunda Spring Boot Starter in your project?

Best,
Nikola

Hi @nikola.koevski,

Yes, I have added below dependency of Camunda:

<dependency>
	<groupId>org.camunda.bpm.springboot</groupId>
	<artifactId>camunda-bpm-spring-boot-starter</artifactId>
	<version>3.4.0</version>
</dependency>   

and for webapp

<dependency>
	<groupId>org.camunda.bpm.springboot</groupId>
	<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
	<version>3.4.0</version>
</dependency>

Please let me know if any more information is required.

Regards,
Shweta P

Hi @Shweta,

I’m not familiar with Thymeleaf (and how it integrates with Spring Boot), but I suspect that you should be able to Autowire the TaskService to obtain the necessary data to populate you Thymeleaf form.

In order to communicate with the Process Engine afterwards, you would need to use the Engine Rest API:

<dependency>
	<groupId>org.camunda.bpm.springboot</groupId>
	<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
	<version>3.4.0</version>
</dependency>

You can find the Task related endpoints here: https://docs.camunda.org/manual/latest/reference/rest/task/

Best,
Nikola