# Setting due date in user task

**URL:** <https://forum.flowable.org/t/setting-due-date-in-user-task/7696>\
**Category:** Flowable Engine\
**Created:** [April 5, 2021, 4:43am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696 "2021-04-05T04:43:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![akki](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@akki](https://forum.flowable.org/u/akki)\
**Post date:** [April 5, 2021, 4:43am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/1 "2021-04-05T04:43:51Z")

</div>

Hi, I wanted to give a value to the due date field of the user task.  
I can from [this link](https://documentation.flowable.com/design-user-guide/3.5.0/231AA-task-user.html) that there are 3 different ways to set the due date.

I’m looking for examples that use the 3 ways mentioned in the above link to set the due date.

---

<div class="post-metadata">

**Author:** ![dbmalkovsky](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/dbmalkovsky/32/31_2.png) [@dbmalkovsky](https://forum.flowable.org/u/dbmalkovsky)\
**Post date:** [April 5, 2021, 9:38am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/2 "2021-04-05T09:38:29Z")

</div>

The link you provided is for the commercial (Enterprise) version of Flowable. This forum is for the open source version and the corresponding user task link is [here](https://flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#user-task).

If you are using the commercial product, there is a separate forum to discuss those issues. You can contact your sales rep to get access.

---

<div class="post-metadata">

**Author:** ![akki](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@akki](https://forum.flowable.org/u/akki)\
**Post date:** [April 5, 2021, 10:24am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/3 "2021-04-05T10:24:28Z")

</div>

I’m using an open source version. I think the `due date` attribute of user task is same in both versions just like other properties like `Execution Listeners`. So, was looking for the ways we can configure this property in user task.

@dbmalkovsky The link that you have shared shows an xml configuration like,  
`<userTask id="theTask" name="Important task" flowable:dueDate="${dateVariable}"/>`

I will try the expression way to set the due date field.  
Do you know if we can give a relative date in open source version, like plus minus days ahead of a date?

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [April 6, 2021, 9:10am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/4 "2021-04-06T09:10:26Z")

</div>

If expression works, you can perform any operations on the object.

Regards  
Martin

---

<div class="post-metadata">

**Author:** ![akki](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@akki](https://forum.flowable.org/u/akki)\
**Post date:** [April 6, 2021, 5:42pm UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/5 "2021-04-06T17:42:23Z")

</div>

Hi @martin.grofcik,  
Yes, the expression like {dueDate} works fine. Here `dueDate` variable contains a date string. I'm looking for a way with which I can add days to the given date variable. I found [this](https://forum.camunda.org/t/how-to-add-days-to-a-date-variable-in-a-service-task/22488) in camunda forum, not sure if flowable uses something similar or not. Based on the link shared, I tried few syntax like {LocalDate().parse(dueDate).plusDays(10).toDate()} but it didn’t work

**Update:** Okay so for now I’m creating a processVariable called LocalDate which has `org.joda.time.LocalDate` instance, using this process variable I’m able to get relative dates using syntax like this

`${LocalDate.parse(dueDate).plusDays(10).toDate()}` in `dueDate` field of user task.

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [April 8, 2021, 6:24am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/6 "2021-04-08T06:24:59Z")

</div>

> [@akki](#):
>
> Here `dueDate` variable contains a date string

That’s something unexpected for me. I would expect `dueDate` to be a `java.util.Date` instance. And after that you can invoke any method on the `Date` object afterwards.

---

<div class="post-metadata">

**Author:** ![akki](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@akki](https://forum.flowable.org/u/akki)\
**Post date:** [April 8, 2021, 1:05pm UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/7 "2021-04-08T13:05:52Z")

</div>

I can pass both, date as a string and `java.util.Date` like this

I choose to pass date as a string because I wanted to add days in the `dueDate`. I didn’t know how to do that with `java.util.Date` object only.  
So I thought to use static method parse of `org.joda.time.LocalDate` to get LocalDate object from the date as string. After that, I can use `plus..()` methods available there to add days, weeks, etc.

---

<div class="post-metadata">

**Author:** ![dilwaria](https://avatars.discourse-cdn.com/v4/letter/d/3da27b/32.png) [@dilwaria](https://forum.flowable.org/u/dilwaria)\
**Post date:** [December 6, 2023, 12:11pm UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/8 "2023-12-06T12:11:02Z")

</div>

> [@akki](#):
>
> LocalDate.parse(dueDate).plusDays(10).toDate()

this link is broken , please share the new links

---

<div class="post-metadata">

**Author:** ![dbmalkovsky](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/dbmalkovsky/32/31_2.png) [@dbmalkovsky](https://forum.flowable.org/u/dbmalkovsky)\
**Post date:** [December 7, 2023, 9:17am UTC](https://forum.flowable.org/t/setting-due-date-in-user-task/7696/9 "2023-12-07T09:17:39Z")

</div>

The link to the [user task](https://www.flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#user-task) is here. FWIW, it was in the second entry of this thread.
