Currently you can only create a Due date for a user task using a set expression with data at the workflow level. When we have multiple tasks within different requirements for the tasks due date it is not sustainable to keep adding due date information for each task within the domain model. I should be able to create a due date using a microflow which will give me access to more complex scenarios in regards to the due date field and the ability to maintain the due date calculations better within the app.
What I did in order to be able to set the due date manually is, I basically copied the process for posting comments in the comments section.
1. I created a non-persistable entity called Due Date Helper, with a Due Date attribute.
2. I created a microflow called DS_DueDateHelper_InitializeNew, and set it as the data source for the data view that has the due date field I want to set. Then I set the date field attribute to the Due Date attribute of the Due Date Helper.
3. I created a microflow called WFA_UpdateDueDateOnTask (not sure it that completely follows the correct naming convention), that accepts a parameter of a workflow task and a due date helper, and it updates the task with the date in the due date helper.
4. Then you can call the microflow in one of two ways. Either you can set it as an on change event on the date field, or you can add a button to call the microflow. I preferred the second way, because when I did it the first way, as soon as I clicked a date, it would flash in the date field for a split second and then disappear. I found that to be disconcerting. With the button method, the date sits in the field until you click the button, which is easier to work with.
I hope this helps.