Skip to main content

So it appears that the Due Date field in a task does nothing. This discussion seems to confirm my trial and error: https://community.nintex.com/message/33409.

I'm wondering how best to expire a task. I have a workflow that does this:

  1. Assigned To: Gets Initial Task
  2. Accountable Owner: Gets Initial Task to approve or reject
  3. IF REJECT
  4. Assigned To: Gets Subsequent Task
  5. The approve/subsequent task loop
  6. Workflow only progresses if task is approved (either Initial or Subsequent)

If any of these tasks are not completed within the allotted time, I want them to expire and I want the workflow to end. The "allotted time" is the difference between the Start Date and the Due Date. The requestor specifies both. I have the pieces I need, I just need to know the best way to expire the task and update the request so the status is set to "Expired".

When I use the Request Review action that does not have reminders, I run it in parallel with a "Pause For" action, which sends a notification that includes a link back to the original task. I was thinking something similar would work for this. I started assembling this process:

task expire parallel action pause for

Seems a bit clunky. Is this the best way to go? Thoughts?

Hi ‌,

Interesting proposal. I am not sure what will happen with the task. Somehow it seems wrong.

I think the following action can be of more use: Complete Workflow Task

You have to use the 'Action ID' and also use another date calculation.

Cheers,

Rick


Actually, it worked. I'm not 100% in love with my solution and will be taking a look at your suggestion today. I want to develop my workflow the "right way", so if there is an action that is designed for this sort of thing, then I will want to use it.

I'll let you know what I discover.


what you mean with 'to expire task'?

if I understand your requirements correctly it could be handled with state machine (SM) easily:

- SM 1st branch - assigns 'Initial task' to an 'Assignee' and 'Accountable owner'. if task is approved by either of them, SM ends and workflow moves on. if task is rejected, SM advances to branch 2

- SM 2nd branch - assigns 'Subsequent task' to an 'Assignee'. if subsequent task is approved, SM ends and workflow moves on again. if task is rejected..... (you have to decide - you haven't specified what should happen in this case)


Hi, Marian.


I have thought about redesigning my workflow as a state machine. I want a task to "expire" if the person who is assigned to the task does not respond within the designated time. If I am assigned a task is due today by 3:00 p.m. and I do not respond, then at 3:00 I want the workflow to stop and the status to say "Task Expired". The workflow I designed with the parallel actions worked the way I thought it would. The workflow updated the status with "Task Expired" and it stopped. The task and the workflow task list shows "Completed", which I don't want, so I'll have to figure that out.


Hi, Rick.

You're right, this is wrong. confused.png Even if the task is completed, the workflow will pause until the due date before it progresses, which means that any subsequent tasks will automatically expire because it will be past the due date.

I looked at the "Complete workflow task" action, but it doesn't work with a "Flexi-task" or "Assign to-do" because I can't create an Action ID. GRR!!! I can replace the "Assign to-do" with a "Request review", and the "Flexi-task" with a "Request approval", it's just a lot of work setting them up. Ugh!

I'll let you know how it works.


O yeah. Bummer. They have no 'Action ID'.

This link might be of interest to you for some inspiration.

But I also thought about another possible option:

  1. Create a task overview list.
  2. Just before a task action, you fill the task overview list with the following info:
    1. The title of the task which should include the unique workflow instance ID
    2. The date/time before the task must be executed.
    3. The ID of the list item. This is the item that started the workflow.
  3. Create and schedule a site workflow which loops through the task overview list. When there is a match (date is exceed), you use the webservice workflow.asmx (with action 'Call web service') and the method TerminateWorkflowByName (http://help.nintex.com/en-US/sdks/SDK2013/Reference/SOAP/NW_REF_SOAP_NAV.htm) to kill the workflow with the task. The site workflow then updates the status of the list item

There are more details to be said but hopefully you get the idea. Do not forget about cleaning the task overview list! silly.png It is for sure not a best practice but will perhaps do what you want.


Why not use a Flex-task and then configure the Escalation settings for the Escalation type of  "Complete Task".  You can specify the outcome value for this, and call it "Expired" if you want.  I'm assuming you're already calculating the "allotted time" for your current workflow.  You can save that as a variable and drop it into the "time to escalation" section.  If the flex-task is not completed after the given time, the workflow will complete it with the Outcome of "Expired".  

201169_pastedImage_2.png


I can escalate both the flexi-task and the assign to-do task to "complete task", but I can only select an outcome on a flexi-task. Ugh!

Figuring out the reminders and the number of days to the due date has been fun and I'm not done yet. If my start date is 4/1/2017 and my due date is 6/1/2017, that's 61 days. The accountable owner can then select how often the person assigned to the task gets reminded during this timeframe by selecting a Reminder Frequency (weekly, bi-weekly, monthly, etc.) I have assigned values to each Reminder Frequency (7 days, 14 days, 30 days, etc.). I can use the inline function to determine the number of days between the start date and the due date, but what if my reminder frequency is every 2 weeks? How many times does 14 go into 61 and what do I do with the remainder? I'm testing my math operation now.

I wish there was a simpler way to do things. Why can't we just have an expiration date? Why doesn't the Due Date drive any logic in the workflow? Why can't there be an option to set the outcome for every task that can be escalated?


If I am assigned a task is due today by 3:00 p.m. and I do not respond, then at 3:00 I want the workflow to stop and the status to say "Task Expired".

this typical escalation case.

configure escalation so that if the task is not responded within given period of time, the task is completed. configure specific escalation/expiry outcome so that you can recognize later in workflow how the task was responded.

specific escalation outcome will create one additional task branch, use 'set workflow status' action to set workflow status to 'task' expired' (or whatever you want) within this branch.

The task and the workflow task list shows "Completed", which I don't want, so I'll have to figure that out.

task status field is predefined choice field within 'Task'  content type. being choice field there is restricted list of possible values the task can encompass.

so until you change content type definition you will not be allowed to set any other status.

on the other hand, even if you do that, default behaviour of workflow task actions is to set task status to 'completed' once the task is responded (regardless of outcome). if you wanted to set another status you would need to maintain it on your own, which brings in pointless complexity.

if you need to maintain your own statuses it's always good practice to create dedicated fields within your custom list.


Thank you, Marian. You always have good suggestions! I will give this a try.


Do you have to use a "complete task"?  Could you not use the flex-task for someone to indicate they completed something.?  Just changes the outcomes from approve/reject to complete/incomplete?


laugh.png


I can use a Flexi-task for one of my actions, but I need to use the Assigned-to for the other. The problem I faced next is that I needed some sort of indicator that the Assigned-to task was expired because I can't set an outcome. My calculations seem to be working and the task is completing due to no response. I have some language in the comments section:

I use a bit of the language as an identifier in my condition to determine if the task was expired or not:

      expired due to no response by due date. (Workflow Instance ID)

When the task completes and the workflow progresses, it will come to a condition where it will evaluate the approver comments to determine whether this language is present. If so, then the task is expired and it will go to the expired state. If not, the workflow will progress as usual to the next state.


I decided to redesign my workflow as a state machine. The Phase 1 was a much simpler process and a linear design made sense. Now the process has grown and it has gotten so complicated that a state machine makes sense.


so, did you get answers to your questions, ‌?


Yes, I did. It required a lot of engineering and math operations, but I was able to figure it out. It would be so much easier if the Due Date in the task drove the logic.


Reply