Camunda and DB

Hey Guys,
When you have manual tasks which need to be completed, I would like to know what happen when you complete the task and the computation starts again.
Do you store the status of the process in the database, so when the task has been completed you recover the status from the db and you continue with the computation of the process?
And in general how does it work the persistency when you run a process?

I have seen from this peace of documentation: https://docs.camunda.org/manual/7.5/user-guide/process-engine/database/ that you documented the database schema.
But I would like to know better what happen behind the scene when:

  • a process is started
  • a process encounter a manual task
  • a process starts again after the interruption given by the manual task encountered
    at database level.

Thanks a lot

Hi @rikirenz,

I’m afraid I don’t have the time to write a general introduction. I can try to answer more specific questions, though.

Some more resources to learn about this:

Cheers,
Thorben

1 Like

Thanks @thorben for the reply,
But I have another question:

When a process instance has to be reactivated because a user task was executed, the process status has to be recovered from the db? Is the process status always recovered from the DB in these kind of situations or we use the db to recover the process status only in case we need to rollback?

Thanks,
Riccardo

Hi Riccardo,

That’s correct. You will find an entries in the table ACT_RU_TASK and ACT_RU_EXECUTION in that case.

Whenever a process instance is continued based on an outside trigger, the process instance state is loaded from the database tables. Rollback is a concept that any transactional database provides out of the box. The two things (resuming a process and rolling back a transaction) are not immediately related.

Cheers,
Thorben

Hey @thorben,
I am developing a simulation engine for BPMN & BPSIM. For what I need to do every time there is a task I convert it to a user task in order to run some specific code that is necessary for my simulation.

I was wondering if it’s possible to avoid this step where camunda needs to store the status in the DB. Because I think this slows down a lot my simulation. I would like to store the status in a specific data strucutre just to speed up the computation. Do you think it is something doable and if it is doable where I should start to look?

Thanks Riccardo

Hi Riccardo,

Persistence and transaction management are rather central to the process engine. While certainly doable, I think the effort is very high to replace the relational database by something else. So the practical solution could be to use the H2 in-memory database, which should introduce the least overhead.

Cheers,
Thorben