Adicion en importacion

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-07-22 16:57:24 -04:00
parent 23e1529459
commit e472b6846d
4 changed files with 106 additions and 2 deletions

View File

@@ -1588,6 +1588,31 @@ class Processes
}
}
/**
* Create "Process Variables" records
*
* @param array $arrayData Data to create
*
* return void
*/
public function createProcessVariables(array $arrayData)
{
try {
foreach ($arrayData as $value) {
$processVariables = new ProcessVariables();
$record = $value;
if ($processVariables->Exists($record["VAR_UID"])) {
$result = $processVariables->remove($record["VAR_UID"]);
}
$result = $processVariables->create($record);
}
} catch (Exception $e) {
throw $e;
}
}
/**
* Gets Input Documents Rows from aProcess.
*
@@ -2597,6 +2622,32 @@ class Processes
}
}
/**
* Get "Process Variables" records of a Process Variables
*
* @param string $processUid Unique id of Process
*
* return array Return an array with all "Process Variables"
*/
public function getProcessVariables ($sProUid)
{
try {
$aVars = array ();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( ProcessVariablesPeer::PRJ_UID, $sProUid );
$oDataset = ProcessVariablesPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aVars[] = $aRow;
$oDataset->next();
}
return $aVars;
} catch (Exception $oError) {
throw $oError;
}
}
/**
* Get "Process User" (Groups) records of a Process
*
@@ -2965,6 +3016,7 @@ class Processes
$oData->processCategory = $this->getProcessCategoryRow( $sProUid );
$oData->taskExtraProperties = $this->getTaskExtraPropertiesRows( $sProUid );
$oData->processUser = $this->getProcessUser($sProUid);
$oData->processVariables = $this->getProcessVariables($sProUid);
$oData->groupwfs = $this->groupwfsMerge($oData->groupwfs, $oData->processUser, "USR_UID");
@@ -4007,6 +4059,8 @@ class Processes
$this->createTaskExtraPropertiesRows( isset( $oData->taskExtraProperties ) ? $oData->taskExtraProperties : array () );
$this->createProcessUser((isset($oData->processUser))? $oData->processUser : array());
$this->createProcessVariables((isset($oData->processVariables))? $oData->processVariables : array());
}