# Synchronizing status between Flowable and External DB

**URL:** <https://forum.flowable.org/t/synchronizing-status-between-flowable-and-external-db/1659>\
**Category:** Flowable Engine\
**Created:** [February 18, 2018, 12:18pm UTC](https://forum.flowable.org/t/synchronizing-status-between-flowable-and-external-db/1659 "2018-02-18T12:18:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![booshan](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@booshan](https://forum.flowable.org/u/booshan)\
**Post date:** [February 18, 2018, 12:18pm UTC](https://forum.flowable.org/t/synchronizing-status-between-flowable-and-external-db/1659/1 "2018-02-18T12:18:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 28, 2018, 8:42am UTC](https://forum.flowable.org/t/synchronizing-status-between-flowable-and-external-db/1659/2 "2018-02-28T08:42:04Z")

</div>

One thing to look into is the JPA integration: [https://flowable.org/docs/userguide/index.html#\_jpa](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.
