Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality
Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By fshomloo
#783513
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
User avatar
By programerboy
#795007
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
User avatar
By amosbatto
#795060
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
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]