- Thu Aug 15, 2019 6:11 pm
#826008
Hello, we are having trouble setting the reminder when a task is overdue for our cases in Processmaker, we are trying to follow the steps mentioned in the following web page: https://www.pmusers.com/index.php/Send_ ... is_overdue
We have our installation of BPM in a Centos release 7.5 server. As the web mentions and also I investigated in forum.processmaker.com, we must case a specific process that loops endlessly to execute a script forever. We created a process called 'Reminder Test'.
Inside the script task, it contains the following code:
Now as the process is finished, we log into the server and we tried to execute twice the timereventcon.php located in our workflow directory then engine->bin->timereventcon.php.
Just to emphasize we have executed the following command php -f timereventcron.php many times and only once we have received 3 mails of 14. Right now I executed the query and returns me 5 records.
am not receiving mails anymore although I have executed the timereventcron.php again twice.
The only thing left, that I think it is not necessary is to configure the crontabs to execute the command periodically until we have this resolved.
The terminal logs are the following taking into account that our workflow folder in the server is called "workflow".
Any information that might be helpful it will be helpful.
We have our installation of BPM in a Centos release 7.5 server. As the web mentions and also I investigated in forum.processmaker.com, we must case a specific process that loops endlessly to execute a script forever. We created a process called 'Reminder Test'.
Inside the script task, it contains the following code:
Code: Select all
//find the task ID by running a case in the other process and look at the TASK system variable:
$taskId = '8087765225d35dd85351ca7023653810'; <-- Our task ID
//set to the same email address used in Admin > Settings > Email Servers:
$emailFrom = 'ProcessMaker@sanmina.com';
$g = new G();
$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");
}
foreach ($aCases as $aCase) {
$c = new Cases();
$aCaseInfo = $c->loadCase($aCase['APP_UID'], $aCase['DEL_INDEX']);
$aData = array(
'caseNo' => $aCase['APP_NUMBER'],
'caseTitle' => $aCase['APP_TITLE'],
'caseStatus' => $aCase['APP_STATUS'],
'taskName' => $aCase['APP_TASK_TITLE'],
'taskAssignedDate' => $aCase['DEL_DELEGATE_DATE'],
'taskDueDate' => $aCase['DEL_TASK_DUE_DATE'],
'caseCreatedBy' => $aCaseInfo['CREATOR'],
'caseStartDate' => $aCaseInfo['CREATE_DATE'],
'caseUpdatedDate'=> $aCaseInfo['UPDATE_DATE'],
'caseLink' => ($g->is_https() ? "https://" : "http://") . $_SERVER['SERVER_NAME'] .
//':' . $_SERVER['SERVER_PORT'] . //comment out if no port number
'/sys'.@@SYS_SYS.'/'.@@SYS_LANG.'/'.@@SYS_SKIN.'/cases/open?APP_UID=' .
$aCase['APP_UID'] . '&DEL_INDEX=' . $aCase['DEL_INDEX'] . '&action=draft'
);
$aUser = userInfo($aCase['USR_UID']);
@@mailSent = PMFSendMessage(@@APPLICATION, $emailFrom, $aUser['mail'], '', '',
'Overdue case ' . $aCase['APP_TITLE'], 'overdueCase.html', $aData);
print "\nSending email to {$aUser['mail']} for case {$aCase['APP_TITLE']}\n";
}
Now as the process is finished, we log into the server and we tried to execute twice the timereventcon.php located in our workflow directory then engine->bin->timereventcon.php.
Just to emphasize we have executed the following command php -f timereventcron.php many times and only once we have received 3 mails of 14. Right now I executed the query and returns me 5 records.
am not receiving mails anymore although I have executed the timereventcron.php again twice.
The only thing left, that I think it is not necessary is to configure the crontabs to execute the command periodically until we have this resolved.
The terminal logs are the following taking into account that our workflow folder in the server is called "workflow".
Any information that might be helpful it will be helpful.
Attachments
DeepinScreenshot_select-area_20190815103240.png (115.29 KiB) Viewed 3410 times
DeepinScreenshot_select-area_20190815103221.png (112.63 KiB) Viewed 3410 times
DeepinScreenshot_select-area_20190815103145.png (103.03 KiB) Viewed 3410 times
DeepinScreenshot_select-area_20190815103207.png (112.69 KiB) Viewed 3410 times
DeepinScreenshot_select-area_20190815103027.png (12.68 KiB) Viewed 3410 times
DeepinScreenshot_select-area_20190815102924.png (45.71 KiB) Viewed 3410 times