Page 1 of 1

Timing Control - No Due Date

Posted: Fri Jun 19, 2015 6:54 pm
by fshomloo
Hi,

Is there a way to NOT set "timing Control" for a task?

I have a task within my process that has no due date (because user just need to wait for a document that arrives from the outside of of our company. The document may arrive in a week, in 6 months or a year), so we don't really have a specific due date for this task, and I don't want to set a fake due date either because if we reach that date then the task will show in red.

Any good way to do this?
Thanks

Re: Timing Control - No Due Date

Posted: Tue Aug 29, 2017 3:38 am
by jyoti123
Hello fshomloo,

There is no way that we don't set the timing Control. By default the timing control Task duration is set to 1 .Please find the documentation that will help you understand the timing control feature http://wiki.processmaker.com/index.php/ ... g_Controls

Thankyou
Regards,
Jyoti Pandey

Re: Timing Control - No Due Date

Posted: Tue Aug 29, 2017 4:48 am
by programerboy
Hi,

You have 3 way:

1. Use task time control and set a static due time for doing task. (http://wiki.processmaker.com/2.0/Tasks#TIMING_CONTROL)

2. Use task time control and check "Allow user defined timing control" option and the user assigned to the previous task set due time and send case to the next user. (http://wiki.processmaker.com/2.0/Tasks#TIMING_CONTROL)

3. Create a trigger and set the trigger on "After Routing" of previous task.
In this trigger you can update `app_cache_view` table field `DEL_TASK_DUE_DATE`, therefore you can update due date dynamic to every date you want.

Thanks

Re: Timing Control - No Due Date

Posted: Tue Aug 29, 2017 7:25 pm
by amosbatto
ProcessMaker demands that you have a due date for every task, so you should set the time to complete the task to a large amount like 1 year. If you want to set the due date based on the circumstances of your case, then I recommend using programerboy's third suggestion.

Create a trigger with code like this:
Code: Select all
//set to the ID of the next task in the process which has a variable Due Date
$nextTaskId = 'XXXXXXXXXXXXXXXXXXXXXXXXX'; 
$index = @@INDEX;
$caseId = @@APPLICATION;

if (isset(@@priority) and @@priority == 'high') {
   $dueDate = datetime("Y-m-d H:i:s", strtotime("+30 days"));
}
else {
   $dueDate = datetime("Y-m-d H:i:s", strtotime("+180 days"));
}

$sql = "UPDATE APP_DELEGATION SET DEL_TASK_DUE_DATE='$dueDate' WHERE APP_UID='$caseId' AND TAS_UID='$nextTaskId' AND DEL_INDEX > $index";
@@response1 = executeQuery($sql); 
$sql = "UPDATE APP_CACHE_VIEW SET DEL_TASK_DUE_DATE='$dueDate' WHERE APP_UID='$caseId' AND TAS_UID='$nextTaskId' AND DEL_INDEX > $index";
@@response2 = executeQuery($sql); 
Set this trigger to fire after routing in the task right before the task with the variable due date.

In this code example, @@priority is a dropdown box where the user can select the 'high' option if the task needs to be completed more quickly.

If you are using a recent version of PM, then you will need to allow UPDATE on ProcessMaker core tables in the database. See: http://wiki.processmaker.com/3.0/Consul ... ore_Tables