HOR-1319 "Registros corruptos: Crea 2 registros de un Elemento..." SOLVED
Issue:
Registros corruptos: Crea 2 registros de un Elemento con 2 Tareas, se debe borrar los q no se usan
Cause:
- El problema se presenta cuando se tiene la combinacion gateway-to-gateway y al hacer (por ejemplo) un movimiento
de algun elemento del proceso y posteriormente guardarlo. Esto ocasiona que se creen registros corruptos en las tablas
TASK, ROUTE y ELEMENT_TASK_RELATION
- Este problema fue ocasionado por:
> Commit: 137a4ea2237573a54964414f477e13a4f5c76a5d, Card: PMLOCAL-3840
El commit 137a4ea2237573a54964414f477e13a4f5c76a5d tambien origino los siguientes issues:
> Commit: 6bb8ad6cc05a3d8e671baa5d358b409c1f2710f6, Card: HOR-421
> Commit: 9e8030904a4c0f4f670fc159c9220fead10a5859, Card: PMLOCAL-4270
> Commit: d3296132bf13f81aee12c0f7696d5952d79ee323, Card: HOR-1383
> Commit: b58dc888c1f54d981fc329c3a35cb4294785e0f7, Card: HOR-1358
Solution:
Se revirtieron los cambios de los commits involucrados, con el siguiente detalle:
- Commit 137a4ea2237573a54964414f477e13a4f5c76a5d: Se revirtio el cambio; se soluciono el problema problema planteado en el card
- Commit 6bb8ad6cc05a3d8e671baa5d358b409c1f2710f6: Se revirtio el cambio; se soluciono el problema problema planteado en el card
- Commit 9e8030904a4c0f4f670fc159c9220fead10a5859: Se revirtio el cambio
- Commit d3296132bf13f81aee12c0f7696d5952d79ee323: Se revirtio el cambio
- Commit b58dc888c1f54d981fc329c3a35cb4294785e0f7: Se revirtio el cambio; se soluciono el problema planteado segun el analisis del commit
This commit is contained in:
@@ -25,10 +25,6 @@ class Workflow extends Handler
|
||||
protected $process;
|
||||
protected $proUid;
|
||||
|
||||
protected $tasks = array();
|
||||
protected $routes = array();
|
||||
|
||||
|
||||
public function __construct($data = null)
|
||||
{
|
||||
if (! is_null($data)) {
|
||||
@@ -66,13 +62,13 @@ class Workflow extends Handler
|
||||
$data['PRO_CATEGORY'] = array_key_exists('PRO_CATEGORY', $data) ? $data['PRO_CATEGORY'] : "";
|
||||
|
||||
try {
|
||||
|
||||
|
||||
// Check to make sure that there aren't any html sneaking into process titles.
|
||||
|
||||
$testTitle = htmlspecialchars($data['PRO_TITLE']);
|
||||
|
||||
if($testTitle != $data['PRO_TITLE']) {
|
||||
$data['PRO_TITLE'] = $testTitle;
|
||||
|
||||
if($testTitle != $data['PRO_TITLE']) {
|
||||
$data['PRO_TITLE'] = $testTitle;
|
||||
}
|
||||
|
||||
self::log("Create Process with data:", $data);
|
||||
@@ -373,7 +369,7 @@ class Workflow extends Handler
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function addRoute($fromTasUid, $toTasUid, $type, $condition = "", $default = 0, $eventUidOrigin = "")
|
||||
public function addRoute($fromTasUid, $toTasUid, $type, $condition = '', $default = 0)
|
||||
{
|
||||
try {
|
||||
$validTypes = array("SEQUENTIAL", "SELECT", "EVALUATE", "PARALLEL", "PARALLEL-BY-EVALUATION", "SEC-JOIN", "DISCRIMINATOR");
|
||||
@@ -393,21 +389,13 @@ class Workflow extends Handler
|
||||
//$oTasks->deleteAllRoutesOfTask($this->proUid, $fromTasUid);
|
||||
//}
|
||||
|
||||
if($toTasUid == "-1"){
|
||||
$route = \Route::findOneBy(array(
|
||||
\RoutePeer::TAS_UID => $fromTasUid,
|
||||
\RoutePeer::ROU_NEXT_TASK => $toTasUid,
|
||||
\RoutePeer::ROU_ELEMENT_ORIGIN => $eventUidOrigin
|
||||
));
|
||||
} else {
|
||||
$route = \Route::findOneBy(array(
|
||||
\RoutePeer::TAS_UID => $fromTasUid,
|
||||
\RoutePeer::ROU_NEXT_TASK => $toTasUid
|
||||
));
|
||||
}
|
||||
$route = \Route::findOneBy([
|
||||
\RoutePeer::TAS_UID => $fromTasUid,
|
||||
\RoutePeer::ROU_NEXT_TASK => $toTasUid
|
||||
]);
|
||||
|
||||
if (is_null($route)) {
|
||||
$result = $this->saveNewPattern($this->proUid, $fromTasUid, $toTasUid, $type, $condition, $default, $eventUidOrigin);
|
||||
$result = $this->saveNewPattern($this->proUid, $fromTasUid, $toTasUid, $type, $condition, $default);
|
||||
} else {
|
||||
$result = $this->updateRoute($route->getRouUid(), array(
|
||||
"TAS_UID" => $fromTasUid,
|
||||
@@ -521,7 +509,7 @@ class Workflow extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
private function saveNewPattern($sProcessUID = "", $sTaskUID = "", $sNextTask = "", $sType = "", $condition = "", $default = 0, $elementUidOrigin = "")
|
||||
private function saveNewPattern($sProcessUID = '', $sTaskUID = '', $sNextTask = '', $sType = '', $condition = '', $default = 0)
|
||||
{
|
||||
try {
|
||||
self::log("Add Route from task: $sTaskUID -> to task: $sNextTask ($sType)");
|
||||
@@ -544,7 +532,6 @@ class Workflow extends Handler
|
||||
$aFields["ROU_CASE"] = (int)($aRow["ROUTE_NUMBER"]) + 1;
|
||||
$aFields["ROU_TYPE"] = $sType;
|
||||
$aFields["ROU_DEFAULT"] = $default;
|
||||
$aFields["ROU_ELEMENT_ORIGIN"] = $elementUidOrigin;
|
||||
|
||||
if(! empty($condition)) {
|
||||
$aFields['ROU_CONDITION'] = $condition;
|
||||
|
||||
Reference in New Issue
Block a user