Synchronizing status between Flowable and External DB

Flow Gurus, I have a quick question.

I am maintaining the persistence of objects using JPA. These objects should maintain the status of the records. I would like to keep those status managed by Flowable. I am able to achieve this using the service task below.

	<serviceTask id="setStatusPendingConfirm" name="Set Pending Confirm" 
		flowable:expression="${model.setStatus('Pending Confirm')}" />

But I would like to set the status automatically based on the user task it is waiting for, or the end state. For example when the user task “Confirm” is created, I want to set the status to “Pending Confirm”, instead of creating a service task before this user task.

Can you please suggest how I could achieve this?

Regards
Booshan

One thing to look into is the JPA integration: https://flowable.org/docs/userguide/index.html#_jpa

Wrt your question, you could add those things to TaskListeners instead of explicitly modeling them in a service task. That way, they’re not hidden.