Creo que quieres un proceso así:
SkipTaskProcess.png (23.19 KiB) Viewed 2956 times
El trigger en el script task será:
Code: Select all//Set to ID of the task that will be skipped if not completed in a fixed time period:
$taskId = '27701455159a0a94c12c901018986498';
//Set to the number of minutes/hours/days/weeks to complete task.
//See: http://php.net/manual/en/function.strtotime.php
$taskDuration = '+36 hours';
@=skipTask = false; //variable checked by exclusive gateway to loop back or skip task
$caseId = @@APPLICATION;
$sql = "SELECT * FROM APP_DELEGATION WHERE APP_UID='$caseId' AND TAS_UID='$taskId'";
$result = executeQuery($sql);
if (!is_array($result) or count($result) == 0) {
throw new Exception("Unable to find record for Task 2 with query:\n$sql");
}
$finishTime = strtotime($taskDuration, strtotime($result[1]['DEL_DELEGATE_DATE']));
//if time for task has been exceded then route on the task
if (strtotime('now') >= $finishTime) {
@=skipTask = true;
$g = new G();
$g->sessionVarSave();
@@routing = PMFDerivateCase($caseId, $result[1]['DEL_INDEX'], true, $result[1]['USR_UID']);
$g->sessionVarRestore();
}
Las condiciones en el exclusive gateway son:
RoutingRulesToSkipTask.png (19.69 KiB) Viewed 2956 times
El intermediate timer event debe ser configurado para ejecutar periodicamente:
IntermediateTimerEventProperties.png (13.74 KiB) Viewed 2956 times
También, tienes que configurar tu servidor para ejecutar periodicamente el archivo timereventcron.php. Ver:
http://wiki.processmaker.com/3.2/Executing_cron.php
Adjunto el proceso que puedes estudiar:
(70.67 KiB) Downloaded 279 times