Setting due date in user task

Hi, I wanted to give a value to the due date field of the user task.
I can from this link 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.

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.

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.

2 Likes

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?

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

Regards
Martin

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.

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.

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.

this link is broken , please share the new links

The link to the user task is here. FWIW, it was in the second entry of this thread.