Script Task: Does not work with Process Sincrono

R-1376
Script Task: Does not work with Process Sincrono

R-1376
Script Task: Does not work with Process Sincrono

R-1376
Script Task: Does not work with Process Sincrono
This commit is contained in:
Dheeyi William
2016-07-04 10:34:02 -04:00
parent fddc585aaa
commit 7d75593620

View File

@@ -1642,24 +1642,43 @@ class Derivation
$this->derivate($currentDelegation2, $nextDelegations2); $this->derivate($currentDelegation2, $nextDelegations2);
if ($delIndex > 0) { if ($delIndex > 0) {
// Send notifications - Start $flagNotification = false;
$oUser = new Users(); if ($appFields["CURRENT_USER_UID"] == '') {
$aUser = $oUser->load($appFields["CURRENT_USER_UID"]); $oCriteriaTaskDummy = new Criteria('workflow');
$oCriteriaTaskDummy->add(TaskPeer::PRO_UID, $appFields['PRO_UID']);
$sFromName = $aUser["USR_FIRSTNAME"] . " " . $aUser["USR_LASTNAME"] . ($aUser["USR_EMAIL"] != "" ? " <" . $aUser["USR_EMAIL"] . ">" : ""); $oCriteriaTaskDummy->add(TaskPeer::TAS_UID, $appFields['TAS_UID']);
$oCriteriaTaskDummy->add(
try { $oCriteriaTaskDummy->getNewCriterion(TaskPeer::TAS_TYPE, 'SCRIPT-TASK', Criteria::EQUAL)->addOr(
$oCase->sendNotifications($appFields["TAS_UID"], $oCriteriaTaskDummy->getNewCriterion(TaskPeer::TAS_TYPE, 'INTERMEDIATE-THROW-EMAIL-EVENT', Criteria::EQUAL))
$nextDelegations2, );
$appFields["APP_DATA"], $oCriteriaTaskDummy->setLimit(1);
$sApplicationUID, $oDataset = AppDelegationPeer::doSelectRS($oCriteriaTaskDummy);
$delIndex, $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$sFromName); $oDataset->next();
if ($row = $oDataset->getRow()) {
} catch (Exception $e) { $flagNotification = true;
G::SendTemporalMessage(G::loadTranslation("ID_NOTIFICATION_ERROR") . " - " . $e->getMessage(), "warning", "string", null, "100%"); }
}
if (!$flagNotification) {
// Send notifications - Start
$oUser = new Users();
$aUser = $oUser->load($appFields["CURRENT_USER_UID"]);
$sFromName = $aUser["USR_FIRSTNAME"] . " " . $aUser["USR_LASTNAME"] . ($aUser["USR_EMAIL"] != "" ? " <" . $aUser["USR_EMAIL"] . ">" : "");
try {
$oCase->sendNotifications($appFields["TAS_UID"],
$nextDelegations2,
$appFields["APP_DATA"],
$sApplicationUID,
$delIndex,
$sFromName);
} catch (Exception $e) {
G::SendTemporalMessage(G::loadTranslation("ID_NOTIFICATION_ERROR") . " - " . $e->getMessage(), "warning", "string", null, "100%");
}
// Send notifications - End
} }
// Send notifications - End
} }
} }
} }