From 21b8072452b45be4f1516696a7f58f572d9bb8dc Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Mon, 2 Mar 2015 17:48:53 -0400 Subject: [PATCH 1/2] PM-1700 "Ocurre un error al importar y actualizar un proceso..." SOLVED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: Ocurre un error al importar y actualizar un proceso de tipo bpmn, despliega un error sin descripció el proceso se convierte en un proceso de tipo classic Cause: Mala definicion de variables para el "Add Audit Log" Solution: Se a suprimido las variables, ahora se utiliza el objeto para el seteo de variables --- workflow/engine/classes/model/OutputDocument.php | 10 ++++++---- workflow/engine/classes/model/Triggers.php | 16 ++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/workflow/engine/classes/model/OutputDocument.php b/workflow/engine/classes/model/OutputDocument.php index 7a0e2fd64..9929c2e7c 100755 --- a/workflow/engine/classes/model/OutputDocument.php +++ b/workflow/engine/classes/model/OutputDocument.php @@ -201,7 +201,7 @@ class OutputDocument extends BaseOutputDocument } $description .= ", By clicking on the generated file link: ".$genLink; G::auditLog("CreateOutputDocument", $description); - + return $aData['OUT_DOC_UID']; } else { $sMessage = ''; @@ -329,9 +329,11 @@ class OutputDocument extends BaseOutputDocument Content::removeContent('OUT_DOC_TEMPLATE', '', $oOutputDocument->getOutDocUid()); $iResult = $oOutputDocument->delete(); $oConnection->commit(); - //Add Audit Log - G::auditLog("DeleteOutputDocument", "Output Document Name: ".$outputName.", Output Document Uid: ".$sOutDocUid.", Description: ".$outputDesc.", Filename generated: ".$outputFile); + //Add Audit Log + G::auditLog("DeleteOutputDocument", "Output Document Name: " . $oOutputDocument->getOutDocTitle() . ", Output Document Uid: " . $sOutDocUid . ", Description: " . $oOutputDocument->getOutDocDescription() . ", Filename generated: " . $oOutputDocument->getOutDocFilename()); + + //Return return $iResult; } else { throw (new Exception('This row doesn\'t exist!')); @@ -845,7 +847,7 @@ class OutputDocument extends BaseOutputDocument $sContent = str_ireplace("", "", $sContent); $sContent = str_replace($nrthtml, $nrt, $sContent); - + $sContent = str_replace("margin-left", "text-indent", $sContent); // define Save file diff --git a/workflow/engine/classes/model/Triggers.php b/workflow/engine/classes/model/Triggers.php index 13321d6d0..0f381703c 100755 --- a/workflow/engine/classes/model/Triggers.php +++ b/workflow/engine/classes/model/Triggers.php @@ -189,7 +189,7 @@ class Triggers extends BaseTriggers $description .= ", Description: ".$aData['TRI_DESCRIPTION']; } G::auditLog("CreateTrigger", $description); - + return $result; } else { $con->rollback(); @@ -240,18 +240,14 @@ class Triggers extends BaseTriggers $con->begin(); $oTri = TriggersPeer::retrieveByPK( $TriUid ); if (!is_null($oTri)) { - $triggerName = $this->getTriTitle(); - $triggerDesc = $this->getTriDescription(); - Content::removeContent( 'TRI_TITLE', '', $this->getTriUid()); - Content::removeContent( 'TRI_DESCRIPTION', '', $this->getTriUid()); + Content::removeContent("TRI_TITLE", "", $TriUid); + Content::removeContent("TRI_DESCRIPTION", "", $TriUid); + $result = $oTri->delete(); $con->commit(); + //Add Audit Log - $description = "Trigger Name: ".$triggerName.", Trigger Uid: ".$TriUid; - if (isset ( $triggerDesc )) { - $description .= ", Description: ".$triggerDesc; - } - G::auditLog("DeleteTrigger", $description); + G::auditLog("DeleteTrigger", "Trigger Name: " . $oTri->getTriTitle() . ", Trigger Uid: " . $TriUid . ", Description: " . $oTri->getTriDescription()); } return $result; } catch (Exception $e) { From 752e65a57f95cf1c1b46b752de2accd7f6777be3 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Tue, 3 Mar 2015 16:32:11 -0400 Subject: [PATCH 2/2] PM-1691 "0016872: Event execution times are not being..." SOLVED Issue: 0016872: Event execution times are not being generated correctly Cause: Se esta mandando un numero real (ej 955.33) a la funcion "strtotime" Solution: Se esta redondeando el numero con la funcion "round", para que de esa manera se mande un numero entero a la funcion "strtotime" Explanation: - En nuestro "Calendario" se tiene definido por default que son 8 horas de trabajo por dia (8 horas/dia) - En el proceso adjunto en el bug, se tiene definido lo siguiente: > ... > The time starts with task: Task2 > Estimated Task duration: 8 hours (esto se transforma a: 0.33333333333333 (8/24), segun la wiki) > Execution time: 0 days After interval ends > ... Estos valores mas el resto de campos son almacenados en la tabla "EVENT" - Ahora como ejemplo tenemos el siguiente caso: en fecha y hora "2015-03-03 13:49:52" se inicia un caso con el Task1 y es derivado al Task2, entonces se crea un registro en la tabla "APP_EVENT". El campo que es objeto de estudio es "APP_EVENT.APP_EVN_ACTION_DATE", el cual tiene un valor de "2015-03-03 16:29:52" - Entonces el analisis es el siguiente: 0.33333333333333 dias * 8 horas/dia = 2.6666666666666 horas Lo que quiere decir que el cron.php ejecutara/iniciara/revisara el caso el "2015-03-03 13:49:52" + "2.6666666666666 horas" osea el "2015-03-03 16:29:52" --- workflow/engine/classes/class.calendar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.calendar.php b/workflow/engine/classes/class.calendar.php index 07939d4bd..e6e28c5b9 100755 --- a/workflow/engine/classes/class.calendar.php +++ b/workflow/engine/classes/class.calendar.php @@ -414,7 +414,7 @@ class calendar extends CalendarDefinition $hoursDuration -= (float)($secondRes/3600); //$dataLog[] = (float)($secondRes/3600); } else { - $newDate = date('Y-m-d H:i:s', strtotime('+' . (((float)$hoursDuration)*3600) . ' seconds', strtotime($newDate))); + $newDate = date("Y-m-d H:i:s", strtotime("+" . round(((float)($hoursDuration)) * 3600) . " seconds", strtotime($newDate))); //$dataLog[] = (float)($hoursDuration); $hoursDuration = 0; } @@ -797,4 +797,4 @@ class calendar extends CalendarDefinition } } -?> \ No newline at end of file +?>