Page 1 of 1

escalonamiento en una tarea

Posted: Wed Aug 23, 2017 2:12 pm
by Willyammarcanth
Hola,
Tengo una dificultad con el ProcessMaker.
Necesito que una tarea avance a la siguiente etapa cuando alcanza un timeout o en X tiempo, como si fuera un escalonamiento.
He realizado algunas investigaciones pero no he encontrado nada que se ayude en este punto.
¿Alguien tiene alguna idea?

Re: escalonamiento en una tarea

Posted: Fri Aug 25, 2017 9:12 pm
by amosbatto
Creo que quieres un proceso así:
SkipTaskProcess.png
SkipTaskProcess.png (23.19 KiB) Viewed 2936 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
RoutingRulesToSkipTask.png (19.69 KiB) Viewed 2936 times
El intermediate timer event debe ser configurado para ejecutar periodicamente:
IntermediateTimerEventProperties.png
IntermediateTimerEventProperties.png (13.74 KiB) Viewed 2936 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