You can create a custom script that uses web services or REST to route cases based on a criteria, which is executed by a cron job, but I recommend that you create a separate process which loops to execute a script task and uses an intermediate timer event.
The basic idea is explained here:
https://www.pmusers.com/index.php/Send_ ... is_overdue
Instead of sending a message with PMFSendMessage() in the trigger, you can call PMFDerivateCase() to route on the case.
Here is the trigger that you can use in the script task:
Code: Select all//set to the ID of the task which should send an email when overdue.
//this ID can be found by running a case in Debug Mode and looking at the TASK system variable:
$taskId = '3839855285b99bcad876958079357667';
//Search for cases where the task is overdue:
$now = date("Y-m-d H:i:s");
$query= "SELECT * FROM APP_CACHE_VIEW WHERE TAS_UID='$taskId' AND
(APP_STATUS='TO_DO' OR APP_STATUS='DRAFT') AND DEL_THREAD_STATUS='OPEN' AND '$now' > DEL_TASK_DUE_DATE";
$aCases = executeQuery($query);
if (!is_array($aCases)) {
die("Error: Bad Query: $query\n");
}
$g = new G();
$g->sessionVarSave();
foreach ($aCases as $aCase) {
PMFDerivateCase($aCase['APP_UID'], $aCase['DEL_INDEX'], false, $aCase['USR_UID']);
}
$g->sessionVarRestore();
You can change the code of your SQL query. If you only want to execute on particular dates, then you should check out PHP's PHP's date() function to make a condition that you can check in the code.