El end event solo termina el hilo (thread) actual del proceso. No termina todo el caso si hay dos o más hilos. En tu proceso has usado gateways paralelos separado el caso en varios hilos. Tienes que reunir los hilos con converging gateways en solo un hilo para terminar el caso. Si utilizas gateways exclusivos, solo tendras un hilo y puedes evitar el problema.
Si no puedes cambiar tu proceso, la otra opción es escribir directamente a las tablas APP_DELEGATION, APP_CACHE_VIEW y APPLICATION para cerrar todos los hilos del caso.
Primero, crea el archivo
workflow/engine/config/execute-query-blacklist.ini con el siguiente contenido:
Code: Select all;;;;;ExecuteQuery Blacklist Configuration File;;;;;
;The statement delimiter is "|"
;;;;;Statements Settings;;;;;
;The following are statements that are not allowed to be executed
;example: queries="INSERT|UPDATE|REPLACE|DELETE"
queries = "INSERT|REPLACE|DELETE"
;;;;;Tables Settings;;;;;
;The following tables are restricted to be executed along with the statements defined previously.
;example: pmtables="PMTABLE1|PMTABLE2"
pmtables = ""
Si estas usando Linux, cambia el dueño del archivo al usuario de Apache.
En Red Hat/CentOS:
Code: Select allchown apache:apache workflow/engine/config/execute-query-blacklist.ini
En Debian/Ubuntu:
Code: Select allchown www-data:www-data workflow/engine/config/execute-query-blacklist.ini
Si ya tienes el archivo en tu instalación de ProcessMaker, cambia esta línea:
Code: Select allqueries="INSERT|UPDATE|REPLACE|DELETE"
a:
Segundo, crea el siguiente trigger en tu proceso:
Code: Select all$index = @@INDEX;
$caseId = @@APPLICATION;
$now = date("Y-m-d H:i:s");
$sql = "UPDATE APP_DELEGATION SET DEL_THREAD_STATUS='CLOSED', DEL_FINISH_DATE='$now'
WHERE APP_UID='$caseId' AND DEL_THREAD_STATUS='OPEN' AND DEL_INDEX<>$index";
executeQuery($sql);
$sql = "UPDATE APPLICATION SET APP_STATUS='COMPLETED' WHERE APP_UID='$caseId'";
executeQuery($sql);
$sql = "UPDATE APP_CACHE_VIEW SET APP_STATUS='COMPLETED', DEL_THREAD_STATUS='CLOSED',
DEL_FINISH_DATE='$now'
WHERE APP_UID='$caseId' AND DEL_THREAD_STATUS='OPEN' AND DEL_INDEX<>$index";
executeQuery($sql);
Tercero, setea este trigger para ejecutar despues de enrutamiento (after routing) en cada tarea que termina con un end event.
Adjunto un proceso para demostrar como funciona este trigger:
(67.04 KiB) Downloaded 400 times