cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Best way to expire a task?

Jump to solution

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?

0 Kudos
Reply
16 Replies
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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.

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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)

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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.

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

Hi, Rick.

You're right, this is wrong.  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.

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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!  It is for sure not a best practice but will perhaps do what you want.

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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".  

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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?

Reply
Workflow Hero

Re: Best way to expire a task?

Jump to solution

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.

Reply